/* style.css pro Barevné Cihličky (Breakout) */
:root {
    --pink: #ff4081;
    --blue: #2196f3;
    --green: #4caf50;
    --yellow: #ffeb3b;
}
/* Zajistíme, že herní plocha nepůjde scrollovat a bude reagovat jen na doteky přesně */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Zabrání scrollování při hraní */
    touch-action: none; /* Zabrání zoomování a scrollování prstem na mobilu/tabletu */
    background-color: #1a0b2e; /* Temně fialové pozadí pro vyniknutí barev */
    color: white;
    font-family: 'Nunito', sans-serif;
}

/* Obří Tlačítko Zpět pro děti */
.btn-home {
    position: fixed; top: 20px; left: 20px; z-index: 4000;
    background: white; width: 80px; height: 80px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; text-decoration: none;
    box-shadow: 0 8px 15px rgba(0,0,0,0.1);
    border: 4px solid var(--blue); font-size: 3rem;
}

.btn-home:active { background: #f0f0f0; transform: scale(0.9); }

/* Horní lišta */
#ui-layer {
    position: fixed; top: 0; width: 100%; height: 160px;
    background: transparent; display: flex;
    align-items: center; justify-content: flex-end;
    padding: 15px 40px; box-sizing: border-box; z-index: 1000; 
    pointer-events: none; /* proklik na canvas pod tím */
}

.ui-btn { 
    position: absolute; width: 90px; height: 90px; border-radius: 50%; 
    border: none; font-size: 3rem; cursor: pointer; display: flex; 
    align-items: center; justify-content: center; box-shadow: 0 8px 0 rgba(0,0,0,0.15); 
    pointer-events: auto;
}
.ui-btn:active { transform: translateY(8px); box-shadow: 0 0 0 rgba(0,0,0,0); }
#btn-restart { left: 130px; top: 30px; background: var(--pink); color: white; }

#stats { text-align: right; font-weight: bold; color: #fff; margin-right: 20px; text-shadow: 1px 1px 5px #000; }
#score-val { color: #ff9800; font-size: 3rem; display: block; }

/* Kontejner pro hru - zbytek obrazovky */
.game-container {
    position: absolute;
    top: 120px; /* pod hlavičkou */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Samotné canvas plátno */
#gameCanvas {
    background-color: transparent;
    display: block;
    max-width: 100%;
    max-height: 100%;
    /* Obrys nebo stínování hranice hrací plochy (volitelné) */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 10px;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.confetti {
    position: absolute; pointer-events: none; z-index: 3000;
    animation: confettiFly 1s ease-out forwards;
}
@keyframes confettiFly {
    0% { transform: translate(0,0) rotate(0); opacity: 1; }
    100% { transform: translate(var(--dx), var(--dy)) rotate(360deg); opacity: 0; }
}

.screen { 
    position: fixed; inset: 0; background: rgba(255,255,255,0.95); z-index: 3000; 
    display: flex; flex-direction: column; justify-content: center; 
    align-items: center; text-align: center; 
    pointer-events: auto;
}
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.btn-start { 
    padding: 30px 80px; font-size: 3rem; background: var(--pink); 
    color: white; border: none; border-radius: 100px; cursor: pointer; 
    box-shadow: 0 10px 0 #ad1457; transition: transform 0.1s;
}
.btn-start:active { transform: translateY(10px); box-shadow: 0 0 0; }

/* FIX PRO V2 VYGENEROVANÉ OBRÁZKY (Zaoblené čtverce namísto kruhů) */
.btn-home { border-radius: 20px !important; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important; border: 4px solid var(--blue, #2196f3) !important; }
.btn-home img { width: 100%; height: 100%; object-fit: cover !important; border-radius: 16px !important; }
#btn-restart { width: 90px; height: 90px; background: transparent !important; padding: 0; border: none; box-shadow: 0 5px 15px rgba(0,0,0,0.1) !important; border-radius: 20px !important; overflow: hidden; }
#btn-restart img { width: 100%; height: 100%; object-fit: cover !important; border-radius: 20px !important; }
.btn-start { width: 200px; height: 200px; background: transparent !important; padding: 0 !important; box-shadow: 0 10px 30px rgba(0,0,0,0.15) !important; display: flex; align-items: center; justify-content: center; margin: 0 auto; border-radius: 40px !important; overflow: hidden; }
.btn-start img { width: 100%; height: 100%; object-fit: cover !important; border-radius: 40px !important; }

/* OPRAVA CENTROVÁNÍ MODÁLNÍCH OKEN START/KONEC */
.overlay-modal { position: fixed; inset: 0; background: rgba(255,255,255,0.95); z-index: 5000; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: auto; }
.modal-content { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; }

/* --- UNIFIED GAME HEADER V2 --- */
.game-header { position: fixed; top: 0; left: 0; width: 100%; height: 120px; display: flex; align-items: center; justify-content: space-between; padding: 15px 40px; box-sizing: border-box; z-index: 4000; pointer-events: none; }
.game-header > * { pointer-events: auto; }
.game-header .score-display, .game-header #stats { font-size: 3rem; font-weight: bold; color: #ff9800; text-shadow: 2px 2px 4px rgba(0,0,0,0.2); text-align: center; flex-grow: 1; margin: 0; padding: 0; position: static !important; }
.game-header .btn-home { margin-right: auto; position: static !important; }
.game-header .btn-restart { margin-left: auto; position: static !important; top: auto; left: auto; right: auto; bottom: auto; margin-top:0 !important; }
