.watch {
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: stretch;
}
.watch > div,
.chatbox {
  min-width: 0;
}
.player {
  aspect-ratio: 16/9;
  position: relative;
  overflow: hidden;
  background: #08070a;
  border: 1px solid var(--line);
  border-radius: 15px;
  display: grid;
  place-items: center;
  text-align: center;
}
.player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  opacity: 0.27;
}
.player .copy {
  position: relative;
  padding: 20px;
}
.player iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.streaminfo {
  margin-top: 12px;
}
.streaminfo h2 {
  overflow-wrap: anywhere;
}
.controls {
  flex-wrap: wrap;
  margin-top: 14px;
}
.roomback {
  margin: 15px 0;
  color: #bda7cd;
}
.watch .origin-note {
  font-size: 12px;
  color: var(--muted);
}
.chatbox {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
  min-height: 420px;
  max-height: 78vh;
}
.chathead {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 15px 16px;
}
.chatmark,
.chatempty > span {
  background: #32223f;
  color: #d29cff;
  border: 1px solid #584269;
  display: grid;
  place-items: center;
  border-radius: 11px;
  width: 38px;
  height: 38px;
}
.chathead h2 {
  font-size: 17px;
  line-height: 1.4;
  letter-spacing: 0;
}
.chathead small {
  display: block;
  font:
    12px/1.6 v,
    sans-serif;
  color: var(--muted);
  text-align: start;
}
.modbutton {
  margin-inline-start: auto;
  border-radius: 7px;
  background: #332b3b;
  color: #d7c0e8;
  font-size: 11px;
  padding: 4px 9px;
}
.chatstrip,
.composer label,
.composerbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.chatstrip {
  background: #19161f;
  border-block: 1px solid var(--line);
  padding: 7px 16px;
  font-size: 11px;
  color: #b4aabd;
}
.chatconn {
  display: flex;
  align-items: center;
  gap: 6px;
}
.chatconn:before {
  content: "";
  width: 7px;
  height: 7px;
  display: block;
  background: #a99476;
  border-radius: 50%;
}
.chatconn[data-state="on"]:before {
  background: #6ed8a2;
}
.chatconn[data-state="off"]:before {
  background: #edb461;
}
.timeline {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #151319;
}
.chatlist {
  position: absolute;
  inset: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #53455f transparent;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.chatempty,
.chatloading {
  margin: auto;
  text-align: center;
  color: var(--muted);
}
.chatempty {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 20px 4px;
}
.chatempty > span {
  width: 43px;
  height: 43px;
  margin-bottom: 5px;
}
.chatempty b {
  color: #e3d8ec;
  font-size: 14px;
}
.chatempty small,
.chatloading {
  font-size: 12px;
}
.daystamp {
  align-self: center;
  color: #aca3b6;
  font-size: 10px;
  background: #211c28;
  padding: 2px 10px;
  border-radius: 12px;
}
.bubble {
  flex: none;
  width: fit-content;
  max-width: 94%;
  min-width: 110px;
  padding: 7px 10px;
  border: 1px solid #38313f;
  border-radius: 12px 3px 12px 12px;
  background: #24202a;
  color: #eee9f3;
}
.bubble.mine {
  align-self: flex-end;
  background: #352440;
  border-color: #574065;
  border-radius: 3px 12px 12px 12px;
}
.bubblemeta {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 11px;
}
.bubblemeta bdi {
  font-weight: 700;
  color: #e0bef7;
  overflow-wrap: anywhere;
}
.bubblemeta em {
  color: #c5b3cc;
  font-style: normal;
  font-size: 10px;
}
.bubblemeta time {
  color: #b2a4b9;
  font-size: 10px;
  margin-inline-start: auto;
}
.bubble p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 3px 0 0;
  line-height: 1.8;
  font-size: 13px;
}
.msgtools {
  color: #cbb7d7;
  border-radius: 4px;
  padding: 0 4px;
  font-size: 12px;
}
.modquote {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border-right: 2px solid var(--violet);
  margin: 7px 0;
  padding: 6px 12px;
  color: #d6c7df;
}
.jump {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  border-radius: 20px;
  background: #44304e;
  color: #f5e5ff;
  padding: 4px 13px;
  font-size: 11px;
  box-shadow: 0 2px 12px #0005;
}
.chatbox [hidden] {
  display: none !important;
}
.composer {
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.composer label {
  font-size: 12px;
  color: #ddd2e6;
}
.composer label span,
.composer small {
  font-size: 11px;
  color: #b6a9bf;
}
.composer textarea {
  width: 100%;
  max-height: 110px;
  resize: vertical;
  margin: 6px 0 3px;
  border: 1px solid #43394e;
  border-radius: 9px;
  background: #141118;
  padding: 8px 10px;
  color: white;
  line-height: 1.5;
}
.composer textarea:focus {
  outline: 1px solid var(--primary);
}
.composer button.btn {
  font-size: 12px;
  border-radius: 8px;
}
.composer button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.composer .guest {
  margin-top: 7px;
  width: 100%;
}
.composer .err:not(:empty) {
  margin-top: 6px;
}
.composerbar small {
  max-width: 68%;
}
.chatbox .err .link {
  color: #f6c8ed;
}
.composer .guest .icon {
  width: 15px;
}
.roomback {
  width: fit-content;
}
.chatbox button:focus-visible {
  outline: 2px solid var(--violet);
}
@media (max-width: 810px) {
  .watch {
    grid-template-columns: 1fr;
  }
  .chatbox {
    height: clamp(395px, 66dvh, 590px);
    max-height: none;
    min-height: 0;
  }
  .watch .streaminfo {
    padding: 14px;
  }
  .watch .streaminfo h2 {
    font-size: 20px;
  }
  .chathead {
    padding: 12px 14px;
  }
  .watch {
    gap: 12px;
  }
  .composer textarea {
    font-size: 16px;
  }
  .roomback {
    font-size: 12px;
  }
}

/* Keep controls outside the scrolling message layer on narrow/short screens. */
.timeline {
  overflow: hidden;
}
.composer {
  position: relative;
  z-index: 1;
  flex: none;
}
.chathead,
.chatstrip {
  flex: none;
}
.starttyping {
  color: var(--violet);
  cursor: text;
  padding: 8px;
  font-weight: 700;
}
.composer textarea {
  display: block;
  touch-action: manipulation;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  scroll-margin-block: 14px;
}
@media (pointer: coarse), (max-width: 810px) {
  .composer textarea,
  .field input {
    font-size: 16px;
  }
  .composer textarea {
    min-height: 56px;
    resize: none;
  }
  .composer button {
    min-height: 44px;
  }
  .composer {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .chatbox {
    height: clamp(300px, 66vh, 590px);
    height: clamp(300px, 66dvh, 590px);
    max-height: none;
  }
}
.composer .chat-emoji-toggle,.emoji-palette button{font:inherit;cursor:pointer;background:#332b40;border:1px solid #665473;color:white;border-radius:9px;min-width:38px;min-height:40px;font-size:21px}.composerbar small{flex:1}.emoji-palette:not([hidden]){position:absolute;z-index:3;bottom:calc(100% - 5px);inset-inline:7px;max-height:36vh;overflow:auto;display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px;padding:8px;background:#201c2a;border:1px solid #78638a;border-radius:14px;box-shadow:0 6px 25px #0008}.emoji-palette button{min-width:0;line-height:1;padding:3px}.emoji-palette button:focus-visible,.chat-emoji-toggle:focus-visible{outline:2px solid #caadff}
.ctl{margin-block:16px;padding:18px}.ctl form{display:grid;gap:9px;margin-block:12px;justify-items:start}.ctl label{display:grid;gap:6px;width:100%}.ctl input,.ctl textarea,.ctl select{width:100%;border:1px solid #65546d;color:inherit;background:#201c28;border-radius:8px;padding:9px;font:inherit}.verify-code{display:inline-block;letter-spacing:.15em;user-select:all;color:#d4b9ff}.ctl-spinner{display:none;width:22px;height:22px;border-radius:50%;border:3px solid #60576d;border-top-color:#d5b2ff;animation:cturn .8s linear infinite}.ctl-busy .ctl-spinner{display:inline-block}@keyframes cturn{to{transform:rotate(360deg)}}#ctl-status:not(:empty){position:sticky;top:4px;background:#362b41;border-radius:8px;padding:8px;z-index:3}.site-gift{font-weight:bold;color:#e0b5ff;white-space:nowrap;font-size:13px}.modquote~.controls input{width:4em}
