 /* Reset and base styles */
    * {
      box-sizing: border-box;
    }
    html, body {
      margin: 0;
      padding: 0;
      height: 100%;
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: #000;
      color: #fff;
      overflow-x: hidden;
    }

    /* Header */
    #header {
      position: fixed;
      top: 0; left: 0; right: 0;
      height: 50px;
      background: #111;
      display: flex;
      align-items: center;
      padding: 0 15px;
      z-index: 1000;
    }
    #header a {
      color: #0d6efd;
      text-decoration: none;
      font-weight: bold;
      font-size: 16px;
    }

    /* Footer */
    footer {
      position: fixed;
      bottom: 0; left: 0; right: 0;
      height: 40px;
      background: #111;
      color: #ccc;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 13px;
      z-index: 1000;
      border-top: 1px solid #565656;
    }

    /* Main container */
    #container {
      display: flex;
      height: calc(100vh - 90px);
      padding-top: 50px;
      padding-bottom: 70px;
    }

    /* Sidebar */
    #sidebar {
      width: 170px;
      background: #121212;
      padding: 10px;
      overflow-y: auto;
      flex-shrink: 0;
      height: 608px;
    }

      #sidebar h2 {
        background: #ffc107;
        color: #1a1a1a;
        font-size: 14px;
        font-weight: 600;
        /*letter-spacing: 0.5px;*/
        text-transform: uppercase;
        margin-bottom: 15px;
        padding: 6px 8px;
        border-radius: 2px;
        user-select: none;
        text-align: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
    #sidebar button {
      background: #333;
      border: none;
      color: #ddd;
      padding: 8px;
      width: 100%;
      margin-bottom: 10px;
      border-radius: 4px;
      cursor: pointer;
      font-size: 14px;
      font-weight: 600;
      transition: background-color 0.3s ease;
    }
    #sidebar button.active,
    #sidebar button:hover {
      background: #0d6efd;
      color: #fff;
    }

    /* Container main */
    #container-main {
      flex-grow: 1;
      display: flex;
      flex-direction: column;
      padding: 10px;
      gap: 10px;
      min-width: 0;
    }

    #stream-title {
      font-size: 16px;
      font-weight: bold;
      padding: 5px 10px;
      /*background: #1a1a1a;*/
      border-radius: 5px;
      user-select: none;
    }

    #player-container {
      display: flex;
      flex-grow: 1;
      gap: 10px;
      min-width: 0;
    }

     
    #videoPlayer,
    #iframePlayer {
      width: 100%;
      height: 72vh;
      border-radius: 5px;
      flex-grow: 1;
      min-width: 0;
      background: #000;
      display: none;
    }

    /* Show the active player */
    .active-player {
      display: block !important;
    }

    /* Chat box */
    #chat {
      width: 350px;
      height: 72vh;
      background: #111;
      border-radius: 5px;
      overflow-y: hidden;
      overflow-x: hidden; 
      flex-shrink: 0;
    }

    /* Theater Mode Button */
    #theaterBtn {
      position: fixed;
      bottom: 70px;
      left: 20px;
      padding: 10px 20px;
      font-weight: bold;
      font-size: 14px;
      background: #0d6efd;
      border: none;
      border-radius: 5px;
      cursor: pointer;
      z-index: 1100;
      user-select: none;
      transition: background-color 0.3s ease;
      color: white;
    }
    #theaterBtn:hover {
      background-color: #094abe;
    }

    /* Theater mode styles for desktop */
    body.theater-mode #header,
    body.theater-mode footer,
    body.theater-mode #sidebar,
    body.theater-mode #stream-title {
      display: none !important;
    }

    body.theater-mode #container {
      height: 100vh;
      padding: 0;
    }

    body.theater-mode #container-main {
      height: 100vh;
      padding: 0;
    }

    body.theater-mode #player-container {
      height: 100vh;
      gap: 0;
    }

    body.theater-mode #videoPlayer.active-player,
    body.theater-mode #iframePlayer.active-player {
      width: calc(100% - 350px);
      height: 100vh;
      border-radius: 0;
    }

    body.theater-mode #chat {
      height: 100vh;
      display: block;
      overflow-y: hidden;
      overflow-x: hidden; 
    }

    /* Responsive - mobile and tablet */
    @media (max-width: 1024px) {
      #container {
        flex-direction: column;
        height: auto;
      }

      #sidebar {
        display: block !important;
        width: 100%;
        padding: 10px 0;
        background: #222;
        overflow-x: auto;
        white-space: nowrap;
        max-height: 65px;
      }
      #sidebar button {
        display: inline-block;
        width: auto;
        margin: 0 8px 10px 8px;
      }

      #container-main {
        width: 100%;
        padding: 10px;
      }

      #player-container {
        flex-direction: column;
        height: auto;
        gap: 10px;
      }

      #videoPlayer,
      #iframePlayer {
        width: 100% !important;
        height: 50vh !important;
        border-radius: 5px;
      }

      #chat {
        display: none !important;
      }

      #theaterBtn {
        display: none !important;
      }
    }

    /* Disable theater mode on small screens */
    @media (max-width: 1024px) {
      body.theater-mode #container,
      body.theater-mode #container-main,
      body.theater-mode #player-container,
      body.theater-mode #videoPlayer,
      body.theater-mode #iframePlayer,
      body.theater-mode #chat,
      body.theater-mode #header,
      body.theater-mode footer,
      body.theater-mode #sidebar,
      body.theater-mode #stream-title {
        all: unset;
      }
      body.theater-mode {
        background: #000;
        color: #fff;
      }
    }
    
    
    
    
    
    .stream-heading {
        background: #ffc107;
        color: #1a1a1a;
        font-size: 14px;
        font-weight: 600;
        /*letter-spacing: 0.5px;*/
        text-transform: uppercase;
        margin-bottom: 15px;
        padding: 6px 8px;
        border-radius: 2px;
        user-select: none;
        text-align: center;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    }
      #container {
  display: flex;
  height: calc(100vh - 90px); 
  padding-top: 50px;
  padding-bottom: 40px;
}
.theater-mode .stream-heading {
  display: none !important;
}
.body.theater-mode {
  overflow: hidden;
  margin: 0;
  padding: 0;
}
body.theater-mode {
  overflow: hidden;
  margin: 0;
  padding: 0;
}

