.watchparty #video-chat-container {
  display: flex;
  flex-direction: row;
  gap: 20px;
  width: 100%;
  max-width: 2400px;
  margin-top: 20px;
}

.watchparty #video-section {
  flex: 2;
  max-width: 1200px;
}

.watchparty #chat-center {
  flex: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 800px;
}

/* Ensure video controls look clean */
.watchparty #video-controls {
  margin-bottom: 15px;
  width: 100%;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.watchparty #video-iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 1080px;
  border-radius: 8px;
  display: block;
  height: auto;
}

#paused-overlay {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

@media (max-width: 950px) {
  .watchparty #video-chat-container {
    flex-direction: column;
  }

  .watchparty #video-iframe {
    aspect-ratio: auto;
    /* Disable aspect ratio for small screens */
    height: 420px;
    /* Fixed height */
    max-height: none;
    /* Remove previous cap */
  }

  .watchparty #video-section,
  .watchparty #chat-center {
    max-width: 100%;
  }

  .watchparty #user-list-container {
    display: block;
    order: -1;
    width: 100%;
    max-height: 38px;
    overflow: hidden;
    margin-bottom: 10px;
    padding: 0;
    transition: max-height 0.3s ease-in-out;
  }

  .watchparty #user-list-container.expanded {
    max-height: 1000px;
    padding-bottom: 10px;
  }

  .watchparty #user-list-container #user-list-toggle {
    display: block;
    width: 100%; /* The toggle bar should be full width on mobile */
    margin-bottom: 0;
    border-radius: 7px 7px 0 0;
  }

  .watchparty #user-list-container.expanded #user-list-toggle {
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
  }

  .watchparty #user-list-container > *:not(#user-list-toggle) {
    margin-left: 10px;
    margin-right: 10px;
  }

  .watchparty #user-list-container h3 {
    display: block;
    margin-top: 10px;
    text-align: left;
  }

  .watchparty #room-title {
    display: none;
  }

  .watchparty #chat-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .watchparty #messages {
    max-height: calc(100vh - 550px);
    /* Adjust as needed */
    min-height: 150px;
    overflow-y: auto;
  }

  .watchparty #chat-form {
    margin-top: 10px;
  }
}