@font-face {
        font-family: PixSans;
        src: url(PixeloidSans.ttf);
    }
body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    background-color: #02070b;
}

.bg-image{
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;

  object-fit: cover;      /* úplně stejně jako u videa */
  object-position: center;

  z-index: -1;

  animation: flicker 3s ease-in-out infinite;
}
.bg1-image{
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;

  object-fit: cover;      /* úplně stejně jako u videa */
  object-position: center;

  z-index: -2;
  opacity: 0.8;
}

@keyframes flicker {
  0%   { opacity: 1; }
  50%  { opacity: 0.25; }
  100% { opacity: 1; }
}


video {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;           /* plná šířka obrazovky */
  height: 100vh;
  object-fit: cover;      /* ořízne okraje, ale vždy vyplní celou plochu */
  object-position: center;
  z-index: -1;
  opacity: 80%;
}
/* ================= ODPOČET ================= */
#countdown-overlay {
    position: fixed;
    inset: 0;
    background: #081C28;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.6s ease-out;
}
#countdown-text {
    font-family: PixSans;
    font-size: 20vw;
    color: #7EC4CC;
    opacity: 0;
    transform: scale(0.3);
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
#countdown-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* ================= ZÁKLADNÍ LAYOUT ================= */
* { box-sizing: border-box; }

.ponorka-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
}



/* 2) gif tvora – POD PONORKOU, NAD ČERNOU */
.creature-gif {
 position: absolute;

 top: 0; 
 left: 0; 
 /* 2. Vyplnění celé šířky a automatická výška */
 width: 100%; /* Vyplní 100% šířky rodiče (což by mělo být 100% obrazovky) */
 height: auto; /* Výška se přizpůsobí šířce, zachová poměr stran */
 /* 3. Odstraníme centrovací a omezující styly, které brání roztažení */
 inset: auto;
 margin: 0;
 max-width: none;
 max-height: none;
 /* 4. Jak má GIF pokrýt oblast */
 object-fit: contain; /* Zajišťuje, že celý GIF bude vidět, i když se jeho rozměry liší */

 z-index: 1;
 pointer-events: none;

 transform: none; 
}

/* ... zbytek CSS zůstává stejný ... */
.creature-gif.hidden {
  display: none;
}

/* 3) PNG pozadí ponorky */
.pozadi {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;        /* vyplní celou obrazovku, ořízne přebytky */
  object-position: center top;  /* zarovnání doprostřed a nahoru */
  z-index: 2;
}



/* ... Zbytek CSS (třídy .stars, .star, size1, size2, size3) ponecháš stejný ... */

@keyframes float-center-out {
    /* 0% a 100% nastaví počáteční a koncovou polohu, které se budeme snažit
       nastavit v JS tak, aby šly ze středu do stran */
    0% {
        transform: translate(0, 0); /* Počátek ve středu (relativně k jejich výchozí pozici) */
        opacity: 0;
    }
    10% {
        opacity: 0.5;
    }
    90% {
        opacity: 0.5;
    }
    /* Konec animace. Přesná cílová transformace bude určena v JS! */
    100% {
        transform: translate(var(--end-x), var(--end-y));
        opacity: 0;
    }
}

.star {
    position: absolute;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
    /* Změna jména animace a odstranění fixed animation-duration */
    animation: float-center-out infinite linear;
    /* ... zbytek .star je stejný ... */
}
/* ... zbytek sizeX zůstává, ale odeber fixed animation-duration */
.star.size1 { width: 2px; height: 2px; }
.star.size2 { width: 4px; height: 4px; }
.star.size3 { width: 1px; height: 1px; }




/* 4) SVG overlay s mapou a šipkami */
.ovladaci-svg {
  width: 100vw;
  height: auto;
  z-index: 3;
  pointer-events: none;
}

.ovladaci-svg svg {
  width: 110vw;
  height: 110vw;
  display: block;
}
.ovladaci-svg * {
  pointer-events: auto;
}

.svgBox {
    position: fixed;
    display: flex;
    width: 100vw;
    height: 100vh;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 100;
    align-items: stretch;
}

/* ================= TICKER / PUNTÍKY ================= */

/* tvoje staré nastavení – pokud chceš delší hru, jen prodluž duration */
.ticker-group {
  animation: tickerMove 4s linear infinite;
}

