/* Dedicated viewing room. Scoped to /live/ so the CodeShell theme stays intact. */
body.live-stream-page main {
  overflow: visible;
  padding: 0 0 48px;
}

body.live-stream-page main > .lc-root {
  width: 100%;
  max-width: 1720px;
  margin: 0 auto;
}

html[data-theme="dark"] body.live-stream-page main {
  background: linear-gradient(180deg, #0b1118 0%, #101821 56%, #0d141c 100%) !important;
}

html[data-theme="light"] body.live-stream-page main {
  background: linear-gradient(180deg, #f1f4f8 0%, #e8edf3 100%) !important;
}

.lc-root {
  --lc-ink: #eef3f8;
  --lc-muted: #92a1b2;
  --lc-panel: #111a24;
  --lc-panel-raised: #172330;
  --lc-field: #0b121a;
  --lc-line: #293744;
  --lc-accent: #7ce2b7;
  --lc-live: #ff5268;
  --lc-warning: #f1be63;
  --lc-nick: #bdd1ff;
  --lc-shadow: 0 18px 46px rgb(0 0 0 / 22%);
  width: min(100%, 1720px);
  margin: 0 auto;
  padding: 22px clamp(16px, 2.6vw, 42px) 28px;
  color: var(--lc-ink);
  box-sizing: border-box;
}

html[data-theme="light"] .lc-root {
  --lc-ink: #17212d;
  --lc-muted: #687789;
  --lc-panel: #fff;
  --lc-panel-raised: #f5f8fb;
  --lc-field: #f8fafc;
  --lc-line: #d7dfe7;
  --lc-accent: #24845f;
  --lc-live: #d94559;
  --lc-warning: #8b5b00;
  --lc-nick: #584d91;
  --lc-shadow: 0 14px 38px rgb(37 52 70 / 9%);
}

.lc-root *,
.lc-root *::before,
.lc-root *::after {
  box-sizing: border-box;
}

.lc-status {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 1px solid var(--lc-line);
  border-radius: 999px;
  background: var(--lc-panel);
  color: var(--lc-muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #8491a0;
  content: "";
}

.lc-status.is-live {
  border-color: color-mix(in srgb, var(--lc-live) 42%, var(--lc-line));
  background: color-mix(in srgb, var(--lc-live) 10%, var(--lc-panel));
  color: var(--lc-live);
}

.lc-status.is-live::before {
  background: var(--lc-live);
  box-shadow: 0 0 10px color-mix(in srgb, var(--lc-live) 65%, transparent);
  animation: lc-live-pulse 1.7s ease-in-out infinite;
}

.lc-status.is-offline {
  border-color: color-mix(in srgb, var(--lc-muted) 40%, var(--lc-line));
  background: color-mix(in srgb, var(--lc-muted) 8%, var(--lc-panel));
  color: var(--lc-muted);
}

.lc-status.is-offline::before {
  background: var(--lc-muted);
}

.lc-status.is-unavailable {
  border-color: color-mix(in srgb, var(--lc-warning) 42%, var(--lc-line));
  background: color-mix(in srgb, var(--lc-warning) 10%, var(--lc-panel));
  color: var(--lc-warning);
}

.lc-status.is-unavailable::before {
  background: var(--lc-warning);
}

@keyframes lc-live-pulse {
  50% { opacity: .42; }
}

.lc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 380px);
  grid-template-areas:
    "video chat"
    "channel details";
  align-items: stretch;
  gap: 12px 20px;
}

.lc-video {
  grid-area: video;
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid #293442;
  border-radius: 14px;
  background: #05080d;
  box-shadow: var(--lc-shadow);
}

.lc-video::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  border: 1px solid rgb(255 255 255 / 3%);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}

