body { padding: 0; border: 0; margin: 0 }

@keyframes flicker 
{
    0% { opacity: 0.25; }
    25% { opacity: 0.35; }
    50% { opacity: 0.5; }
    75% { opacity: 0.35; }
    100% { opacity: 0.25; }
}

@font-face {
    font-family: 'blocky';
    src: url('../fonts/blocky.ttf');
}

#unity-container { position: fixed; width: 100%; height: 100%; }
#unity-canvas { width: 100%; height: 100%; background: #000000 }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }

:root {
  --dropshadow-dark: rgba(7, 2, 11, 0.5);
  --dropshadow-light: rgba(54, 25, 99, 0.75);
}


#load-screen
{
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 20px 1fr;
    width: 100vw;
    height: 100vh;
    background-color: rgb(0, 0, 0);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

#somnia-logo
{
    grid-row: 1;
    width: 150px;
    height: 150px;
    justify-self: center;
    display: flex;
    justify-content: center;
    align-self: center;
    
}

#somnia-logo img {
    max-width: 100%;
    max-height: 100%;
}

#load-bar-bg
{
    display: flex;
    justify-self: center;
    padding: 4px;
    align-items: center;
    grid-row: 2;
    width: 80%;
    position: relative;
}

#load-bar-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgb(255, 255, 255);
    animation: flicker 0.5s ease-in-out infinite;
    z-index: -1;
}

#load-bar-fill
{
    background-color: rgb(165, 51, 255);
    height: 10px;
    width: 0%;
    transition: width 1s ease-in-out;
}
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000000;
  }

  #loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background-color: #A533FF;
    z-index: 9999;
  }

  /* --------------------------------
     Purple Grid (z-index:1)
     -------------------------------- */
  #purple-grid {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: grid;
    grid-gap: 0;
    z-index: 1;
  }
  #purple-grid .grid-cell {
    width: 100%;
    height: 100%;
  }

  /* --------------------------------
     Centered Loading Text (z-index:2)
     -------------------------------- */
     #loading-text {
      position: absolute;
      top: 10%;
      left: 0;
      right: 12%;
      bottom: 10%;
      display: flex;
      align-items: center;
      justify-content: flex-start;
      padding-left: 20px;
      
    }

    #loading-text-bottom,
    #loading-text-top {
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      font-family: 'blocky', sans-serif;
      font-size: clamp(20px, max(8vw, 8vh), 200px);
      line-height: 1.1;
      max-width: 100%;
      white-space: normal;
      text-align: left;
      width: 100%;
      color: #fff;
      text-shadow: 0 20px 0px var(--dropshadow-dark);
      pointer-events: none;
    }
    
    #loading-text-bottom {
      z-index: 2;
      pointer-events: auto;
      opacity: 1;
    }
    
    #loading-text-top {
      z-index: 10;
      opacity: 0.15;
    }

      
      @media (max-width: 480px) {
        #loading-text {
          font-size: 6vw;      /* slightly bigger on very narrow viewports */
          left: 5%;            /* leave a bit of padding on the left */
          max-width: 90vw;     /* allow a little extra width */
        }
      }

  /* ================================
     2) EYELID BARS (z-index:4)
     ================================ */
  #eyelid-container {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    display: flex;            /* bars split width evenly */
    pointer-events: none;
    z-index: 4;               /* above grid (1) and text (2) */
  }
  .eyelid-col {
    /* 
       We give each bar a width of "calc(100%/N + 2px)" and a margin-left of -1px 
       so that each overlaps its neighbor by 2px total. That hides any 1px rounding gap.
    */
    height: 100%;
    background-color: #000;
    opacity: 0.1;
    box-shadow: 0 50px 0px var(--dropshadow-dark);
    transform-origin: top;
    transform: scaleY(0);     /* start "fully open" (zero vertical scale) */
    transition: none;         /* we'll set the transition just before animating */

    /* width + margin-left are set in JS once at load */
    /* e.g. width: calc(14.2857% + 2px); margin-left: -1px; */
  }

  
/* SHEEP STUFFS ^ -  ^  */
  
  #logo-container {
    position: fixed;
    top: 10px; left: 10px;
    z-index: 5;
    width: 38px; height: 38px;
    filter: drop-shadow(1px 11px 1px rgba(54, 25, 128, 0.2));
  }   

  #sheep-container {
    position: fixed;
    bottom: 20px; right: 20px;
    z-index: 10000; 
    width: 150px; height: 150px;
  }

  #sheep-container img {
    width: 100%;
    height: auto;
  }

  #sheep-container.shrink-out {
    animation: shrink-away 0.5s ease forwards;
  }
 
  .sheep-head-container {
    filter: drop-shadow(0px 6px 6px rgb(155, 71, 30, 0.5));
    position: absolute;
    width: 100%;
    height: 100%;
    animation: bounce 0.4s ease-in-out infinite;
  }

  .sheep-wool-2 {
    animation: rotateRight 7s linear infinite;
    filter: drop-shadow(0px 0px 6px rgb(35, 23, 45, 0.7));
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* position: relative; */
  }

  .sheep-wool-1 {
    animation: rotateLeft 3.5s linear infinite;
    /* position: relative; */
    filter: drop-shadow(0px 0px 4px rgb(68, 42, 15, 0.5));
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .sheep-eyes {
    animation: blink 0.15s ease-in-out;
  }

  /* Somni STuff  :*/

  #somni-left-wing2 {
    animation: wave-wing 0.5s ease-in-out infinite;
    transform-origin: center;
    filter: drop-shadow(0px 0px 6px rgb(35, 23, 45, 0.7));
  }

  #somni-body 
  {
    filter: drop-shadow(0px 0px 6px rgb(35, 23, 45, 0.7));
  }

  #somni-right-wing {
    filter: drop-shadow(0px 0px 6px rgb(35, 23, 45, 0.7));
  }

  /* Animation Stuff */

  @keyframes shrink-away {
    to {
      transform: scale(0);
      opacity: 0;
    }
  }
  /* Sheep wool rotation animations */
  @keyframes rotateRight {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }
  @keyframes rotateLeft {
    from { transform: rotate(0deg); }
    to { transform: rotate(-360deg); }
  }
  /* Sheep eye blinking animation */
  @keyframes blink {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.1); }
  }

  /* Sheep head bounce animation */
  @keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
  }

  /* Somni wing wave animation */
  @keyframes wave-wing {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(20deg); }
    100% { transform: rotate(0deg); }
  }

  /* Page fade out animation */
  .fade-out {
    transition: opacity 2s ease-in-out;
    opacity: 0;
  }