@keyframes tickerMove {
  0%   { transform: translateY(-150px); }
  100% { transform: translateY(150px); }
}

/* text uvnitř tickeru */
.ticker-text {
  fill: #00ff00;
  font-size: 20px;
  font-family: monospace;
}

/* časové obdélníčky vlevo (pokud je používáš) */
.time-rect {
  fill: white;
  opacity: 1;
  animation-name: rectFadeFast;
  animation-duration: 4s; /* stejné jako ticker nebo použij proměnnou */
  animation-fill-mode: forwards;
  animation-timing-function: linear;
  animation-play-state: running;
}

@keyframes rectFadeFast {
  0%   { opacity: 1; }
  25%  { opacity: 1; }
  35%  { opacity: 0; }
  100% { opacity: 0; }
}

/* ================= NEVIDITELNÉ ŠIPKY ================= */

.arrow-hit {
  position: absolute;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: none;
  z-index: 102;
}

.arrow-left {
  position: absolute;
  left: 37vw;
  bottom: 13vh;
  width: clamp(30px, 1vw, 90px);
  height: clamp(40px, 8vw, 90px);
  transform: translate(-50%, 50%);
}

.arrow-right {
  position: absolute;
  right: 39.5vw;
  bottom: 13vh;
  width: clamp(30px, 1vw, 90px);
  height: clamp(40px, 8vw, 90px);
  transform: translate(50%, 50%);
}







/* ================= LIGHTBOX (TVŮJ PŮVODNÍ) ================= */
#lightbox.hidden { display: none; }

#lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  justify-content: center;
  align-items: center;

  z-index: 2147483647;

  /* aby absolutně pozicované prvky (křížek, counter) seděly */
  pointer-events: auto;
}

.lightbox-center {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  gap: 20px;
  padding: 20px;
  box-sizing: border-box;
}

.lightbox-main {
  max-width: min(70vw, 1100px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-arrow {
  width: 60px;
  height: 60px;
  cursor: pointer;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 38px;
  height: 38px;
  cursor: pointer;
}

.lightbox-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  color: white;
  font-size: 20px;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(0,0,0,0.8);
  pointer-events: none;
  font-family: PixSans;
}


/* Když je otevřený lightbox, herní neviditelné šipky nesmí chytat kliky/tap */
#lightbox:not(.hidden) ~ #arrow-left-hit,
#lightbox:not(.hidden) ~ #arrow-right-hit {
  pointer-events: none !important;
}



/* ================= OVERLAY S TVOREM ================= */

.creature-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;            /* nad SVG, pod loseScreen/lightbox/countdown */
  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.creature-overlay.hidden {
  display: none;
}

.creature-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

/* panel s textem – na začátku neviditelný, zobrazí se až po čase */
/* panel s textem – na začátku neviditelný, zobrazí se až po čase */
/* panel s textem – na začátku neviditelný, zobrazí se až po čase */
.creature-overlay-inner {
 background: rgba(0,0,0,0.7);
 border: 2px solid #00ff00;
 padding: 16px 20px;
 max-width: 320px;
 color: #fff;
 text-align: center;
 font-family: PixSans, sans-serif;
 line-height: 1.7;

 opacity: 0;
 transition: opacity 0.3s ease;

 margin-left: 50vw; 
 margin-top: -20vh; 

}

/* tahle třída se přidává v JS po GIF_LOOP_MS */
.creature-overlay-inner.visible {
  opacity: 1;
}

/* tlačítko nahoře na panelu – ukáže se až po BUTTON_DELAY_MS */
#creatureContinueBtn {
  margin-top: 8px;
  padding: 4px 12px;
  border: 1px solid #00ff00;
  background: #001500;
  color: #00ff00;
  cursor: pointer;
  font-family: PixSans, sans-serif;
  font-size: 14px;

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#creatureContinueBtn.shown {
  opacity: 1;
  pointer-events: auto;
}

/*** ČERNÁ OBRAZOVKA PRO PROHRU ***/
#loseScreen {
  position:absolute;
  inset:0;
  background:black;
  opacity:0;
  visibility:hidden;
  transition:opacity 0.3s ease;
  z-index:10;
}
