/* Chat panel, the lines floating over the picture, the reaction tray and the effects. Chat and effects live inside
   the stage, so they are there in fullscreen too. */
.controls .cbtn { position: relative; }
.badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; pointer-events: none; }
.cbtn.cooling svg.i { display: none; }
.cd { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }

.chat {
  position: absolute; z-index: 3; right: max(16px, env(safe-area-inset-right)); top: 76px; bottom: 96px;
  width: min(340px, calc(100% - 32px)); display: flex; flex-direction: column;
  background: #0f0f14ea; border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 20px 60px #000a; overflow: hidden;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.chat header { display: flex; align-items: center; justify-content: space-between; padding: 6px 6px 6px 16px; border-bottom: 1px solid var(--line); }
.chat h2 { margin: 0; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chat-list { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; overscroll-behavior: contain; user-select: text; -webkit-user-select: text; }
.chat-list:empty::before { content: "No messages yet."; color: var(--muted); font-size: 14px; margin: auto; }
.line { font-size: 14.5px; line-height: 1.4; overflow-wrap: anywhere; }
.line .who, .feed-line .who { font-weight: 700; margin-right: 7px; color: #c9c9d6; }
.line .who.host, .feed-line .who.host { color: var(--accent-hi); }
.chat-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form .input { flex: 1; min-width: 0; min-height: 42px; font-size: 16px; }
.chat-form .btn { min-height: 42px; }
@media (max-height: 480px) {
  .chat { top: 56px; bottom: 88px; width: min(300px, 46%); }
  .chat header { display: none; }
}

.feed { position: absolute; z-index: 2; left: max(22px, env(safe-area-inset-left)); bottom: 24px; width: min(380px, 70%); display: flex; flex-direction: column; gap: 4px; pointer-events: none; transition: bottom .25s; }
.stage:not([data-idle]) .feed { bottom: 112px; }
.feed-line { align-self: flex-start; max-width: 100%; padding: 6px 12px; border-radius: 12px; background: #000a; font-size: 14.5px; line-height: 1.35; overflow-wrap: anywhere; animation: feed-in .2s ease-out; transition: opacity .4s; }
.feed-line.out { opacity: 0; }
@keyframes feed-in { from { opacity: 0; transform: translateY(6px); } }

.react-wrap { position: relative; }
.tray { position: absolute; right: 0; bottom: calc(100% + 10px); display: flex; gap: 2px; padding: 6px; background: #15151bf5; border: 1px solid var(--line-2); border-radius: 999px; box-shadow: 0 14px 40px #000a; z-index: 6; }
.tray-btn { width: 46px; height: 46px; border-radius: 50%; border: 0; background: transparent; font-size: 26px; line-height: 1; padding: 0; transition: transform .12s, background .12s; }
.tray-btn:hover { background: var(--surface-2); transform: scale(1.2); }
.tray-btn:active { transform: scale(.95); }
.tray-sep { align-self: center; flex: none; width: 1px; height: 24px; margin: 0 4px; background: var(--line-2); }
.tray-sound { font-size: 20px; opacity: .75; }

.fx, .fx-tags { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 2; }
.fx-tags { overflow: visible; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 70px 16px 0; }
.fx-tag { max-width: 100%; padding: 6px 14px; border-radius: 999px; background: #15151bf2; border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 8px 30px #0008; }
.fx-p { position: absolute; left: 0; top: 0; line-height: 1; white-space: nowrap; will-change: transform, opacity; }
.fx-bit { position: absolute; left: 0; top: 0; border-radius: 1px; will-change: transform, opacity; }
.fx-ring { position: absolute; left: 0; top: 0; border: 5px solid #ffffffcc; border-radius: 50%; will-change: transform, opacity; }
.fx-glow { position: absolute; inset: auto 0 0 0; height: 46%; transform-origin: 50% 100%; background: radial-gradient(120% 100% at 50% 100%, #ff7a1866, #ff3d0033 45%, transparent 70%); }
.fx-flash { position: absolute; inset: 0; background: #fff; }
.fx-tint { position: absolute; inset: 0; }
.fx-tint-blue { background: radial-gradient(120% 90% at 50% 40%, #3a7bd555, #0b2a6e99); }
.fx-tint-dark { background: #000; }
.fx-tint-amber { background: radial-gradient(120% 90% at 50% 45%, #ffc15a40, #7a3d0c8c); }
.fx-ring-gold { border-color: #ffd98acc; }

/* phone in portrait, not fullscreen: the chat sits under the controls instead of over the picture */
@media (max-width: 760px) and (orientation: portrait) {
  .stage:not(:fullscreen):not(:-webkit-full-screen) .chat {
    position: static; flex: none; order: -1; width: auto; height: min(52dvh, 420px); margin: 10px 16px 0;
    background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
  }
  /* directly under the picture, so chatting and watching fit on one screen */
  .stage:not(:fullscreen):not(:-webkit-full-screen) .frame { order: -2; }
  .stage:not(:fullscreen):not(:-webkit-full-screen) .chat .cbtn { flex: none; width: 36px; min-width: 36px; height: 36px; background: transparent; border: 0; }
  .stage:not(:fullscreen):not(:-webkit-full-screen) .feed { bottom: 10px; left: 10px; }
  .stage:not(:fullscreen):not(:-webkit-full-screen) .fx-tags { padding-top: 10px; }
  .stage:not(:fullscreen):not(:-webkit-full-screen) .react-wrap { display: contents; }
  .stage:not(:fullscreen):not(:-webkit-full-screen) .tray { position: fixed; inset: auto 12px max(12px, env(safe-area-inset-bottom)) 12px; justify-content: space-around; border-radius: 20px; }
  .stage:not(:fullscreen):not(:-webkit-full-screen) .tray-btn { flex: 1 1 0; min-width: 0; width: auto; height: 44px; font-size: 26px; }
}
