:root {
    --bg-color: hsl(230, 20%, 8%);
    --card-bg: hsla(230, 20%, 15%, 0.7);
    --text-main: hsl(0, 0%, 100%);
    --text-muted: hsl(230, 10%, 70%);
    --primary: hsl(35, 100%, 65%);
    /* Soft Bun Gold */
    --primary-glow: hsla(35, 100%, 65%, 0.3);
    --secondary: hsl(15, 80%, 55%);
    /* Sausage Red */
    --secondary-glow: hsla(15, 80%, 55%, 0.3);
    --accent: hsl(45, 100%, 50%);
    /* Mustard */
    --font-main: 'Outfit', sans-serif;
}

#game-title {
    display: flex;
    justify-content: center;
    gap: 2px;
}

#game-title span:nth-child(1) {
    color: #e8644e;
    text-shadow: 0 0 10px rgba(232, 100, 78, 0.4);
}

/* Ketchup */
#game-title span:nth-child(2) {
    color: #ffcc00;
    text-shadow: 0 0 10px rgba(255, 204, 0, 0.4);
}

/* Mustard */
#game-title span:nth-child(3) {
    color: #80ad27;
    text-shadow: 0 0 10px rgba(128, 173, 39, 0.4);
}

/* Pickle */
#game-title span:nth-child(4) {
    color: #f5c070;
    text-shadow: 0 0 10px rgba(245, 192, 112, 0.4);
}

/* Bun */
#game-title span:nth-child(5) {
    color: #fffff0;
    text-shadow: 0 0 10px rgba(255, 255, 240, 0.4);
}

/* Mayo */
#game-title span:nth-child(6) {
    color: #d14d35;
    text-shadow: 0 0 10px rgba(209, 77, 53, 0.4);
}

/* Sausage */


* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-main);
    overflow: hidden;
    /* Prevent scrolling during game */
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container {
    width: 100%;
    height: 100%;
    /* max-width: 600px; Remove max-width for full screen */
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at 50% 120%, hsla(35, 100%, 65%, 0.1), transparent 70%);
}

/* Header */
header {
    padding: 20px;
    text-align: center;
    z-index: 10;
}

h1 {
    font-weight: 700;
    font-size: 2.5rem;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--primary-glow);
}

.highlight {
    color: var(--primary);
    text-shadow: 0 0 15px var(--primary);
}

#sound-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    color: var(--primary);
    font-size: 1.2rem;
    z-index: 100;
    transition: background 0.2s, transform 0.2s;
}

#sound-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

#sound-btn.muted i {
    color: var(--text-muted);
}

/* Main Layout */
main {
    flex: 1;
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Screens */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    /* Hidden by default */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
    opacity: 1;
}

/* Start Screen */
.intro-text {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.leaderboard-preview {
    margin-top: 40px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    max-height: 30vh;
    overflow-y: auto;
}

.leaderboard-preview h3 {
    text-align: center;
    margin-bottom: 15px;
    color: var(--accent);
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

#top-scores-list,
#game-over-top-scores-list {
    list-style: none;
}

#top-scores-list li,
#game-over-top-scores-list li {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid hsla(0, 0%, 100%, 0.05);
    font-size: 0.95rem;
}

#top-scores-list li:last-child,
#game-over-top-scores-list li:last-child {
    border-bottom: none;
}

/* Buttons */
.btn {
    border: none;
    outline: none;
    padding: 16px 40px;
    border-radius: 50px;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.primary-btn {
    background: var(--primary);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--primary-glow);
}

.primary-btn:active {
    transform: scale(0.95);
}

.pulse-anim {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 hsla(35, 100%, 65%, 0.7);
    }

    70% {
        box-shadow: 0 0 0 15px hsla(35, 100%, 65%, 0);
    }

    100% {
        box-shadow: 0 0 0 0 hsla(35, 100%, 65%, 0);
    }
}

.secondary-btn {
    background: var(--secondary);
    color: white;
    box-shadow: 0 0 20px var(--secondary-glow);
    width: 100%;
    margin-top: 10px;
}

.text-btn {
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    padding: 15px;
    margin-top: 10px;
}

/* Game Screen */
#game-screen {
    justify-content: flex-start;
}

.hud {
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 1.2rem;
    font-weight: 700;
}

#game-area {
    position: relative;
    width: 100%;
    flex: 1;
    border-radius: 12px;
    border: 2px solid hsla(0, 0%, 100%, 0.05);
    background: hsla(230, 20%, 12%, 0.4);
    overflow: hidden;
    margin-bottom: 0;
    /* Remove bottom margin to fill screen */
    touch-action: none;
    border-bottom: 2px solid hsla(35, 100%, 65%, 0.1);
    /* Optional: remove border for cleaner full screen look */
    background: radial-gradient(circle at 50% 50%, hsla(230, 20%, 12%, 0.1), hsla(230, 20%, 5%, 0.2));
    /* Lighter background or transparent */
}

/* Game Targets */
/* Game Targets */
.target {
    position: absolute;
    background-color: transparent !important;
    /* Ensure no background color */
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: none !important;
    /* Remove any box shadow */
    border: none !important;
    /* Remove any border */
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.4));
    /* Darker shadow for better contrast */
    cursor: pointer;
    transform: scale(0);
    animation: popIn 0.3s forwards;
    transition: transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}

.target.clicked {
    transform: scale(1.5);
    opacity: 0;
}

.target.bad {
    filter: drop-shadow(0 0 5px rgba(255, 68, 68, 0.8));
}

@keyframes popIn {
    to {
        transform: scale(1);
    }
}

/* Lives Display */
.lives-display {
    color: #ff4444;
    text-shadow: 0 0 10px #ff0000;
    font-size: 1.5rem;
}

/* Damage Flash */
.damage {
    animation: flashRed 0.2s ease-out;
}

@keyframes flashRed {
    0% {
        background-color: rgba(255, 0, 0, 0.5);
    }

    100% {
        background-color: transparent;
    }
}

/* Target Styles Update */
.target.gold {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

/* Manjkajoča animacija za utripanje tarč */
@keyframes pulseTarget {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

/* Particle Effects */
.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    pointer-events: none;
    animation: particleFade 0.5s ease-out forwards;
}

@keyframes particleFade {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Game Over Screen */
#game-over-screen .final-score {
    font-size: 2rem;
    font-weight: 700;
    margin: 20px 0;
    color: var(--primary);
}

#save-score-form {
    width: 100%;
    text-align: center;
}

#player-name {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid hsla(0, 0%, 100%, 0.2);
    background: hsla(230, 25%, 20%, 0.5);
    color: white;
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 15px;
    outline: none;
    font-family: var(--font-main);
}

#player-name:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.shake {
    animation: shake 0.3s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

.instructions-content {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    width: 100%;
    margin-bottom: 20px;
    max-height: 60vh;
    overflow-y: auto;
    text-align: left;
    border: 1px solid hsla(0, 0%, 100%, 0.1);
    font-size: 0.95rem;
    line-height: 1.5;
}

.instructions-content h3 {
    margin-top: 15px;
    margin-bottom: 10px;
    color: var(--accent);
    font-size: 1.1rem;
}

.instructions-content ul {
    list-style-type: none;
    margin-bottom: 15px;
}

.instructions-content li {
    margin-bottom: 8px;
    padding-left: 10px;
    border-left: 2px solid hsla(0, 0%, 100%, 0.2);
}

.instructions-content strong {
    color: var(--text-main);
}

footer {
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}