.broadcast-btn {
  padding: .3rem .75rem; font-family: "Orbitron", sans-serif; font-size: .68rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--accent); background: rgba(6, 30, 52, .55); border: 1px solid rgba(79, 210, 255, .55);
  border-radius: 2px; cursor: pointer; transition: background .15s, color .15s, box-shadow .15s;
}
.broadcast-btn:hover { color: #04121c; background: var(--accent); box-shadow: 0 0 14px rgba(79, 210, 255, .5); }
.broadcast-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.bc-card { width: min(520px, 100%); }
.bc-text {
  box-sizing: border-box; width: 100%; padding: .55rem .65rem; font: inherit; font-size: .95rem; line-height: 1.4; color: var(--text);
  background: rgba(4, 8, 18, .8); border: 1px solid var(--panel-edge); border-radius: 3px; resize: vertical; min-height: 96px;
}
.bc-text:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-dim); }
.bc-count { float: right; font-variant-numeric: tabular-nums; }

.bc-incoming {
  z-index: 150; background: radial-gradient(ellipse at center, rgba(8, 40, 70, .55), rgba(2, 4, 10, .78) 70%);
  animation: fade-in .25s ease-out both;
}
.bc-incoming .bc-card {
  position: relative; overflow: hidden; border-color: rgba(79, 210, 255, .7);
  box-shadow: 0 0 34px rgba(79, 210, 255, .25), 0 18px 40px rgba(0, 0, 0, .6);
  background-image: repeating-linear-gradient(0deg, rgba(79, 210, 255, .045) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(14, 24, 46, .98), rgba(8, 14, 30, .98));
  animation: bc-open .7s cubic-bezier(.2, .8, .2, 1) both, bc-glow 3s 1s ease-in-out infinite;
}
.bc-incoming .bc-card > :not(.bc-scan) { animation: bc-flicker .5s .55s steps(4) both; }
.bc-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 60px; pointer-events: none;
  background: linear-gradient(180deg, transparent, rgba(79, 210, 255, .28) 85%, rgba(170, 240, 255, .9));
  mix-blend-mode: screen; animation: bc-sweep 1.1s .5s ease-in both;
}
.bc-signal { display: inline-flex; align-items: flex-end; gap: 2px; height: .7rem; margin-right: .5rem; vertical-align: -1px; }
.bc-signal i { width: 3px; background: var(--accent); animation: bc-bars 1.2s ease-in-out infinite; }
.bc-signal i:nth-child(1) { height: 30%; }
.bc-signal i:nth-child(2) { height: 55%; animation-delay: .15s; }
.bc-signal i:nth-child(3) { height: 80%; animation-delay: .3s; }
.bc-signal i:nth-child(4) { height: 100%; animation-delay: .45s; }
.bc-from { position: relative; text-shadow: 0 0 12px rgba(79, 210, 255, .45); }
.bc-from::before, .bc-from::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; opacity: 0;
}
.bc-from::before { color: #ff4fd8; animation: bc-glitch .45s .7s steps(3) 2 both; }
.bc-from::after { color: #4fffe0; animation: bc-glitch-alt .45s .75s steps(3) 2 both; }
.bc-message {
  margin: 0; max-height: 50vh; overflow-y: auto; font-size: 1.02rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  min-height: 1.5em; cursor: default;
}
.bc-cursor {
  display: inline-block; width: .55em; height: 1.05em; margin-left: 2px; vertical-align: -.15em;
  background: var(--accent); box-shadow: 0 0 8px var(--accent); animation: bc-blink .8s steps(1) infinite;
}

@keyframes bc-open {
  0% { transform: scaleX(0) scaleY(.004); opacity: 0; filter: brightness(3); }
  35% { transform: scaleX(1) scaleY(.004); opacity: 1; filter: brightness(3); }
  70% { transform: scaleX(1) scaleY(1.03); filter: brightness(1.4); }
  100% { transform: none; filter: none; }
}
@keyframes bc-glow {
  50% { box-shadow: 0 0 48px rgba(79, 210, 255, .42), 0 18px 40px rgba(0, 0, 0, .6); }
}
@keyframes bc-flicker { 0% { opacity: 0; } 25% { opacity: .8; } 50% { opacity: .2; } 100% { opacity: 1; } }
@keyframes bc-sweep { from { transform: translateY(-70px); opacity: 1; } to { transform: translateY(420px); opacity: 0; } }
@keyframes bc-bars { 50% { opacity: .25; } }
@keyframes bc-blink { 50% { opacity: 0; } }
@keyframes bc-glitch {
  0% { opacity: .9; transform: translate(-3px, 1px); clip-path: inset(10% 0 55% 0); }
  50% { opacity: .9; transform: translate(3px, -1px); clip-path: inset(60% 0 8% 0); }
  100% { opacity: 0; transform: none; clip-path: inset(0); }
}
@keyframes bc-glitch-alt {
  0% { opacity: .9; transform: translate(3px, -1px); clip-path: inset(55% 0 12% 0); }
  50% { opacity: .9; transform: translate(-3px, 1px); clip-path: inset(5% 0 62% 0); }
  100% { opacity: 0; transform: none; clip-path: inset(0); }
}

@media (prefers-reduced-motion: reduce) {
  .bc-incoming .bc-card, .bc-incoming .bc-card > *, .bc-signal i, .bc-from::before, .bc-from::after { animation: none; }
  .bc-scan { display: none; }
}
