html, body {
    background-color: #1a1a1a;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Sprečava skrolovanje */
    font-family: 'Roboto', sans-serif;
    color: #f0f0f0;
}

.game-container {
    position: absolute; 
    width: 100%;       
    height: 100%;      
    top: 0;            
    left: 0;           
}

canvas {
    width: 100%;       
    height: 100%;      
    background-color: #4ec0ca;
    position: absolute;
    top: 0;
    left: 0;
}

.ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.95));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 10;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

.ui-overlay h1 {
    font-family: 'Press Start 2P', cursive;
    font-size: 2.8em;
    color: #ffcc00;
    text-shadow: 3px 3px #d10000, 5px 5px #333;
    margin-bottom: 35px;
}

.ui-overlay h2 {
    font-size: 2.2em;
    color: #ffcc00;
    margin-bottom: 20px;
    font-weight: bold;
}

.ui-overlay p {
    font-size: 1.4em;
    line-height: 1.5;
    color: #ddd;
}

/* ================================== */
/* OVDE JE IZMENA ZA DUGMIĆE U 2 REDA */
/* ================================== */
#main-menu .button-container {
    /*display: flex;
    flex-direction: column;
    align-items: center;*/
    
    /* NOVI KOD */
    display: grid;
    grid-template-columns: 1fr 1fr; /* Dve kolone jednake širine */

    width: 90%;
    max-width: 480px; /* Povećana širina da stanu 2 dugmeta */
    gap: 10px;
}
/* DODATO PRAVILO da "Start" zauzme ceo red */
#main-menu #start-game-button {
    grid-column: 1 / -1; /* Spaja obe kolone */
}
/* DODATO PRAVILO da "Exit" bude logičnije na dnu */
#main-menu #how-to-play-button {
    grid-column: 1 / 2;
}
#main-menu #exit-button {
    grid-column: 2 / 3;
}
/* ================================== */
/* KRAJ IZMENE                         */
/* ================================== */


