/*
 * TABLE REACTIONS (so-social lane) -- seat bubbles, the spectator stream, the chooser.
 * Linked from index.html; the service worker SHELL entry (sw.js, primary-owned) is in the integration notes.
 * Every overlay is pointer-events:none: a reaction never blocks a card, the answer panel, CLASH!, the timer or a beat.
 */

.tr-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 40;
}

.tr-bubble {
  position: absolute;
  transform: translate(-50%, -110%);
  max-width: 11rem;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  background: rgba(10, 24, 44, 0.92);
  color: #fff;
  border: 2px solid rgba(255, 214, 102, 0.9);
  font-weight: 800;
  font-size: 0.85rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  animation: tr-pop 2.5s ease-out both;
}

.tr-bubble.is-still {
  animation: none;
}

@keyframes tr-pop {
  0% { opacity: 0; transform: translate(-50%, -80%) scale(0.7); }
  10% { opacity: 1; transform: translate(-50%, -110%) scale(1.05); }
  18% { transform: translate(-50%, -110%) scale(1); }
  85% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -125%) scale(1); }
}

.tr-stream-host {
  position: absolute;
  left: 0.75rem;
  bottom: 7rem;
  max-width: 14rem;
  pointer-events: none;
}

.tr-stream {
  pointer-events: none;
  margin: 0.25rem 0;
  font-size: 0.78rem;
}

.tr-stream__title {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.06em;
  opacity: 0.75;
}

.tr-stream__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tr-stream__line {
  display: flex;
  gap: 0.4rem;
  animation: tr-fade 5s ease-out both;
}

.tr-stream__line.is-still {
  animation: none;
}

.tr-stream__who {
  font-weight: 700;
}

@keyframes tr-fade {
  0% { opacity: 0; }
  8% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0.35; }
}

.tr-chooser {
  position: relative;
}

.tr-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 0.3rem);
  z-index: 41;
  width: min(20rem, calc(100vw - 2rem));
  padding: 0.5rem;
  border-radius: 0.75rem;
  background: rgba(10, 24, 44, 0.97);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.45);
}

.tr-panel[hidden] {
  display: none;
}

.tr-panel__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.tr-panel__label {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.7);
}

.tr-pick {
  min-height: 2.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-weight: 800;
  font-size: 0.8rem;
}

.tr-pick--emoji {
  font-size: 1.25rem;
  min-width: 2.5rem;
}

@media (prefers-reduced-motion: reduce) {
  .tr-bubble,
  .tr-stream__line {
    animation: none;
  }
}
