
/* === 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: var(--lfl-text, #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 var(--lfl-border, rgba(255, 255, 255, .45));
  border-radius: 7px;
  background: var(--lfl-surface, rgba(0, 0, 0, .78));
  color: var(--lfl-text, #fff);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 2px 9px var(--lfl-shadow, rgba(0, 0, 0, .35));
}

.stream-quality-button:hover,
.stream-quality-button:focus-visible {
  border-color: var(--lfl-blue-border, #5aa9ff);
  background: var(--lfl-blue-wash, 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 var(--lfl-border, #555);
  border-radius: 8px;
  background: var(--lfl-surface, rgba(13, 13, 13, .97));
  box-shadow: 0 6px 20px var(--lfl-shadow, 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 var(--lfl-border, #333);
  background: transparent;
  color: var(--lfl-text, #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: var(--lfl-blue-solid, #164f83);
  outline: none;
}

.stream-quality-check {
  color: var(--lfl-blue-text, #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: var(--lfl-surface, #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;
}

/* Two rows of independent groups; each can wrap before its contents collide. */
.live-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  min-width: 0;
}
.live-meta-top { margin-bottom: 10px; }
.live-meta-identity {
  display: flex;
  flex: 1 1 22rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
}
.live-meta-actions,
.live-meta-counters,
.live-meta-services {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}
.live-meta-actions, .live-meta-services { justify-content: flex-end; margin-left: auto; position: relative; }
.live-meta-actions > *, .live-meta-counters > *, .live-meta-services > * { flex-shrink: 0; }

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

.live-country-pill {
  position: relative;
  display: inline-flex;
  min-width: 32px;
  min-height: 28px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  font-size: 0.75rem;
  text-transform: none;
  cursor: help;
}

.live-country-flag {
  font-size: 1.15rem;
  line-height: 1;
}

.live-country-pill::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  z-index: 10100;
  max-width: min(220px, calc(100vw - 24px));
  padding: 6px 8px;
  border: 1px solid var(--lfl-border, rgba(255,255,255,.18));
  border-radius: 8px;
  background: var(--lfl-surface, #161616);
  box-shadow: 0 8px 24px var(--lfl-shadow, rgba(0,0,0,.55));
  color: var(--lfl-text, #fff);
  content: attr(data-country-label);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 3px);
  transition: opacity .12s ease, transform .12s ease;
}

