
/* === Main live layout: video on left, chat on right === */

/* Flex row: video + chat */
.chat-area {
  display: flex;
  align-items: stretch;
  justify-content: flex-start; /* change from center */
  gap: 16px;
  margin-top: 16px;
  flex-wrap: nowrap;
}


/* Left side: video + title bar */
.video-wrapper {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}

/* An offline poster is an image, not a playable video. Disabling pointer
   events and native mobile media controls prevents a misleading play overlay. */
#stream.is-offline-poster {
  pointer-events: none;
}

#stream.is-offline-poster::-webkit-media-controls,
#stream.is-offline-poster::-webkit-media-controls-overlay-play-button,
#stream.is-offline-poster::-webkit-media-controls-start-playback-button {
  display: none !important;
  -webkit-appearance: none;
}

.stream-quality-control {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  z-index: 12;
  color: #fff;
  font-size: 13px;
  text-align: left;
}

.stream-quality-control[hidden],
.stream-quality-menu[hidden] {
  display: none !important;
}

.stream-quality-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 7px;
  background: rgba(0, 0, 0, .78);
  color: #fff;
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 9px rgba(0, 0, 0, .35);
}

.stream-quality-button:hover,
.stream-quality-button:focus-visible {
  border-color: #5aa9ff;
  background: rgba(15, 65, 115, .94);
  outline: none;
}

.stream-quality-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 7px);
  min-width: 148px;
  overflow: hidden;
  border: 1px solid #555;
  border-radius: 8px;
  background: rgba(13, 13, 13, .97);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .55);
}

.stream-quality-option {
  display: flex;
  width: 100%;
  min-height: 36px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid #333;
  background: transparent;
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.stream-quality-option:last-child {
  border-bottom: 0;
}

.stream-quality-option:hover,
.stream-quality-option:focus-visible,
.stream-quality-option.is-selected {
  background: #164f83;
  outline: none;
}

.stream-quality-check {
  color: #73bcff;
  font-weight: 800;
}

@media (max-width: 520px) {
  .stream-quality-button-label {
    display: none;
  }

  .stream-quality-button {
    width: 34px;
    padding: 4px;
  }

  .stream-quality-menu {
    right: auto;
    left: 0;
  }
}


.chat-area {
  align-items: stretch; /* NEW: makes chat + video align to full height */
}


/* Collapse only the inner chat panel content */
#chatPanel.collapsed {
  display: none;
}


/* === Live meta bar under the video === */
.live-meta {
  margin-top: 6px;
  background: #111;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.9rem;
  line-height: 1.3;

  /* Make the bar react to its own width, including a resized sidebar. */
  container-type: inline-size;
  container-name: live-meta;
}

/* Wide layout: identity first, then one consistent status row. */
.live-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin-bottom: 2px;
}

.live-meta-identity {
  display: flex;
  flex: 1 1 230px;
  min-width: 150px;
  align-items: center;
  gap: 6px;
}

