* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
}

body {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: #000;
  color: white;
  overflow: hidden;
}

.display-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;

  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
  grid-column-gap: 0px;
  grid-row-gap: 0px;
}

body.disconnected .display-container {
  display: none;
}

.video-item {
  /*position: absolute;
  top: 0%;
  left: 0;
  width: 100%;
  height: 100%;*/
  position: relative;
  container-type: size;
  transition: 1s ease-in-out;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.video-item.inactive {
  display: none;
}

.video-item:has(.tiktok) {
  grid-area: 1 / 1 / 3 / 3;
  animation-delay: 0;
}
.video-item:has(.youtube) {
  grid-area: 2 / 3 / 3 / 5;
  animation-delay: 0.2s;
}
.video-item:has(.twitch) {
  grid-area: 1 / 4 / 2 / 6;
  animation-delay: 0.3s;
}
.video-item:has(.instagram) {
  grid-area: 1 / 3 / 2 / 4;
  animation-delay: 0.5s;
}
.video-item:has(.facebook) {
  grid-area: 2 / 5 / 3 / 6;
  animation-delay: 0.7s;
}

[data-position="2"] .video-item:has(.youtube) {
  grid-area: 1 / 1 / 2 / 4;
}
[data-position="2"] .video-item:has(.twitch) {
  grid-area: 2 / 2 / 3 / 6;
}
[data-position="2"] .video-item:has(.tiktok) {
  grid-area: 1 / 4 / 2 / 5;
}
[data-position="2"] .video-item:has(.instagram) {
  grid-area: 1 / 5 / 2 / 6;
}
[data-position="2"] .video-item:has(.facebook) {
  grid-area: 2 / 1 / 3 / 2;
}

[data-position="3"] .video-item:has(.youtube) {
  grid-area: 2 / 1 / 3 / 3;
}
[data-position="3"] .video-item:has(.twitch) {
  grid-area: 1 / 1 / 2 / 3;
}
[data-position="3"] .video-item:has(.tiktok) {
  grid-area: 1 / 3 / 3 / 5;
}
[data-position="3"] .video-item:has(.instagram) {
  grid-area: 1 / 5 / 2 / 6;
}
[data-position="3"] .video-item:has(.facebook) {
  grid-area: 2 / 5 / 3 / 6;
}

[data-position="4"] .video-item:has(.youtube) {
  grid-area: 1 / 1 / 3 / 6;
  z-index: 5;
}
[data-position="4"] .video-item:has(.twitch) {
  grid-area: 2 / 4 / 3 / 6;
}
[data-position="4"] .video-item:has(.tiktok) {
  grid-area: 1 / 5 / 2 / 6;
}
[data-position="4"] .video-item:has(.instagram) {
  grid-area: 1 / 1 / 2 / 2;
}
[data-position="4"] .video-item:has(.facebook) {
  grid-area: 2 / 1 / 3 / 2;
}

.display-container.flash .video-item {
  animation-name: flash;
  animation-duration: 0.2s;
  animation-iteration-count: 5;
}

@keyframes flash {
  0%,
  100% {
    opacity: 1;
  }
  0% {
    transform: translateY(0);
  }
  100% {
    transform: translateY(100%);
  }
  50% {
    opacity: 0.5;
    transform: translateY(-100%);
  }
}

.video-frame {
  position: relative;
  background: #000;
  border-radius: 1.25em;
  overflow: hidden;
  box-shadow: 0 1.25em 3.75em rgba(0, 0, 0, 0.8);

  font-size: min(2cqh, 2cqw);
}

/* Mobile vertical platforms (9:16 aspect ratio) */
.video-frame.tiktok,
.video-frame.instagram {
  width: min(100cqh * 9 / 16, 80cqw);
  height: min(100cqh, 100cqw * 16 / 9);
  max-height: 100cqh;
}

/* Facebook vertical (9:16 aspect ratio) */
.video-frame.facebook {
  width: min(100cqh * 9 / 16, 100cqw);
  height: min(100cqh, 100cqw * 16 / 9);
  max-height: 100cqh;
}

/* Desktop horizontal platforms (16:9 aspect ratio) */
.video-frame.twitch,
.video-frame.youtube {
  width: min(100cqw, 100cqh * 16 / 9);
  height: min(100cqh, 100cqw * 9 / 16);
  max-width: 100cqw;
}

.video-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

.platform-badge img {
  width: 75%;
  height: 75%;
  object-fit: contain;
  /* Convert from black to white */
  filter: invert(1) sepia(1) grayscale(1);
}

/* TikTok Style */
.tiktok-overlay .platform-badge {
  position: absolute;
  top: 1.25em;
  right: 1.25em;
  width: 2.8125em;
  height: 2.8125em;
  background: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
  border-radius: 0.625em;
  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: bold;
  color: white;
  box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.5);
}

.tiktok-overlay .username {
  position: absolute;
  bottom: 4em;
  left: 1.25em;

  font-weight: bold;
  color: white;
  text-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.8);
}
.tiktok-overlay .username span {
  font-size: 1.5em;
}

.tiktok-overlay .description {
  position: absolute;
  bottom: 1.25em;
  left: 1.25em;

  color: white;
  text-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.8);
  max-width: 70%;
}
.tiktok-overlay .description span {
  font-size: 1.125em;
}

.tiktok-overlay .icon {
  position: absolute;
  right: 1.25em;
  bottom: 1.25em;
  width: 3.125em;
  height: 3.125em;
  background: linear-gradient(45deg, #ff0050, #00f2ea);
  border-radius: 0.625em;
  display: flex;
  align-items: center;
  justify-content: center;

  animation: pulse 2s infinite;
}
.tiktok-overlay .icon span {
  font-size: 1.5em;
}

/* Facebook Style */
.facebook-overlay .platform-badge {
  position: absolute;
  top: 1.25em;
  right: 1.25em;
  width: 2.8125em;
  height: 2.8125em;
  background: #1877f2;
  border-radius: 0.625em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.5);
}
.facebook-overlay .platform-badge span {
  font-size: 1.625em;
}

