@keyframes matrix-rain {
    0% {
        transform: translateY(-25%);
    }
    100% {
        transform: translateY(25%);
    }
}

.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 80, 0, 0.5) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    background-size: 100% 200%;
    animation: matrix-rain 20s linear infinite;
    pointer-events: none;
    z-index: -2;
    opacity: 0.4;
}

.matrix-characters {
    position: fixed;
    top: -50%;
    left: 0;
    width: 100vw;
    height: 200vh;
    font-family: monospace;
    font-size: 36px;
    color: #00ff00;
    opacity: 0.4;
    pointer-events: none;
    z-index: -1;
    white-space: pre;
    line-height: 1.2;
    text-shadow: 0 0 8px #0f0;
    animation: matrix-rain 4s linear infinite;
    overflow: hidden;
    letter-spacing: 4px;
}

.labs-container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    min-height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #333 #111;
    position: relative;
    z-index: 1;
}
  
  h1 {
    color: #fff;
    text-align: center;
    font-size: 48px;
    margin-bottom: 40px;
  }
  
  .labs-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    padding: 20px;
    max-width: 1920px;
    margin: 0 auto;
  }
  
  .lab-item {
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
  }
  
  /* Video styles */
  .lab-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  
  /* Vertical video container */
  .vertical-video-container {
    aspect-ratio: 9/16;
    max-width: 320px;
    margin: 0 auto;
  }
  
  .vertical-video-container video {
    object-fit: contain;
  }
  
  /* Game container */
  .game-container {
    width: 800px; /* Fixed width */
    height: 800px; /* Fixed height */
    margin: 40px auto; /* Center and add space */
    background: #111;
    border-radius: 8px;
    overflow: hidden;
    grid-column: 1 / -1; /* Make it span full width of grid */
  }
  
  .game-container iframe {
    width: 100%;
    height: 100%;
    border: none;
  }
  
  /* Title overlay */
  .lab-item-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .lab-item:hover .lab-item-title {
    opacity: 1;
  }
  
  /* Responsive adjustments */
  @media screen and (min-width: 768px) {
    .labs-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
    
    .game-container {
        grid-column: 1 / -1;
    }
  }
  
  @media screen and (max-width: 840px) {
    .game-container {
        width: 100%; /* Full width on mobile */
        height: 600px; /* Shorter height on mobile */
    }
  }
  
  /* Add these styles for smooth scrolling */
  html {
    scroll-behavior: smooth;
  }
  
  /* Custom scrollbar styles for webkit browsers */
  .labs-container::-webkit-scrollbar {
    width: 8px;
  }
  
  .labs-container::-webkit-scrollbar-track {
    background: #111;
  }
  
  .labs-container::-webkit-scrollbar-thumb {
    background-color: #333;
    border-radius: 4px;
  }
  
  .labs-container::-webkit-scrollbar-thumb:hover {
    background-color: #444;
  }
  
  /* Scroll button styles */
  .scroll-button {
    position: fixed;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgb(180, 0, 0);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  }
  
  .scroll-button:hover {
    background: rgb(220, 0, 0);
    transform: scale(1.1);
  }
  
  .scroll-up {
    top: 30px;
  }
  
  .scroll-down {
    bottom: 30px;
  }
  
  /* Mobile adjustments */
  @media screen and (max-width: 768px) {
    .scroll-button {
        width: 40px;
        height: 40px;
        right: 20px;
        font-size: 20px;
    }
    
    .scroll-up {
        top: 20px;
    }
    
    .scroll-down {
        bottom: 20px;
    }
  }
  
  /* Add YouTube iframe styles */
  .lab-item iframe:not(.game-container iframe) {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-radius: 8px;
    background: #000;
  }