body.theater-mode #header,
body.theater-mode footer,
body.theater-mode #sidebar,
body.theater-mode .stream-heading,
body.theater-mode #stream-title {
  display: none !important;
}

body.theater-mode #container,
body.theater-mode #container-main,
body.theater-mode #player-container {
  padding: 0 !important;
  margin: 0 !important;
  height: 100vh;
}

body.theater-mode #iframePlayer.active-player,
body.theater-mode #videoPlayer.active-player {
  width: 100%;
  height: 100vh;
  border-radius: 0;
  margin: 0;
}



@media (max-width: 1024px) {
  .stream-container {
    width: 100%;
    height: auto;
    flex-direction: column;
  }

  .stream-heading {
    position: relative;
    width: 100%;
    text-align: center;
    font-size: 16px;
    padding: 10px;
    background: #ffc107;
    color: #000;
    border-bottom: 1px solid #333;
  }

  #sidebar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    background: #222;
    padding: 10px;
    overflow-x: auto;
  }

  #sidebar .stream-btn {
    margin: 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
    .stream-heading {
        font-size: 12px;
        padding: 5px 6px;
        margin-bottom: 10px;
        border-radius: 1px;
    }
}

#player-container  {
  display: flex;
  gap: 10px;
  flex-grow: 1;
  max-height: calc(100vh - 130px);
  height: auto;
  align-items: stretch;
}

.video-wrapper {
  flex: 1 1 auto;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 5px;
  overflow: hidden;
}

.theater-mode .video-wrapper {
  overflow: visible;
}

.video-wrapper video,
.video-wrapper iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; 
  height: 100%;
  border: none;
  display: none;
}
.video-wrapper iframe {
  overflow: hidden;
  scrolling: no; 
}

/* Always show active player */
.active-player {
  display: block !important;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  #player-container {
    flex-direction: column;
    max-height: none;
  }
  #chat {
    display: none;
  }
  .video-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
}

    