.facebook-overlay .header {
  position: absolute;
  top: 1.25em;
  left: 1.25em;
  display: flex;
  align-items: center;
  gap: 0.625em;
}

.facebook-overlay .avatar {
  width: 3.125em;
  height: 3.125em;
  border-radius: 50%;
  background: #1877f2;
  display: flex;
  align-items: center;
  justify-content: center;
}
.facebook-overlay .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.facebook-overlay .info {
  color: white;
  text-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.8);
}

.facebook-overlay .name {
  font-size: 1.25em;
  font-weight: bold;
}
.facebook-overlay .name span {
  font-size: 1.25em;
}

.facebook-overlay .live {
  display: inline-block;
  background: #f02849;
  color: white;
  padding: 0.25em 0.5em;
  border-radius: 0.25em;
  font-weight: bold;
  margin-top: 0.125em;
  padding-top: 0.125em;
}
.facebook-overlay .live span {
  font-size: 0.75em;
}

/* Instagram Style */
.instagram-overlay .platform-badge {
  position: absolute;
  top: 1.25em;
  right: 1.25em;
  width: 2.8125em;
  height: 2.8125em;
  background: linear-gradient(
    135deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
  border-radius: 0.75em;
  display: flex;
  align-items: center;
  justify-content: center;

  color: white;
  box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.5);
}
.instagram-overlay .platform-badge span {
  font-size: 1.5em;
}

.instagram-overlay .header {
  position: absolute;
  top: 1.25em;
  left: 1.25em;
  display: flex;
  align-items: center;
  gap: 0.625em;
}

.instagram-overlay .avatar {
  width: 2.8125em;
  height: 2.8125em;
  border-radius: 50%;
  background: linear-gradient(
    45deg,
    #f09433,
    #e6683c,
    #dc2743,
    #cc2366,
    #bc1888
  );
  display: flex;
  align-items: center;
  justify-content: center;
}
.instagram-overlay .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.instagram-overlay .username {
  font-weight: 600;
  color: white;
  text-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.8);
}
.instagram-overlay .username span {
  font-size: 1.125em;
}

.instagram-overlay .caption {
  position: absolute;
  bottom: 3.75em;
  left: 1.25em;
  font-size: 1em;
  color: white;
  text-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.8);
  max-width: 80%;
}
.instagram-overlay .caption span {
  font-size: 1em;
}

/* Twitch Style */
.twitch-overlay .platform-badge {
  position: absolute;
  bottom: 1.25em;
  right: 1.25em;
  width: 2.8125em;
  height: 2.8125em;
  background: #9147ff;
  border-radius: 0.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.5);
}
.twitch-overlay .platform-badge span {
  font-size: 1.5em;
}

.twitch-overlay .header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.8) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  padding: 1.25em;
  display: flex;
  align-items: center;
  gap: 0.9375em;
}

.twitch-overlay .avatar {
  width: 3.125em;
  height: 3.125em;
  border-radius: 50%;
  background: #9147ff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.twitch-overlay .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.twitch-overlay .info .name {
  font-weight: bold;
  color: white;
}
.twitch-overlay .info .name span {
  font-size: 1.25em;
}

.twitch-overlay .info .game {
  color: #dedee3;
}
.twitch-overlay .info .game span {
  font-size: 0.875em;
}

.twitch-overlay .live-badge {
  background: #eb0400;
  color: white;
  padding: 0.25em 0.5em;
  border-radius: 0.25em;
  font-weight: bold;
  margin-left: auto;
  padding-top: 0.125em;
}
.twitch-overlay .live-badge span {
  font-size: 0.75em;
}

/* YouTube Style */
.youtube-overlay .platform-badge {
  position: absolute;
  top: 1.25em;
  right: 1.25em;
  width: 3.125em;
  height: 2.1875em;
  background: #ff0000;
  border-radius: 0.375em;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, 0.5);
}
.youtube-overlay .platform-badge span {
  font-size: 1.5em;
}

.youtube-overlay .header {
  position: absolute;
  top: 1.25em;
  left: 1.25em;
  display: flex;
  align-items: center;
  gap: 0.625em;
}

.youtube-overlay .avatar {
  width: 3em;
  height: 3em;
  border-radius: 50%;
  background: #ff0000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.youtube-overlay .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.youtube-overlay .channel-name {
  font-weight: 500;
  color: white;
  text-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.8);
}
.youtube-overlay .channel-name span {
  font-size: 1.125em;
}

.youtube-overlay .title {
  position: absolute;
  bottom: 1.25em;
  left: 1.25em;
  font-weight: bold;
  color: white;
  text-shadow: 0.125em 0.125em 0.25em rgba(0, 0, 0, 0.8);
  max-width: 80%;
}
.youtube-overlay .title span {
  font-size: 1.375em;
}

.youtube-overlay .live-badge {
  position: absolute;
  bottom: 1.25em;
  right: 1.25em;
  background: #cc0000;
  color: white;
  padding: 0.375em 0.75em;
  border-radius: 0.25em;
  font-weight: bold;
}
.youtube-overlay .live-badge span {
  font-size: 0.875em;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* No animations - frames stay centered */

#fullscreenBtn {
  position: absolute;
  top: 1.25em;
  left: 1.25em;
  padding: 0.5em 1em;
  background: rgba(255, 255, 255, 0.8);
  color: #000;
  border: none;
  border-radius: 0.25em;
  font-weight: bold;
  cursor: pointer;
  z-index: 10;
}