.lc-video iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.lc-video-login {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 24px;
  background: radial-gradient(ellipse at 50% 34%, #253d52 0%, #111b28 52%, #080d13 100%);
  color: #edf3fa;
  text-align: center;
}

.lc-video-login::before {
  display: grid;
  width: 54px;
  height: 54px;
  margin-bottom: 2px;
  place-items: center;
  border: 1px solid #a3ecc8;
  border-radius: 17px;
  background: linear-gradient(145deg, #b9f2d3, #52bd8b);
  box-shadow: 0 8px 30px rgb(82 189 139 / 20%);
  color: #103726;
  content: "C";
  font-size: 23px;
  font-weight: 900;
}

.lc-video-login strong {
  max-width: 440px;
  font-size: clamp(17px, 2.4vw, 24px);
  letter-spacing: -.025em;
}

.lc-video-login p {
  max-width: 400px;
  margin: 0;
  color: #bdc9d6;
  font-size: 12px;
  line-height: 1.65;
}

.lc-video-login a {
  margin-top: 4px;
  padding: 10px 17px;
  border: 1px solid #a7ebc8;
  border-radius: 8px;
  background: #a0e8c2;
  color: #102a21;
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
  transition: background .16s ease, transform .16s ease;
}

.lc-video-login a:hover {
  transform: translateY(-1px);
  background: #c2f3d8;
}

.lc-channel-card {
  grid-area: channel;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
  padding: 15px 17px;
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: var(--lc-panel);
  box-shadow: var(--lc-shadow);
}

.lc-channel-avatar {
  display: grid;
  width: 50px;
  height: 50px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #a7ebc8;
  border-radius: 50%;
  background: linear-gradient(145deg, #b8f1d2 0%, #43b67e 100%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 65%);
  color: #103b29;
  font-size: 18px;
  font-weight: 900;
}

.lc-channel-main {
  min-width: 0;
  flex: 1 1 auto;
}

.lc-channel-title {
  display: flex;
  min-width: 0;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.lc-channel-title h1 {
  overflow: hidden;
  margin: 0;
  color: var(--lc-ink);
  font-size: clamp(16px, 1.6vw, 20px);
  font-weight: 850;
  letter-spacing: -.035em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-channel-tag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border: 1px solid var(--lc-line);
  border-radius: 5px;
  color: var(--lc-accent);
  font-size: 8px;
  font-weight: 850;
  letter-spacing: .1em;
}

.lc-channel-main > p {
  overflow: hidden;
  margin: 5px 0 0;
  color: var(--lc-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-channel-stats {
  display: flex;
  align-items: center;
  gap: 17px;
  flex: 0 0 auto;
  padding-left: 17px;
  border-left: 1px solid var(--lc-line);
}

.lc-stat {
  display: grid;
  gap: 5px;
  min-width: 75px;
}

.lc-stat > span {
  color: var(--lc-muted);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.lc-stat > strong {
  color: var(--lc-ink);
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lc-viewer-count {
  max-width: 190px;
  overflow: hidden;
  color: var(--lc-accent);
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.lc-stream-details {
  grid-area: details;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 15px 17px;
  border: 1px solid var(--lc-line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--lc-panel) 78%, transparent);
}

.lc-details-heading {
  display: flex;
  align-items: center;
  gap: 9px;
}

.lc-details-marker {
  width: 3px;
  height: 16px;
  border-radius: 4px;
  background: var(--lc-accent);
}

.lc-details-heading h2 {
  margin: 0;
  color: var(--lc-ink);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .02em;
}

.lc-details-description {
  margin: 0;
  color: var(--lc-muted);
  font-size: 10px;
  line-height: 1.65;
}

.lc-caption {
  max-width: none;
  margin: 0;
  color: var(--lc-muted);
  font-size: 10px;
  line-height: 1.6;
  text-align: left;
}

.lc-chat {
  grid-area: chat;
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  background: var(--lc-panel);
  box-shadow: var(--lc-shadow);
}

.lc-chat-heading {
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--lc-line);
  background: linear-gradient(180deg, var(--lc-panel-raised), var(--lc-panel));
}

.lc-chat-heading > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.lc-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--lc-live);
  box-shadow: 0 0 10px color-mix(in srgb, var(--lc-live) 60%, transparent);
}

.lc-chat-heading h2 {
  margin: 0;
  color: var(--lc-ink);
  font-size: 13px;
  font-weight: 850;
}

.lc-chat-heading small {
  display: block;
  margin-top: 3px;
  color: var(--lc-muted);
  font-size: 9px;
}

.lc-root button {
  font-family: inherit;
  cursor: pointer;
}

.lc-root button:disabled {
  opacity: .46;
  cursor: not-allowed;
}

.lc-root button:focus-visible,
.lc-root a:focus-visible,
.lc-root textarea:focus-visible,
.lc-root input:focus-visible,
.lc-root select:focus-visible {
  outline: 2px solid var(--lc-accent);
  outline-offset: 3px;
}

.lc-chat-heading button {
  padding: 7px 9px;
  border: 1px solid var(--lc-line);
  border-radius: 7px;
  background: var(--lc-panel-raised);
  color: var(--lc-accent);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.lc-chat-heading button:hover {
  border-color: color-mix(in srgb, var(--lc-accent) 60%, var(--lc-line));
}

.lc-chat-state {
  display: flex;
  min-height: 35px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 15px;
  border-bottom: 1px solid color-mix(in srgb, var(--lc-line) 70%, transparent);
  color: var(--lc-muted);
  font-size: 9px;
}

#lc-role {
  overflow: hidden;
  color: var(--lc-accent);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lc-messages {
  flex: 1 1 auto;
  min-height: 120px;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  margin: 0;
  padding: 12px 10px;
  scrollbar-color: #71809677 transparent;
  scrollbar-width: thin;
}

.lc-message {
  margin: 0 0 3px;
  padding: 6px 8px;
  border-radius: 7px;
  color: var(--lc-ink);
  font-size: 11px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.lc-message:hover,
.lc-message:focus-within {
  background: var(--lc-panel-raised);
}

.lc-nick {
  display: inline;
  padding: 0 6px 0 0;
  border: 0;
  background: none;
  color: var(--lc-nick);
  font-size: 10px;
  font-weight: 850;
}

.lc-nick:hover {
  text-decoration: underline;
}

.lc-nick:disabled {
  color: var(--lc-muted);
}

.lc-badge {
  display: inline-block;
  margin-right: 5px;
  padding: 1px 5px;
  border: 1px solid #806b3e;
  border-radius: 4px;
  color: #e2c37d;
  font-size: 8px;
  font-weight: 750;
  vertical-align: 1px;
}

.lc-badge.is-manager {
  border-color: #568267;
  color: #91d1a0;
}

html[data-theme="light"] .lc-badge {
  border-color: #c2a873;
  color: #856329;
}

html[data-theme="light"] .lc-badge.is-manager {
  border-color: #9dbda6;
  color: #286d43;
}

.lc-message time {
  margin-right: 7px;
  color: var(--lc-muted);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.lc-empty {
  padding: 34px 12px;
  color: var(--lc-muted);
  font-size: 11px;
  line-height: 1.8;
  text-align: center;
}

.lc-composer {
  padding: 11px 12px 12px;
  border-top: 1px solid var(--lc-line);
  background: var(--lc-panel-raised);
}

.lc-restriction {
  margin: 0 0 7px;
  color: var(--lc-muted);
  font-size: 9px;
  line-height: 1.6;
}

.lc-composer textarea {
  display: block;
  width: 100%;
  min-height: 56px;
  max-height: 140px;
  padding: 9px 10px;
  resize: vertical;
  border: 1px solid var(--lc-line);
  border-radius: 8px;
  background: var(--lc-field);
  color: var(--lc-ink);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.6;
}

.lc-composer textarea:focus {
  border-color: var(--lc-accent);
}

.lc-composer textarea::placeholder {
  color: var(--lc-muted);
}

.lc-compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  color: var(--lc-muted);
  font-size: 9px;
}

.lc-compose-footer button,
.lc-action {
  padding: 8px 12px;
  border: 1px solid #a6ebc7;
  border-radius: 7px;
  background: #9ce7bf;
  color: #102b23;
  font-size: 10px;
  font-weight: 850;
}

.lc-compose-footer button:hover:not(:disabled),
.lc-action:hover {
  background: #b9f0d1;
}

.lc-compose-footer button span {
  margin-left: 7px;
}

.lc-composer > a {
  display: block;
  margin-top: 9px;
  color: var(--lc-accent);
  font-size: 9px;
  text-align: center;
}

.lc-notice {
  min-height: 0;
  margin: 7px 0 0;
  color: #e48a80;
  font-size: 9px;
  line-height: 1.55;
}

html[data-theme="light"] .lc-root .lc-notice {
  color: #a64840;
}

.lc-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: 85dvh;
  overflow-y: auto;
  padding: 21px;
  border: 1px solid var(--lc-line);
  border-radius: 14px;
  background: var(--lc-panel);
  color: var(--lc-ink);
  box-shadow: 0 20px 80px rgb(0 0 0 / 60%);
}

.lc-dialog::backdrop {
  background: rgb(2 8 21 / 74%);
  backdrop-filter: blur(4px);
}

.lc-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 17px;
}

.lc-dialog-top h2 {
  margin: 0;
  color: var(--lc-ink);
  font-size: 17px;
}

.lc-dialog-top button {
  padding: 0 5px;
  border: 0;
  background: none;
  color: var(--lc-muted);
  font-size: 24px;
}

.lc-dialog p {
  color: var(--lc-muted);
  font-size: 11px;
  line-height: 1.7;
}

.lc-dialog a {
  color: var(--lc-accent);
}

.lc-dialog a.lc-archive-download {
  display: inline-flex;
  align-items: center;
  color: #102b23;
  text-decoration: none;
}

.lc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 15px 0;
}

.lc-history {
  list-style: none;
  margin: 12px 0;
  padding: 0;
}

.lc-history li {
  overflow-wrap: anywhere;
  padding: 10px 0;
  border-bottom: 1px solid var(--lc-line);
  font-size: 11px;
  line-height: 1.8;
  white-space: pre-wrap;
}

.lc-history li.is-deleted {
  padding-left: 10px;
  border-left: 2px solid #a7736b;
}

.lc-history small {
  display: block;
  color: var(--lc-muted);
  font-size: 9px;
}

.lc-history strong {
  color: var(--lc-accent);
  font-size: 10px;
}

.lc-dialog input {
  max-width: 100%;
  padding: 9px;
  border: 1px solid var(--lc-line);
  border-radius: 7px;
  background: var(--lc-field);
  color: var(--lc-ink);
  font: inherit;
  font-size: 11px;
}

.lc-management-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--lc-line);
}

.lc-management-section h3 {
  margin: 0 0 10px;
  color: var(--lc-ink);
  font-size: 12px;
}

.lc-lookup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lc-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding: 7px 0;
  font-size: 11px;
}

.lc-user-row button {
  font-size: 9px;
}

.lc-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  padding: 0;
  border: 0;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.lc-root [hidden] {
  display: none !important;
}

#lc-reconnect {
  margin-top: 9px;
  padding: 7px 10px;
  border: 1px solid var(--lc-line);
  border-radius: 7px;
  background: transparent;
  color: var(--lc-accent);
  font-size: 9px;
}

