/*******************************************************
 * BENDRI PAGRINDINIAI STILIAI
 *******************************************************/
 html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: 'Oswald', sans-serif;
    overflow: hidden; /* Kad neslinktų puslapis */
    background-color: #000; /* Juodas fonas */
    transition: background-color 1s ease-in-out, opacity 0.5s ease;
  }
  
  body {
    transition: background-image 1s ease-in-out;
  }
  
  /*******************************************************
   * .fullscreen ir .hidden
   *******************************************************/
  /* Bazinė klasė visoms ekrano sekcijoms (intro, meniu, game) */
  .fullscreen {
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: transparent;
    z-index: 10;
  
    /* Perėjimas atsiradimui/išnykimui */
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.5s ease, visibility 0.5s ease;
  }
  
  /* Paslėptas elementas: išblukęs, nematomas, nepasiekiamas */
  .hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
  
  /* Norint, kad esant .fullscreen.active kažkas vyktų */
  .fullscreen.active {
    opacity: 1;
    pointer-events: all;
    transform: scale(1);
  }
  
  /*******************************************************
   * INTRO EKRANAS
   *******************************************************/
  #intro img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    z-index: -1; /* Kad paveikslėlis būtų už kitų elementų */
  }
  
  #intro-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 20px; /* Atstumas tarp elementų */
  }
  
  /*******************************************************
   * MENIU EKRANAS (FONINIS VIDEO)
   *******************************************************/
  #menu {
    /* .fullscreen bazė jau duoda display: flex ir pan. */
    position: relative;
    background: transparent !important;
    flex-direction: column; /* Kad mygtukai būtų vertikaliai */
    align-items: center;
    justify-content: center;
    gap: 20px; /* Atstumas tarp mygtukų */
  }
  
  #menu-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: -1; /* Mygtukai aukščiau */
  }
  
  /*******************************************************
   * GAME EKRANAS (CANVAS + viršutinė juosta)
   *******************************************************/
  #game-container {
    /* Kadangi .fullscreen jau yra position: absolute, 
       čia galime papildyti, jei norime */
    background-color: transparent;
  }
  
  /* Viršutinė juosta */
  #game-header {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 20px;
  }
  
  /* Lygio numeris */
  #level-info {
    font-size: 24px;
    color: white;
  }
  
  /*******************************************************
   * CANVAS (LABIRINTAS)
   *******************************************************/
  canvas {
    display: block;
    position: absolute; /* reikalingas centravimui */
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background: #fff;
    border: 2px solid #000;
    touch-action: none;
    -ms-touch-action: none; /* Senesnėms MS naršyklėms */
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  
    /* Pereinant į kitą lygį su "fade" norime, kad jis reaguotų */
    transition: opacity 0.5s ease;
  }
  
  /*******************************************************
   * IŠSKLEIDŽIAMAS Meniu (Dropdown)
   *******************************************************/
  #menu-icon {
    font-size: 24px;
    padding: 5px 10px;
  }
  
  #dropdown-menu {
    position: absolute;
    top: 50px;
    left: 10px;
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: rgba(0,0,0,0.8);
    padding: 10px;
    border: 2px solid #fff;
    border-radius: 5px;
  }
  
  #dropdown-menu.hidden {
    display: none; /* Čia galima palikti "display: none", 
                      nes meniu tiesiog paslepiam/rodome be animacijos */
  }
  
  /*******************************************************
   * OVERLAY (VIDEO ir INFO)
   *******************************************************/
  #video-overlay, #info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    z-index: 999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  #video-overlay.hidden, #info-overlay.hidden {
    display: none;
  }
  
  #intro-video {
    max-width: 80%;
    max-height: 80%;
    margin-bottom: 20px;
  }
  
 #info-image {
  display: block;
  margin-bottom: 20px;        /* Centravimas horizontalioje ašyje, jeigu reikia */
  max-width: 100%;       /* Neleisti viršyti tėvinio elemento pločio */
  max-height: 80vh;      /* Neleisti vaizdui užimti daugiau nei 80% ekrano aukščio */
  height: auto;          /* Automatiškai išlaikyti aukštį */
  object-fit: contain;   /* Išlaikyti aspect ratio be apkirpimo */
}

  
  /*******************************************************
   * BENDRAS MYGTUKŲ IR INPUT STILIUS
   *******************************************************/
  button {
    padding: 10px 20px;
    font-size: 18px;
    cursor: pointer;
    border: 2px solid rgba(169, 169, 169, 0.8);
    background-color: rgba(169, 169, 169, 0.8);
    color: white;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
  }
  
  button:hover {
    background-color: rgba(169, 169, 169, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
  }
  
  button:active {
    background-color: transparent;
    color: rgba(169, 169, 169, 0.8);
    border: 10px solid rgba(169, 169, 169, 0.8);
    box-shadow: none;
    transform: translateY(2px);
  }
  
  input {
    padding: 10px;
    font-size: 16px;
    border: 2px solid rgba(169, 169, 169, 0.8);
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 10px;
    margin: 10px auto;
    display: block;
    width: 120px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: border-color 0.3s ease, background-color 0.3s ease;
  }
  
  input:focus {
    border-color: rgba(169, 169, 169, 1);
    background-color: rgba(255, 255, 255, 0.2);
  }
  
  /*******************************************************
   * LYGIŲ PASIRINKIMAS (MENIU)
   *******************************************************/
  #level-select {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  
  #level-input {
    width: 100px;
    text-align: center;
  }
  
  #code-input {
    width: 50%;
    max-width: 400px;
    text-align: center;
  }
  
