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

body {
    font-family: 'Arial', sans-serif;
    background-color: #2a4d3e; /* Lesná zelená farba */
    color: white;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 77, 62, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid #f3d274; /* Slnečná životná farba */
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

#loading-screen p {
    margin-top: 20px;
    font-size: 1.2em;
    color: #f3d274;
}

/* UI Overlay - všetky UI prvky sú nad canvasom */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Don't set pointer-events:none - let child elements control their own click behavior */
    z-index: 999; /* Nad loading screenom keď je skrytý, pod ním keď je viditeľný */
}

/* HUD - informácie o hre */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: space-between;
    padding: 15px 25px;
    background-color: rgba(42, 77, 62, 0.8);
    border-radius: 12px;
    backdrop-filter: blur(3px);
    pointer-events: none;
}

#level-info, #sheep-counter, #breed-info {
    font-size: 1.1em;
    color: #f3d274;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Akčný lišta */
#action-bar {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    padding: 15px 25px;
    background-color: rgba(42, 77, 62, 0.85);
    border-radius: 15px;
    backdrop-filter: blur(3px);
    pointer-events: auto !important; /* UI prvky tu sú aktívne */
    z-index: 100;
}

.action-slot {
    width: 80px;
    height: 80px;
    background-color: rgba(243, 210, 116, 0.2);
    border: 2px solid #f3d274;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.action-slot:hover {
    background-color: rgba(243, 210, 116, 0.4);
    transform: scale(1.08);
}

.slot-icon {
    font-size: 1.8em;
    margin-bottom: 5px;
}

.action-slot div:last-child {
    font-size: 0.7em;
    color: #d4e9da; /* Svetylá zelená pre popisy */
}

/* Aktívny slot (práve vybraná akcia) */
.action-slot.active {
    background-color: rgba(243, 210, 116, 0.5);
    box-shadow: 0 0 15px #f3d274;
}

/* Menu obrazovky */
.menu-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(42, 77, 62, 0.9);
    padding: 40px;
    border-radius: 18px;
    text-align: center;
    min-width: 350px;
    max-width: 600px;
    z-index: 100;
    backdrop-filter: blur(5px);
    border: 2px solid #f3d274;
    display: none; /* Skryté defaultne */
}

.menu-screen, .btn {
    pointer-events: auto !important; /* Force enable clicks on menu elements */
}

.menu-screen.active {
    display: block !important;
    pointer-events: auto !important;
}

.menu-screen h1 {
    font-size: 2.8em;
    margin-bottom: 20px;
    color: #f3d274;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.menu-screen h2 {
    font-size: 2em;
    margin-bottom: 25px;
    color: #f3d274;
}

.btn {
    background-color: #c19a6b; /* Hnedá farba tlačidla */
    color: white;
    border: none;
    padding: 14px 35px;
    margin: 12px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.btn:hover {
    background-color: #d4b98f;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.btn:active {
    transform: translateY(1px);
}

/* Breed selection */
#breed-options {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.breed-card {
    background-color: rgba(243, 210, 116, 0.15);
    border: 2px solid #f3d274;
    border-radius: 12px;
    padding: 20px;
    width: 180px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.breed-card:hover {
    background-color: rgba(243, 210, 116, 0.35);
    transform: scale(1.08);
}

.breed-card.selected {
    border-color: #a8e6cf; /* Svetlomodrá farba pre vybrané plemeno */
    box-shadow: 0 0 20px #a8e6cf;
}

.breed-name {
    font-size: 1.3em;
    color: #f3d274;
    margin-bottom: 10px;
}

.breed-stats {
    list-style: none;
    font-size: 0.85em;
    color: #d4e9da;
}

/* Level selection */
#level-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.level-btn {
    width: 60px;
    height: 60px;
    background-color: #c19a6b;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.level-btn:hover {
    background-color: #d4b98f;
    transform: scale(1.1);
}

/* Tutorial overlay */
#tutorial-overlay ul {
    text-align: left;
    max-width: 500px;
    margin: 20px auto;
}

#tutorial-overlay li {
    margin-bottom: 10px;
    color: #d4e9da;
}

/* Responsive design */
@media (max-width: 768px) {
    .btn {
        padding: 12px 25px;
        font-size: 1em;
    }
    
    .menu-screen {
        min-width: 90%;
        padding: 25px;
    }
    
    #hud {
        flex-direction: column;
        gap: 8px;
    }
    
    #action-bar {
        width: 100%;
        max-width: 400px;
    }
}

/* Color scheme inspired by Nintendo but original */
:root {
    --primary-green: #2a7d38; /* Lesná zelena */
    --secondary-green: #4caf50; /* Rastlinná zelenina */
    --accent-yellow: #f3d274; /* Slnečný žltý */
    --earth-brown: #8d6e63; /* Pozemná hnĺdna farba */
    --sky-blue: #4fc3f7; /* Nebeská modrina */
    --mountain-gray: #90a4ae; /* Horský sivý */
    --wood-brown: #5d4037; /* Drevená farba domov */
}

/* Smooth transitions for UI elements */
.menu-screen, .btn {
    transition: all 0.3s ease;
}