.live-meta-status {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.live-country-pill,
.live-streamer-name,
.live-gender-pill {
  padding: 2px 8px;
  border: 1px solid #444;
  border-radius: 999px;
  background: #222;
  opacity: 0.95;
  white-space: nowrap;
}

.live-country-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.live-streamer-name {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
}

.live-streamer-name {
  display: inline-flex;
  flex: 0 1 auto;
  max-width: 190px;
  min-width: 0;
  align-items: center;
  overflow: visible;
}

.live-gender-pill {
  display: inline-flex;
  min-width: 32px;
  min-height: 26px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
}

.live-gender-badge {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.live-streamer-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-streamer-name img {
  flex: 0 0 auto;
}

.live-title-text {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-weight: 600;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.live-title-text.is-expanded {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

.live-meta-pill,
.live-event-action-button,
.stream-quality-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 26px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 2px 8px;
  border: 1px solid #444;
  border-radius: 999px;
  background: #222;
  color: #ddd;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  opacity: 0.96;
}

.live-meta-icon {
  flex: 0 0 auto;
  line-height: 1;
}

.live-relay-pill .live-meta-icon {
  font-size: 1.3em;
}

.live-meta-value {
  font-weight: 700;
}

.live-backend-pill {
  max-width: 210px;
  text-decoration: none;
  cursor: pointer;
}

.live-backend-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.live-backend-link {
  display: inline-block;
  color: inherit;
  text-decoration: none;
}

.live-backend-link:hover {
  text-decoration: underline;
}

.live-balance-sponsor {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 31px;
  height: 31px;
  padding: 0 6px;
  border: 2px solid rgba(255,255,255,.82);
  border-radius: 999px;
  background: #168cff;
  color: #fff;
  box-shadow: 0 0 0 2px rgba(22,140,255,.2), 0 2px 8px rgba(0,0,0,.35);
  font: 800 .72rem/1 system-ui, sans-serif;
  cursor: pointer;
}

.live-balance-sponsor[hidden] { display: none; }
.live-balance-sponsor:hover { background: #35a0ff; transform: translateY(-1px); }
.live-balance-sponsor[data-level="warning"] { background: #d39a00; animation: liveDotPulse 2s ease-in-out infinite; }
.live-balance-sponsor[data-level="critical"],
.live-balance-sponsor[data-level="final"],
.live-balance-sponsor[data-level="empty"] { background: #d52f3f; animation: liveDotPulse .85s ease-in-out infinite; }
.live-balance-sponsor[data-level="stale"] { background: #666; }
.live-balance-sponsor[data-level="offline"] { background: #168cff; animation: none; }
.live-balance-sponsor:disabled { opacity: 1; cursor: default; transform: none; }
.live-balance-sponsor:disabled:hover { background: #168cff; transform: none; }

@keyframes liveDotPulse {
  50% { box-shadow: 0 0 0 7px rgba(255,85,85,.2), 0 2px 10px rgba(0,0,0,.4); transform: scale(1.06); }
}

.sponsor-topup-dialog {
  width: min(430px, calc(100vw - 28px));
  box-sizing: border-box;
  border: 1px solid #3c78a8;
  border-radius: 18px;
  padding: 22px;
  background: #111923;
  color: #f4f8ff;
  box-shadow: 0 18px 60px rgba(0,0,0,.72);
}
.sponsor-topup-dialog::backdrop { background: rgba(0,0,0,.76); backdrop-filter: blur(3px); }
.sponsor-topup-dialog h2 { margin: 0 34px 8px 0; font-size: 1.25rem; }
.sponsor-topup-intro { margin: 0 0 18px; color: #cbd6e2; line-height: 1.45; }
.sponsor-topup-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: #fff; font-size: 1.8rem; cursor: pointer; }
.sponsor-topup-dialog form { display: grid; gap: 10px; }
.sponsor-topup-dialog label { display: flex; justify-content: space-between; font-weight: 700; }
.sponsor-topup-dialog label small { color: #8fa6ba; font-weight: 500; }
.sponsor-topup-dialog input { box-sizing: border-box; width: 100%; padding: 11px 12px; border: 1px solid #456; border-radius: 9px; background: #07101a; color: #fff; font-size: 1rem; }
.sponsor-topup-identity { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; padding: 10px; border: 1px solid #35536c; border-radius: 9px; }
.sponsor-topup-identity[hidden] { display: none; }
.sponsor-topup-identity legend { padding: 0 5px; color: #cbd6e2; font-weight: 700; }
.sponsor-topup-identity label { justify-content: flex-start; align-items: center; gap: 7px; padding: 8px; border-radius: 8px; background: #132536; font-weight: 650; cursor: pointer; }
.sponsor-topup-identity input { width: auto; padding: 0; accent-color: #168cff; }
.sponsor-topup-identity-note { min-height: 1.2em; margin: 0; color: #9fb4c6; font-size: .84rem; line-height: 1.35; }
.sponsor-topup-dialog button[type="submit"] { padding: 11px 14px; border: 0; border-radius: 9px; background: #168cff; color: #fff; font-weight: 800; cursor: pointer; }
.sponsor-topup-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sponsor-topup-presets button, .sponsor-topup-actions button { padding: 8px; border: 1px solid #3d6e96; border-radius: 8px; background: #172b3d; color: #dff1ff; cursor: pointer; }
.sponsor-topup-status { min-height: 1.3em; color: #cbd6e2; line-height: 1.4; }
.sponsor-topup-status[data-state="ok"] { color: #83e6a1; }
.sponsor-topup-status[data-state="error"] { color: #ff9ca6; }
.sponsor-topup-result { text-align: center; }
.sponsor-topup-qr { box-sizing: border-box; width: 224px; max-width: 100%; min-height: 0; margin: 12px auto; padding: 8px; border-radius: 8px; background: #fff; overflow: visible; }
.sponsor-topup-qr:empty { display: none; }
.sponsor-topup-qr img, .sponsor-topup-qr canvas { display: block; width: 208px !important; max-width: 100%; height: auto !important; margin: 0 auto; }
.sponsor-topup-invoice { max-height: 74px; overflow: auto; padding: 9px; border-radius: 7px; background: #07101a; color: #bcd8ef; font: .7rem/1.35 monospace; overflow-wrap: anywhere; text-align: left; }
.sponsor-topup-actions { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.sponsor-topup-actions a { padding: 8px 12px; border-radius: 8px; background: #168cff; color: #fff; text-decoration: none; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .live-balance-sponsor { animation: none !important; }
}

.live-event-control {
  position: relative;
  display: inline-flex;
}

.live-event-action-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 2px 9px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: #292929;
  color: #fff;
  font: inherit;
  font-size: .76rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}

.live-event-action-button:hover,
.live-event-action-button[aria-expanded="true"] {
  background: #3a3a3a;
}

.live-event-action-button:disabled {
  opacity: .48;
  cursor: not-allowed;
}

.live-event-action-button.is-active {
  border-color: rgba(73, 166, 255, .8);
  background: rgba(32, 123, 207, .35);
}

.live-reaction-button {
  color: #fff;
}

.live-watchlist-button {
  display: inline-flex;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 1px solid #686868;
  border-radius: 50%;
  background: #292929;
  color: #aaa;
  font: inherit;
  cursor: pointer;
}

.last-live-replay {
  margin: 6px 0 2px;
}

.last-live-replay[hidden] {
  display: none !important;
}

.last-live-replay-link {
  display: flex;
  width: 100%;
  min-height: 40px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid #315c77;
  border-radius: 8px;
  background: #122331;
  color: #dff4ff;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.last-live-replay-link[href]:hover {
  border-color: #4f8db3;
  background: #193248;
}

.last-live-replay-link[aria-disabled="true"] {
  border-color: #444;
  background: #171717;
  color: #888;
  cursor: default;
}

/* The live page only needs its floating page arrows alongside the mobile dock. */
@media (min-width: 721px) {
  .live-mobile-scrollnav {
    display: none !important;
  }
}

.live-watchlist-button:hover,
.live-watchlist-button[aria-expanded="true"] {
  border-color: #929292;
  background: #393939;
  color: #ddd;
}

.live-watchlist-button.is-watched {
  border-color: #ffd84d;
  background: rgba(255, 216, 77, .14);
  color: #ffd84d;
  box-shadow: 0 0 9px rgba(255, 216, 77, .13);
}

.live-watchlist-button.is-watched:hover,
.live-watchlist-button.is-watched[aria-expanded="true"] {
  background: rgba(255, 216, 77, .23);
}

.live-watchlist-button:disabled {
  opacity: .55;
  cursor: wait;
}

.live-watchlist-mark {
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
}

.live-watchlist-menu {
  width: min(260px, calc(100vw - 24px));
}

.live-watchlist-menu-title {
  display: block;
  padding: 3px 8px 1px;
  color: #fff;
  font-size: .84rem;
}

.live-watchlist-explanation {
  margin: 4px 8px 7px;
  color: #b9b9b9;
  font-size: .74rem;
  line-height: 1.4;
}

.live-watchlist-status {
  min-height: 0;
  margin: 3px 8px 1px;
  color: #aaa;
  font-size: .7rem;
  line-height: 1.35;
}

.live-watchlist-status:empty {
  display: none;
}

.live-watchlist-status.is-error {
  color: #ff9696;
}

.live-watchlist-toggle.is-remove {
  color: #ffd84d;
}

.live-event-action-menu > .live-watchlist-toggle:disabled {
  color: #8d929b;
}

.live-event-action-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 10050;
  width: min(242px, calc(100vw - 24px));
  padding: 8px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 13px;
  background: rgba(16,16,16,.98);
  box-shadow: 0 14px 38px rgba(0,0,0,.7);
  white-space: normal;
}

.live-event-action-menu[hidden],
.live-quote-composer[hidden],
.live-emoji-picker[hidden],
.live-reaction-remove[hidden] {
  display: none !important;
}

.live-event-action-menu > button:not(.live-reaction-remove),
.live-quote-actions button,
.live-custom-emoji button,
.live-reaction-remove {
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: .84rem;
  text-align: left;
  cursor: pointer;
}

.live-event-action-menu > button:hover,
.live-event-action-menu > button:focus-visible,
.live-quote-actions button:hover,
.live-custom-emoji button:hover {
  background: rgba(255,255,255,.10);
}

.live-event-action-menu > button:disabled {
  color: #83d7a0;
  cursor: default;
}

.live-event-action-menu > button.is-live-unavailable:disabled {
  color: #8d929b;
}

.live-quote-composer {
  margin: 5px 0;
  padding: 8px;
  border-radius: 10px;
  background: #222;
}

.live-quote-composer label {
  display: block;
  margin-bottom: 5px;
  color: #aaa;
  font-size: .72rem;
  text-align: left;
}

.live-quote-composer textarea,
.live-custom-emoji input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #555;
  border-radius: 8px;
  background: #111;
  color: #fff;
  font: inherit;
}

.live-quote-composer textarea {
  min-height: 76px;
  padding: 8px;
  resize: vertical;
}

.live-quote-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.live-quote-actions button {
  text-align: center;
}

.live-quote-actions #liveQuotePublish,
.live-custom-emoji button {
  background: #2383d7;
}

.live-reaction-menu {
  width: min(258px, calc(100vw - 24px));
}

.live-reaction-quick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.live-reaction-quick button,
.live-emoji-grid button {
  min-height: 31px;
  border: 0;
  border-radius: 9px;
  background: #282828;
  color: #fff;
  font-size: .95rem;
  cursor: pointer;
}

.live-reaction-quick button:hover,
.live-emoji-grid button:hover {
  background: #3b3b3b;
}

.live-emoji-picker {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,.12);
}

.live-emoji-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  max-height: 190px;
  overflow-y: auto;
}

.live-emoji-grid button {
  min-height: 25px;
  padding: 1px;
  font-size: .78rem;
}

.live-custom-emoji {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
  margin-top: 8px;
}

.live-custom-emoji input {
  min-width: 0;
  padding: 8px;
}

.live-custom-emoji button {
  width: auto;
  text-align: center;
}

.live-reaction-remove {
  margin-top: 8px;
  border-top: 1px solid rgba(255,255,255,.12);
  color: #ffaaa6;
  text-align: center;
}

.lfl-live-interaction-toast {
  position: fixed;
  left: 50%;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  z-index: 100100;
  max-width: min(420px, calc(100vw - 28px));
  padding: 10px 14px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  transform: translateX(-50%);
  background: rgba(18,18,18,.97);
  color: #fff;
  box-shadow: 0 8px 28px rgba(0,0,0,.55);
  font-size: .84rem;
  text-align: center;
}

.lfl-live-interaction-toast.is-error {
  border-color: rgba(255, 93, 86, .65);
}

/* Summary stays full width below the controls. */
.live-summary {
  display: block;
  width: 100%;
  max-height: 2.6em;
  overflow: hidden;
  color: #ccc;
  font-size: 0.8rem;
  text-align: left;
}

.live-meta-bottom {
  padding: 7px;
  text-align: left;
}

.hidden {
  display: none !important;
}

.live-voice-button {
  cursor: pointer;
}

.live-voice-button:hover {
  background: #333;
}

.live-voice-button.voice-live:not(.voice-disabled) {
  border-color: rgba(47, 161, 255, 0.8);
  background: rgba(47, 161, 255, 0.2);
  color: #dff1ff;
}

.live-voice-button.voice-disabled,
.live-voice-button.voice-offline {
  color: #aaa;
}



/* ===== Right column: chat card / toggle / iframe ===== */

.chat-wrapper.card {
  background: #111;
  border-radius: 12px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}


/* Desktop-only: when chat is hidden, remove the whole right column */
@media screen and (min-width: 901px) {
  .chat-wrapper.hidden-desktop {
    display: none;
  }
}


/* Floating reopen tab when chat is hidden on desktop */
.chat-reopen-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 8px 0 0 8px;
  border: 1px solid #333;
  background: #05060a;
  color: #f5f5f5;
  font-size: 14px;
  cursor: pointer;
  z-index: 9999;
}

/* No floating tab on mobile */
@media screen and (max-width: 900px) {
  .chat-reopen-tab {
    display: none;
  }
}




/* Iframe wrapper */
.chat-iframe {
  border-radius: 10px;
  overflow: hidden;
}






/* Chat header: title + toggle button */
.chat-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
}

/* Title */
.chat-header-bar h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

/* Hide / Show chat button */
.chat-toggle-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
justify-content: flex-start;

  padding: 5px 10px;
  border-radius: 999px;

  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.45);
  color: #fff;

  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
}

/* Subtle hover */
.chat-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}





/* Iframe wrapper */
.chat-iframe {
  border-radius: 10px;
  overflow: hidden;
}





.chat-iframe {
  width: 100%;
  max-width: 100%;
}





/* Iframe wrapper */
.chat-iframe {
  border-radius: 10px;
  overflow: hidden;
}

/* Actual iframe */
.chat-iframe iframe {
  width: 100%;
  border: none;
  display: block;
  background: #000;

  height: calc(70vh + 48px); /* room for about one more chat comment */
  max-height: 90vh;    /* never exceed screen */
  min-height: 400px;   /* readable minimum */
}

/* Slightly smaller on narrow screens */
@media screen and (max-width: 900px) {
  .chat-iframe iframe {
    height: calc(60vh + 48px);
    min-height: 320px;
  }
}





/* ===== Right column: chat card / toggle / iframe ===== */

.chat-wrapper.card {
  background: #111;
  border-radius: 12px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* "💬 Live chat" toggle button */
.chat-toggle {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #0b0d14;
  color: #f5f5f5;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.chat-toggle:hover {
  background: #121623;
  border-color: #444;
}

/* Panel that contains the iframe */
#chatPanel {
  margin-top: 6px;
  transition: max-height 0.2s ease, opacity 0.2s ease;
}

/* When collapsed via JS */
#chatPanel.collapsed {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
}




/* Widgets / Badges */
.widget-container iframe {
  width: 100%;
  height: 300px;
  border: none;
  margin: 10px 0;
}

.badges-container {
  border: 2px solid purple;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 0;
}

.badges-container iframe {
  flex: 1;
  height: 60px;
  border: none;
}

.commentbox-container {
  margin-top: 15px;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}



#sidebar {
  width: var(--sidebar-w, 360px);
  min-width: 260px;
  max-width: 700px;
}


#sidebarResizer {
  width: 8px;
  cursor: col-resize;
  flex: 0 0 8px;
  background: transparent;
  position: relative;
    z-index: 50;
}

#sidebarResizer::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  opacity: 0.35;
  background: #fff;
  border-radius: 50px;
}


#sidebarResizer:hover::after { opacity: 0.7; }



/* While resizing, disable iframe mouse capture so drag works */
body.lfl-resizing iframe {
  pointer-events: none !important;
}



@media screen and (min-width: 901px) {
  .chat-wrapper.hidden-desktop {
    display: none;
  }

  /* NEW: hide the drag bar too when chat is hidden */
  .chat-wrapper.hidden-desktop + #sidebarResizer,
  #sidebarResizer.hidden-desktop {
    display: none !important;
  }
}



@media screen and (min-width: 901px) {
  #sidebarResizer.hidden-desktop {
    display: none !important;
  }
}



@media screen and (max-width: 900px) {
  .chat-area {
    flex-direction: column;
  }

  /* NEW: no drag bar on mobile */
  #sidebarResizer {
    display: none !important;
  }

  /* NEW: sidebar should be full width on mobile */
  #sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
  }
}




@media screen and (min-width: 901px) {
  #sidebarResizer.hidden-desktop {
    display: none !important;
  }
}



#sidebarResizer { touch-action: none; }



/* Make it look like normal text */
.chat-title-link {
  color: inherit;
  text-decoration: none;
}

/* On hover: show underline */
.chat-title-link:hover h3 {
  text-decoration: underline;
}


.live-relay-pill {
  color: #cfe7ff;
  text-decoration: none;
}

.live-relay-pill:hover {
  border-color: #4fa1f9;
  background: #263746;
}

/* === Live meta: viewers + chatters counters (same data as OBS widgets) === */
.live-meta-counter-wrap {
  position: relative;
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
}

.live-meta-counter {
  cursor: default;
}

.live-timer {
  font-family: monospace;
}

/* Move the status pills together below identity before they become cramped. */
@container live-meta (max-width: 850px) {
  .live-meta-top {
    flex-direction: column;
    align-items: stretch;
  }

  .live-meta-identity {
    flex: 1 1 auto;
    width: 100%;
  }

  .live-meta-status {
    width: 100%;
    flex-wrap: wrap;
    justify-content: flex-start;
  }
}

/* Mobile: remove descriptive labels and keep the useful values compact. */
@container live-meta (max-width: 650px) {
  .live-meta-status .live-meta-label,
  .live-meta-status .live-backend-value,
  .live-meta-status .live-voice-state {
    display: none;
  }

  .live-meta-pill,
  .live-event-action-button,
  .live-watchlist-button,
  .stream-quality-button {
    min-width: 30px;
    min-height: 28px;
    padding: 3px 7px;
    font-size: 0.70rem;
  }

  .live-watchlist-button {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    padding: 0;
  }

  .live-streamer-name {
    flex: 0 0 auto;
    max-width: 42%;
  }

  .live-country-pill {
    min-width: 30px;
    justify-content: center;
    padding: 3px 6px;
  }

  .live-country-name {
    display: none;
  }
}

/* Extra breathing room for very small phones. */
@container live-meta (max-width: 380px) {
  .live-meta-status {
    gap: 4px;
  }

  .live-meta-pill,
  .live-event-action-button,
  .live-watchlist-button,
  .stream-quality-button {
    padding: 2px 5px;
    font-size: 0.66rem;
  }

  .live-watchlist-button {
    padding: 0;
  }
}
