* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent !important;
  font-family: "Segoe UI", sans-serif;
  pointer-events: none;
}

body.interact-mode {
  pointer-events: auto;
}

.desktop-overlay-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.overlay-stack {
  position: fixed;
  top: 24px;
  right: 24px;
  width: max-content;
  max-width: min(280px, 40vw);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.overlay-stack[hidden] {
  display: none !important;
}

.overlay-card {
  padding: 9px 12px;
  border-radius: 14px;
  background: rgba(4, 8, 20, 0.52);
  border: 1px solid rgba(0, 255, 255, 0.35);
  box-shadow:
    0 0 18px rgba(0, 255, 255, 0.15),
    0 0 28px rgba(255, 0, 204, 0.08);
  color: #fff;
  opacity: 0;
  transform: translateX(24px);
  animation: card-in 0.35s ease forwards;
  width: max-content;
  max-width: 100%;
  max-height: 170px;
  overflow: hidden;
}

.overlay-card.removing {
  animation: card-out 0.3s ease forwards;
  pointer-events: none;
}

.overlay-card.kind-gift {
  border-color: rgba(255, 0, 204, 0.45);
  box-shadow: 0 0 20px rgba(255, 0, 204, 0.2);
}

.overlay-card.kind-follow {
  border-color: rgba(0, 255, 153, 0.4);
}

.overlay-card.speaking,
.overlay-card.tts-active {
  border-color: rgba(0, 255, 255, 0.55);
  box-shadow:
    0 0 22px rgba(0, 255, 255, 0.25),
    0 0 32px rgba(0, 255, 153, 0.12);
}

.overlay-kind {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #00ffff;
  margin-bottom: 4px;
}

.overlay-user {
  font-size: 12px;
  font-weight: 700;
  color: #ff66dd;
  margin-bottom: 4px;
}

.overlay-text {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 600;
  word-break: break-word;
}

.overlay-translation {
  margin-top: 7px;
  color: #00ffcc;
  font-size: 14px;
  line-height: 1.35;
  font-style: italic;
  word-break: break-word;
}

.overlay-translation-pending {
  margin-top: 7px;
  color: rgba(0, 255, 255, 0.55);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.overlay-tts-state {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid rgba(0, 255, 255, 0.16);
  color: #9dffc8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@keyframes card-in {
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes card-out {
  to {
    opacity: 0;
    transform: translateX(32px);
  }
}

.dev-hud {
  position: fixed;
  left: 24px;
  bottom: 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(4, 8, 20, 0.92);
  border: 1px solid rgba(0, 255, 255, 0.35);
  pointer-events: auto;
  z-index: 10000;
}

.dev-hud[hidden] {
  display: none !important;
}

.ws-status {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.65);
}

.ws-status.online {
  color: #00ff99;
}

.hud-btn {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(0, 255, 255, 0.35);
  background: rgba(0, 255, 255, 0.12);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.hud-hint {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.5);
}

.session-waiting {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.session-waiting.is-fading {
  opacity: 0;
}

.session-waiting-card {
  width: min(380px, 90vw);
  padding: 18px 20px;
  border-radius: 14px;
  background: rgba(4, 8, 20, 0.88);
  border: 1px solid rgba(0, 255, 255, 0.4);
  box-shadow: 0 0 24px rgba(0, 255, 255, 0.2);
  color: #fff;
}

.session-waiting-title {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #00ffff;
  margin-bottom: 10px;
}

.session-waiting-message {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
}

.session-waiting-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.45;
}

.session-waiting-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ff9966;
  box-shadow: 0 0 10px #ff9966;
  animation: session-waiting-pulse 1.2s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes session-waiting-pulse {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}