@media (max-width: 1120px) {
  .lc-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
    gap: 14px;
  }

  .lc-channel-stats {
    gap: 11px;
    padding-left: 12px;
  }
}

@media (max-width: 980px) {
  .lc-root {
    padding-top: 16px;
  }

  .lc-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "video"
      "channel"
      "chat"
      "details";
    gap: 12px;
  }

  .lc-chat {
    height: min(620px, 72dvh);
    min-height: 460px;
  }
}

@media (max-width: 640px) {
  body.live-stream-page main {
    padding-bottom: 28px;
  }

  .lc-root {
    padding: 11px 10px 20px;
  }

  .lc-status {
    min-height: 27px;
    gap: 6px;
    max-width: 125px;
    padding: 0 8px;
    font-size: 8px;
  }

  .lc-layout {
    gap: 10px;
  }

  .lc-video {
    border-radius: 9px;
  }

  .lc-video-login {
    gap: 6px;
    padding: 12px;
  }

  .lc-video-login::before {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 17px;
  }

  .lc-video-login strong {
    font-size: 15px;
  }

  .lc-video-login p {
    font-size: 10px;
  }

  .lc-video-login a {
    padding: 8px 12px;
    font-size: 9px;
  }

  .lc-channel-card {
    flex-wrap: wrap;
    gap: 10px;
    padding: 11px;
    border-radius: 9px;
  }

  .lc-channel-avatar {
    width: 41px;
    height: 41px;
    font-size: 15px;
  }

  .lc-channel-title h1 {
    font-size: 15px;
  }

  .lc-channel-tag {
    min-height: 18px;
    padding: 0 5px;
    font-size: 7px;
  }

  .lc-channel-main > p {
    font-size: 9px;
  }

  .lc-channel-stats {
    display: grid;
    width: 100%;
    flex: 1 1 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 10px 0 0;
    border-top: 1px solid var(--lc-line);
    border-left: 0;
  }

  .lc-stat {
    gap: 2px;
    min-width: 0;
  }

  .lc-stat > span {
    font-size: 7px;
  }

  .lc-stat > strong {
    font-size: 9px;
  }

  .lc-stat > .lc-status {
    min-height: 24px;
    max-width: 100%;
    padding: 0 6px;
    font-size: 7px;
  }

  .lc-viewer-count {
    max-width: 100%;
    font-size: 9px;
  }

  .lc-stream-details {
    gap: 6px;
    padding: 11px;
    border-radius: 9px;
  }

  .lc-details-description,
  .lc-caption {
    grid-column: 1;
    grid-row: auto;
    max-width: none;
    text-align: left;
  }

  .lc-chat {
    height: min(590px, 70dvh);
    min-height: 430px;
    border-radius: 10px;
  }

  .lc-chat-heading {
    min-height: 54px;
    padding: 9px 11px;
  }

  .lc-chat-state {
    padding: 0 11px;
  }

  .lc-messages {
    padding: 10px 7px;
  }

  .lc-composer {
    padding: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lc-status.is-live::before,
  .lc-video-login a {
    animation: none;
    transition: none;
  }
}