.menu-button {
    font-family: 'Roboto', sans-serif;
    font-size: 1.25em;
    padding: 12px 20px;
    margin: 0;
    color: white;
    background: linear-gradient(to bottom, #5c5c5c 0%, #3a3a3a 100%);
    border: none;
    border-radius: 8px;
    box-shadow: 0 3px 5px rgba(0,0,0,0.4),
                inset 0 1px 1px rgba(255,255,255,0.15);
    cursor: pointer;
    font-weight: bold;
    width: 100%;
    transition: all 0.1s ease-out;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}
.menu-button:hover {
    background: linear-gradient(to bottom, #6c6c6c 0%, #4a4a4a 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 7px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.2);
}
.menu-button:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.4), inset 0 1px 0 rgba(0,0,0,0.1);
    background: linear-gradient(to top, #5c5c5c 0%, #3a3a3a 100%);
}
#start-game-button, #confirm-level-button, #save-score-button, #watch-ad-button {
     background: linear-gradient(to bottom, #ffc107 0%, #f48a00 100%);
     color: #422a00;
     text-shadow: 1px 1px 0px rgba(255,255,255,0.4);
}
#start-game-button:hover, #confirm-level-button:hover, #save-score-button:hover, #watch-ad-button:hover {
    background: linear-gradient(to bottom, #ffca28 0%, #f9a825 100%);
}
#start-game-button:active, #confirm-level-button:active, #save-score-button:active, #watch-ad-button:active {
    background: linear-gradient(to top, #ffc107 0%, #f48a00 100%);
}
.back-button, #restart-button, #no-thanks-button {
    background: linear-gradient(to bottom, #888 0%, #555 100%);
}
.back-button:hover, #restart-button:hover, #no-thanks-button:hover {
    background: linear-gradient(to bottom, #999 0%, #666 100%);
}
.back-button:active, #restart-button:active, #no-thanks-button:active {
     background: linear-gradient(to top, #888 0%, #555 100%);
}

.button-row { display: flex; justify-content: center; margin-top: 15px; gap: 20px; }
.hidden { display: none; }

.level-select-title { margin-bottom: 15px; font-size: 1.1em; font-weight: bold; color: #ccc; }
#level-select-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; width: 80%; max-width: 450px; margin-bottom: 15px; }
.level-box { background-color: rgba(0, 0, 0, 0.4); border: 2px solid #666; padding: 12px 8px; font-size: 1.2em; font-weight: bold; cursor: pointer; transition: all 0.2s ease-in-out; border-radius: 4px; }
.level-box:hover { background-color: rgba(255, 255, 255, 0.2); transform: scale(1.05); border-color: #aaa; }
.level-box.selected { background-color: #ffb300; border-color: #fff; color: #1a1a1a; transform: scale(1.05); }
.level-box.locked { background-color: rgba(50, 50, 50, 0.7); border-color: #444; color: #777; cursor: default; }
.level-box.locked:hover { transform: none; background-color: rgba(50, 50, 50, 0.7); }
.lock-icon { font-size: 1.3em; }

#new-highscore-entry input { font-size: 1.1em; padding: 8px; margin: 15px 0; width: 60%; max-width: 280px; text-align: center; border: 2px solid #666; background: #222; color: #f0f0f0; border-radius: 4px; }
#highscore-list, #highscore-list-display { list-style: decimal; padding-left: 40px; width: 80%; max-width: 380px; font-size: 1.2em; text-align: left; margin-bottom: 15px; color: #ccc; }
#highscore-list li, #highscore-list-display li { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #444; }
#highscore-list li span:first-child, #highscore-list-display li span:first-child { color: #f0f0f0; }
#highscore-list li span:last-child, #highscore-list-display li span:last-child { font-weight: bold; color: #ffb300; }

.instructions { text-align: left; max-width: 550px; margin: 0 auto 25px auto; }
.instructions p { font-size: 1.1em; margin: 8px 0; display: flex; align-items: center; color: #ccc; }
.instructions img { width: 28px; height: 28px; margin-right: 8px; vertical-align: middle; }

.setting-item { display: flex; justify-content: space-between; align-items: center; width: 80%; max-width: 350px; margin: 12px 0; font-size: 1.3em; }
.setting-item label { margin-right: 15px; }
.toggle-button { font-size: 0.9em; padding: 6px 15px; border: 2px solid #666; cursor: pointer; min-width: 70px; text-align: center; border-radius: 4px; font-weight: bold; transition: all 0.1s ease-out; }
.toggle-button.on { background-color: #4CAF50; color: white; border-color: #388E3C; box-shadow: inset 0 0 5px rgba(0,0,0,0.3); }
.toggle-button.off { background-color: #f44336; color: white; border-color: #D32F2F; box-shadow: inset 0 0 5px rgba(0,0,0,0.3); }
.toggle-button:hover { opacity: 0.9; }

/* Language Dropdown */
.language-dropdown {
    font-size: 1em;
    padding: 8px 12px;
    border: 2px solid #666;
    background: linear-gradient(to bottom, #333 0%, #222 100%);
    color: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    min-width: 150px;
    text-align: center;
}
.language-dropdown:hover {
    border-color: #888;
    background: linear-gradient(to bottom, #444 0%, #333 100%);
}
.language-dropdown:focus {
    outline: none;
    border-color: #ffb300;
}
.language-dropdown option {
    background: #222;
    color: #f0f0f0;
    padding: 8px;
}

#rewarded-ad-prompt p { font-size: 1.2em; margin: 10px 0; }
#rewarded-ad-prompt span { font-weight: bold; color: #ffcc00; }

#fake-ad-overlay { background: #000; z-index: 20; }
#fake-ad-overlay p { font-size: 1.5em; color: #aaa; }
#fake-ad-overlay #ad-timer { font-size: 2em; color: #fff; font-weight: bold; }

/* ================================== */
/* DODATAK ZA OPTIMIZACIJU (MOBILNI)  */
/* ================================== */

#orientation-overlay {
    position: fixed; 
    z-index: 1000;
    display: none; 
    width: 100%;
    height: 100%;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

@media (orientation: portrait) {
    #orientation-overlay {
        display: flex; 
    }
    .game-container {
        display: none !important; 
    }
}

@media (orientation: landscape) {
     #orientation-overlay {
        display: none;
    }
    /* .game-container se uvek prikazuje u landscape,
       a JS uklanja 'hidden' klasu */
}