.live-country-pill:is(:hover, :focus-visible, .is-country-tip-open)::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.live-streamer-name {
  display: inline-flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  max-width: min(22rem, 100%);
  margin: 0;
  font-size: .85rem;
  font-weight: 650;
  color: var(--lfl-text, #fff);
  box-sizing: border-box;
  white-space: normal;
}

.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-wrap: anywhere;
  white-space: normal;
}
.live-streamer-name .live-streamer-icon {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 50%;
}
.live-title-text {
  display: block;
  flex: 1 1 12rem;
  min-width: 0;
  margin: 0;
  color: var(--lfl-text, #fff);
  font-weight: 600;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}
.live-title-text[hidden] { display: none; }
.live-country-flag { display: inline-flex; align-items: center; justify-content: center; }
.live-country-flag img.emoji { display: block; width: 1.15em; height: 1.15em; max-width: none; margin: 0; opacity: 1; filter: none; }

.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 var(--lfl-border, #444);
  border-radius: 999px;
  background: var(--lfl-surface-soft, #222);
  color: var(--lfl-text, #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 var(--lfl-border, rgba(255,255,255,.82));
  border-radius: 999px;
  background: var(--lfl-blue-solid, #168cff);
  color: var(--lfl-on-accent, #fff);
  box-shadow: 0 0 0 2px rgba(22,140,255,.2), 0 2px 8px var(--lfl-shadow, 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: var(--lfl-blue-solid, #35a0ff); transform: translateY(-1px); }
.live-balance-sponsor[data-level="warning"] { background: var(--lfl-amber-solid, #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: var(--lfl-red-solid, #d52f3f); animation: liveDotPulse .85s ease-in-out infinite; }
.live-balance-sponsor[data-level="stale"] { background: var(--lfl-surface-hover, #666); }
.live-balance-sponsor[data-level="offline"] { background: var(--lfl-blue-solid, #168cff); animation: none; }
.live-balance-sponsor:disabled { opacity: 1; cursor: default; transform: none; }
.live-balance-sponsor:disabled:hover { background: var(--lfl-blue-solid, #168cff); transform: none; }

@keyframes liveDotPulse {
  50% { box-shadow: 0 0 0 7px rgba(255,85,85,.2), 0 2px 10px var(--lfl-shadow, 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 var(--lfl-blue-border, #3c78a8);
  border-radius: 18px;
  padding: 22px;
  background: var(--lfl-surface, #111923);
  color: var(--lfl-text, #f4f8ff);
  box-shadow: 0 18px 60px var(--lfl-shadow, 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: var(--lfl-text, #cbd6e2); line-height: 1.45; }
.sponsor-topup-close { position: absolute; top: 10px; right: 12px; border: 0; background: transparent; color: var(--lfl-text, #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: var(--lfl-blue-text, #8fa6ba); font-weight: 500; }
.sponsor-topup-dialog input { box-sizing: border-box; width: 100%; padding: 11px 12px; border: 1px solid var(--lfl-border, #456); border-radius: 9px; background: var(--lfl-surface, #07101a); color: var(--lfl-text, #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 var(--lfl-blue-border, #35536c); border-radius: 9px; }
.sponsor-topup-identity[hidden] { display: none; }
.sponsor-topup-identity legend { padding: 0 5px; color: var(--lfl-text, #cbd6e2); font-weight: 700; }
.sponsor-topup-identity label { justify-content: flex-start; align-items: center; gap: 7px; padding: 8px; border-radius: 8px; background: var(--lfl-surface-soft, #132536); font-weight: 650; cursor: pointer; }
.sponsor-topup-identity input { width: auto; padding: 0; accent-color: var(--lfl-blue-text, #168cff); }
.sponsor-topup-identity-note { min-height: 1.2em; margin: 0; color: var(--lfl-blue-text, #9fb4c6); font-size: .84rem; line-height: 1.35; }
.sponsor-topup-dialog button[type="submit"] { padding: 11px 14px; border: 0; border-radius: 9px; background: var(--lfl-blue-solid, #168cff); color: var(--lfl-on-accent, #fff); font-weight: 800; cursor: pointer; }
.sponsor-topup-presets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sponsor-topup-presets button { padding: 8px; border: 1px solid var(--lfl-blue-border, #3d6e96); border-radius: 8px; background: var(--lfl-blue-wash, #172b3d); color: var(--lfl-text, #dff1ff); cursor: pointer; }
.sponsor-topup-status { min-height: 1.3em; color: var(--lfl-text, #cbd6e2); line-height: 1.4; }
.sponsor-topup-status[data-state="ok"] { color: var(--lfl-green-text, #83e6a1); }
.sponsor-topup-status[data-state="error"] { color: var(--lfl-red-text, #ff9ca6); }

@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 var(--lfl-border, rgba(255,255,255,.18));
  border-radius: 999px;
  background: var(--lfl-surface-soft, #292929);
  color: var(--lfl-text, #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: var(--lfl-surface-hover, #3a3a3a);
}

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

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

.live-reaction-button {
  color: var(--lfl-text, #fff);
}

.live-watchlist-button {
  display: inline-flex;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  box-sizing: border-box;
  align-items: stretch;
  justify-content: stretch;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--lfl-border, #686868);
  border-radius: 50%;
  background: var(--lfl-surface-soft, #292929);
  color: var(--lfl-muted, #aaa);
  font: inherit;
  cursor: pointer;
}

.live-relationship-half {
  position: relative;
  display: inline-flex;
  flex: 1 1 50%;
  min-width: 0;
  align-items: center;
  justify-content: center;
  background: var(--lfl-surface-soft, #292929);
  color: var(--lfl-muted, #aaa);
  transition: background .15s ease, color .15s ease;
}

.live-relationship-half + .live-relationship-half {
  border-left: 1px solid var(--lfl-border, rgba(255,255,255,.18));
}

.live-relationship-watchlist.is-active {
  background: var(--lfl-amber-wash, rgba(255, 216, 77, .22));
  color: var(--lfl-amber-text, #ffd84d);
}

.live-relationship-connect.is-active {
  background: #1479e8;
  color: #fff;
}

.live-relationship-connect.is-pending {
  background: rgba(20, 121, 232, .26);
  color: #8fc7ff;
}

.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 var(--lfl-blue-border, #315c77);
  border-radius: 8px;
  background: var(--lfl-surface-soft, #122331);
  color: var(--lfl-text, #dff4ff);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.last-live-replay-link[href]:hover {
  border-color: var(--lfl-blue-border, #4f8db3);
  background: var(--lfl-blue-wash, #193248);
}

.last-live-replay-link[aria-disabled="true"] {
  border-color: var(--lfl-border, #444);
  background: var(--lfl-surface, #171717);
  color: var(--lfl-muted, #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: var(--lfl-border, #929292);
  box-shadow: 0 0 0 1px rgba(255,255,255,.04);
}

.live-watchlist-button.is-watched {
  border-color: var(--lfl-amber-border, #ffd84d);
}

.live-watchlist-button.is-connected {
  border-color: #1479e8;
}

.live-watchlist-button.is-watched.is-connected {
  border-color: color-mix(in srgb, var(--lfl-amber-border, #ffd84d) 50%, #1479e8 50%);
}

.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: var(--lfl-text, #fff);
  font-size: .84rem;
}

.live-relationship-section {
  margin: 7px 0 0;
  padding: 8px;
  border: 1px solid var(--lfl-border, rgba(255,255,255,.12));
  border-radius: 10px;
  background: var(--lfl-surface-soft, rgba(255,255,255,.035));
}

.live-relationship-section + .live-relationship-section {
  margin-top: 8px;
}

.live-relationship-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--lfl-text, #fff);
  font-size: .78rem;
}

.live-relationship-state {
  color: var(--lfl-muted, #aeb4be);
  font-size: .7rem;
  font-weight: 700;
  text-align: right;
}

.live-connect-heading {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.live-connect-mini-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.live-connect-profile-link {
  display: flex;
  width: 100%;
  min-height: 34px;
  box-sizing: border-box;
  align-items: center;
  justify-content: center;
  padding: 7px 9px;
  border: 1px solid rgba(20, 121, 232, .72);
  border-radius: 8px;
  background: rgba(20, 121, 232, .13);
  color: var(--lfl-text, #fff);
  font-size: .75rem;
  font-weight: 700;
  text-decoration: none;
}

.live-connect-profile-link:hover,
.live-connect-profile-link:focus-visible {
  background: rgba(20, 121, 232, .24);
  border-color: #1479e8;
}

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

.live-relationship-section .live-watchlist-explanation {
  margin-left: 0;
  margin-right: 0;
}

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

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

.live-watchlist-status.is-error {
  color: var(--lfl-red-text, #ff9696);
}

.live-event-action-menu > .live-watchlist-toggle {
  border: 1px solid var(--lfl-border, rgba(255,255,255,.18));
  background: var(--lfl-surface-hover, #2d2d2d);
  color: var(--lfl-text, #f2f2f2);
  font-weight: 700;
}

.live-event-action-menu > .live-watchlist-toggle:hover,
.live-event-action-menu > .live-watchlist-toggle:focus-visible {
  background: var(--lfl-wash-strong, rgba(255,255,255,.14));
}

.live-event-action-menu > .live-watchlist-toggle.is-remove {
  border-color: var(--lfl-amber-border, rgba(255,216,77,.45));
  background: var(--lfl-amber-wash, rgba(255,216,77,.13));
  color: var(--lfl-amber-text, #ffe27a);
}

.live-event-action-menu > .live-watchlist-toggle:disabled {
  border-color: var(--lfl-border, rgba(255,255,255,.14));
  background: var(--lfl-surface-soft, #252525);
  color: var(--lfl-muted, #c1c5cb);
  opacity: 1;
  cursor: default;
}

.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 var(--lfl-border, rgba(255,255,255,.18));
  border-radius: 13px;
  background: var(--lfl-surface, rgba(16,16,16,.98));
  box-shadow: 0 14px 38px var(--lfl-shadow, 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: var(--lfl-text, #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: var(--lfl-wash, rgba(255,255,255,.10));
}

.live-event-action-menu > button:disabled {
  color: var(--lfl-green-text, #83d7a0);
  cursor: default;
}

.live-event-action-menu > button.is-live-unavailable:disabled {
  color: var(--lfl-muted, #8d929b);
}

/* Owner/self Watchlist state is informational, not a disabled browser control.
   Keep an explicit, high-contrast face after the generic menu-button rules so
   neither native disabled styling nor menu inheritance can wash it out. */
.live-event-action-menu > button.live-watchlist-toggle.is-self[aria-disabled="true"] {
  border: 1px solid #78aee6;
  background: #183b62;
  color: #ffffff;
  opacity: 1;
  cursor: default;
  font-weight: 800;
}

.live-event-action-menu > button.live-watchlist-toggle.is-self[aria-disabled="true"]:is(:hover, :focus-visible) {
  background: #183b62;
  color: #ffffff;
}

:root[data-lfl-theme="light"] .live-event-action-menu > button.live-watchlist-toggle.is-self[aria-disabled="true"] {
  border-color: #6d88a5;
  background: #dce8f5;
  color: #17324d;
}

:root[data-lfl-theme="light"] .live-event-action-menu > button.live-watchlist-toggle.is-self[aria-disabled="true"]:is(:hover, :focus-visible) {
  background: #dce8f5;
  color: #17324d;
}

.live-quote-composer {
  margin: 5px 0;
  padding: 8px;
  border-radius: 10px;
  background: var(--lfl-surface-soft, #222);
}

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

.live-quote-composer textarea,
.live-custom-emoji input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--lfl-border, #555);
  border-radius: 8px;
  background: var(--lfl-surface, #111);
  color: var(--lfl-text, #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: var(--lfl-blue-solid, #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: var(--lfl-surface-soft, #282828);
  color: var(--lfl-text, #fff);
  font-size: .95rem;
  cursor: pointer;
}

.live-reaction-quick button:hover,
.live-emoji-grid button:hover {
  background: var(--lfl-surface-hover, #3b3b3b);
}

.live-emoji-picker {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--lfl-border, 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 var(--lfl-border, rgba(255,255,255,.12));
  color: var(--lfl-red-text, #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 var(--lfl-border, rgba(255,255,255,.2));
  border-radius: 999px;
  transform: translateX(-50%);
  background: var(--lfl-surface, rgba(18,18,18,.97));
  color: var(--lfl-text, #fff);
  box-shadow: 0 8px 28px var(--lfl-shadow, rgba(0,0,0,.55));
  font-size: .84rem;
  text-align: center;
}

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

/* Summary stays full width below the controls. */
.live-summary {
  display: block;
  width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--lfl-text, #ccc);
  font-size: 0.8rem;
  text-align: left;
}

.live-meta-bottom { padding-top: 8px; text-align: left; }
.live-meta-bottom[hidden] { display: none; }
.live-meta .live-categories { box-sizing: border-box; padding: 0; }
/* Anchor menus to their whole group so wrapped buttons cannot push them off-screen. */
.live-meta-actions .live-event-control, .live-meta-services .stream-quality-control { position: static; }
.live-meta-actions .live-event-action-menu { box-sizing: border-box; max-width: min(340px, 100cqw); }
.live-meta-services .stream-quality-menu { left: auto; right: 0; }
.live-meta .live-icon-action { width: 32px; min-width: 32px; height: 32px; padding: 0; font-size: 1rem; }
.live-meta .stream-quality-button-label { display: inline; }
.live-meta .stream-quality-button { width: auto; }


.hidden {
  display: none !important;
}

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

.live-voice-button:hover {
  background: var(--lfl-surface-hover, #333);
}

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

.live-voice-button.voice-disabled,
.live-voice-button.voice-offline {
  color: var(--lfl-muted, #aaa);
}



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

.chat-wrapper.card {
  background: var(--lfl-surface, #111);
  border-radius: 12px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px var(--lfl-shadow, rgba(0, 0, 0, 0.6));
  border: 1px solid var(--lfl-border, 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 var(--lfl-border, #333);
  background: var(--lfl-surface, #05060a);
  color: var(--lfl-text, #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 var(--lfl-border, rgba(255, 255, 255, 0.22));
  background: var(--lfl-wash-strong, rgba(0, 0, 0, 0.45));
  color: var(--lfl-text, #fff);

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

/* Subtle hover */
.chat-toggle-btn:hover {
  background: var(--lfl-wash, 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: var(--lfl-surface, #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: var(--lfl-surface, #111);
  border-radius: 12px;
  padding: 8px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 8px 24px var(--lfl-shadow, rgba(0, 0, 0, 0.6));
  border: 1px solid var(--lfl-border, rgba(255, 255, 255, 0.08));
}

/* "💬 Live chat" toggle button */
.chat-toggle {
  width: 100%;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--lfl-border, #333);
  background: var(--lfl-surface, #0b0d14);
  color: var(--lfl-text, #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: var(--lfl-surface, #121623);
  border-color: var(--lfl-border, #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: var(--lfl-surface, #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: var(--lfl-blue-text, #cfe7ff);
  text-decoration: none;
}

.live-relay-pill:hover {
  border-color: var(--lfl-blue-border, #4fa1f9);
  background: var(--lfl-surface-hover, #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;
}

/* Container width also tracks a resized desktop sidebar. */
@container live-meta (max-width: 650px) {
  .live-meta-identity { flex-basis: 100%; }
  .live-meta-actions, .live-meta-services { width: 100%; justify-content: flex-start; margin-left: 0; }
  .live-meta-actions .live-event-action-menu { max-width: 100%; }
  .live-meta-pill, .live-event-action-button, .stream-quality-button { min-height: 32px; }
  .live-meta .live-icon-action { width: 36px; min-width: 36px; height: 36px; }
  .live-country-pill, .live-gender-pill { min-height: 32px; }
}
@container live-meta (max-width: 380px) {
  .live-meta-counters .live-meta-label, .live-backend-pill .live-meta-label, .live-relay-pill .live-meta-label { display: none; }
  .live-meta-pill { padding: 3px 6px; }
}

/* Quote is a custom emoji badge, matching the shared activity/statistics icon. */
.live-quote-icon {
  display: inline-grid;
  place-items: center;
  min-width: 1.12em;
  height: 1.12em;
  padding: 0 .12em;
  border: 1px solid rgba(77, 163, 255, .72);
  border-radius: 4px;
  background: rgba(33, 150, 243, .42);
  color: #eef8ff;
  font-size: .88em;
  font-weight: 800;
  line-height: 1;
}

/* Identity colors mirror the selected payment mode in both themes. */
.sponsor-topup-dialog #sponsorTopupCreate[data-identity="profile"] {
  background: #ffdf80; color: #4b3500;
}
.sponsor-topup-dialog #sponsorTopupCreate[data-identity="ghost"] {
  background: var(--lfl-blue-solid, #168cff); color: #fff;
}
:root[data-lfl-theme="light"] .sponsor-topup-dialog #sponsorTopupCreate[data-identity="ghost"] {
  background: var(--lfl-action-bg, #dcecff); color: var(--lfl-action-ink, #145da0);
}

/* Only the mobile page layout collapses; desktop retains the full dev.55 panel. */
.live-meta-toggle { display: none; }
@media screen and (max-width: 900px) {
  .live-meta .live-meta-identity {
    position: relative;
    box-sizing: border-box;
    padding-right: 52px;
    min-height: 44px;
    flex-basis: 100%;
  }
  .live-meta-toggle {
    position: absolute;
    display: inline-flex;
    right: 0;
    top: 0;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--lfl-border, #444);
    border-radius: 8px;
    background: var(--lfl-surface-soft, #222);
    color: var(--lfl-text, #fff);
    cursor: pointer;
  }
  .live-meta-toggle:hover { background: var(--lfl-surface-hover, #333); }
  .live-meta-toggle:focus-visible { outline: 2px solid var(--lfl-blue-text, #6bb8ff); outline-offset: 2px; }
  .live-meta-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .live-meta.is-mobile-collapsed .live-meta-actions,
  .live-meta.is-mobile-collapsed .live-meta-status,
  .live-meta.is-mobile-collapsed .live-categories,
  .live-meta.is-mobile-collapsed .live-meta-bottom { display: none; }
  .live-meta.is-mobile-collapsed .live-meta-top { margin-bottom: 0; }
  .live-meta.is-mobile-collapsed .live-meta-identity { flex-wrap: nowrap; }
  .live-meta.is-mobile-collapsed .live-streamer-name { max-width: 45%; flex: 0 1 auto; }
  .live-meta.is-mobile-collapsed .live-streamer-label,
  .live-meta.is-mobile-collapsed .live-title-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .live-meta.is-mobile-collapsed .live-title-text { flex: 1 1 0; }
}
