/* Killfeed + Streamer / Clip Mode */

.killfeed {
  position: fixed;
  left: 20px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: min(340px, calc(100vw - 40px));
}

.killfeed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(8, 8, 8, 0.82);
  border: 1px solid rgba(74, 21, 24, 0.28);
  border-left: 3px solid var(--accent, #4a1518);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  font-size: 0.78rem;
  font-weight: 500;
  color: #ddd;
  letter-spacing: 0.01em;
  transform: translateX(-120%);
  opacity: 0;
  animation: killIn 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.killfeed-item.out {
  animation: killOut 0.4s ease forwards;
}

.killfeed-tag {
  flex-shrink: 0;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #4a1518);
}

.killfeed-text { line-height: 1.35; color: #c8c8c8; }
.killfeed-text strong { color: #f0f0f0; font-weight: 600; }

@keyframes killIn {
  from { opacity: 0; transform: translateX(-120%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes killOut {
  to { opacity: 0; transform: translateX(-40%) scale(0.96); }
}

.preview-tools {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stream-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted, #9a908c);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.stream-toggle:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #eee;
}

.stream-toggle.active {
  border-color: rgba(74, 21, 24, 0.45);
  background: rgba(74, 21, 24, 0.12);
  color: #f0f0f0;
}

.stream-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #555;
  transition: background 0.2s, box-shadow 0.2s;
}

.stream-toggle.active .stream-toggle-dot {
  background: #4a1518;
  box-shadow: 0 0 0 3px rgba(74, 21, 24, 0.2);
}

.hero-preview-frame {
  position: relative;
}

.stream-blackout {
  position: absolute;
  inset: 1px;
  z-index: 5;
  border-radius: inherit;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s;
}

body.stream-mode .stream-blackout {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.stream-blackout span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #333;
}

.stream-blackout small {
  font-size: 0.75rem;
  color: #555;
  letter-spacing: 0.04em;
}

.stream-blackout-exit {
  margin-top: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #ddd;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.stream-blackout-exit:hover {
  border-color: rgba(74, 21, 24, 0.5);
  background: rgba(74, 21, 24, 0.16);
  color: #fff;
}

body.stream-mode .esp-world {
  opacity: 0 !important;
  visibility: hidden !important;
}

body.stream-mode .killfeed {
  opacity: 0.15;
  filter: blur(2px);
}

@media (max-width: 768px) {
  .killfeed {
    left: 12px;
    bottom: 12px;
    max-width: calc(100vw - 24px);
  }
  .killfeed-item { font-size: 0.72rem; padding: 8px 12px; }
}

/* Config Lab */
.config-lab {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(14, 14, 14, 0.75);
  max-width: 1040px;
  margin-left: auto;
  margin-right: auto;
}

.config-lab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.config-lab-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim, #5c5c5c);
}

.config-lab-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.config-lab-row input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: #eee;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
}

.config-lab-row input:focus {
  outline: none;
  border-color: rgba(74, 21, 24, 0.45);
}

.config-lab-row .cfg-btn {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #ddd;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.config-lab-row .cfg-btn:hover {
  border-color: rgba(74, 21, 24, 0.4);
  color: #fff;
}

.config-lab-row .cfg-btn.primary {
  background: rgba(74, 21, 24, 0.18);
  border-color: rgba(74, 21, 24, 0.4);
}

.config-lab-help {
  margin-top: 8px;
  font-size: 0.74rem;
  color: var(--text-dim, #5c5c5c);
}

/* Language switch */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.lang-btn {
  border: none;
  background: transparent;
  color: var(--text-dim, #5c5c5c);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-btn:hover { color: #eee; }

.lang-btn.active {
  background: rgba(74, 21, 24, 0.22);
  color: #fff;
}

.root-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  z-index: 9999;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 18, 0.94);
  color: #eee;
  font-size: 0.82rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.root-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Sound control (nav) */
.sfx-nav-item { position: relative; list-style: none; }

.sfx-control { position: relative; }

.sfx-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted, #9a908c);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.sfx-toggle:hover {
  color: #eee;
  border-color: rgba(255, 255, 255, 0.2);
}

.sfx-toggle svg { width: 18px; height: 18px; display: block; }

.sfx-control.is-muted .sfx-toggle {
  color: #666;
  border-color: rgba(255, 255, 255, 0.08);
}

.sfx-control.is-muted .sfx-waves { display: none; }
.sfx-control:not(.is-muted) .sfx-mute-x { display: none !important; }
.sfx-control.is-muted .sfx-mute-x { display: block !important; }

.sfx-control.is-open .sfx-toggle {
  border-color: rgba(74, 21, 24, 0.4);
  color: #fff;
  background: rgba(74, 21, 24, 0.12);
}

.sfx-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 120;
  width: min(260px, calc(100vw - 32px));
  padding: 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(14, 14, 14, 0.96);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55);
  display: grid;
  gap: 12px;
}

.sfx-panel[hidden] { display: none !important; }

.sfx-row {
  display: grid;
  gap: 6px;
}

.sfx-row label,
.sfx-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim, #5c5c5c);
}

.sfx-panel input[type="range"] {
  width: 100%;
  accent-color: var(--accent, #4a1518);
  cursor: pointer;
}

.sfx-panel select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.35);
  color: #eee;
  font-family: inherit;
  font-size: 0.8rem;
}

.sfx-mute-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8rem;
  color: #bbb;
}

.sfx-mute-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent, #4a1518);
  cursor: pointer;
}

.sfx-preview {
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #ddd;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.sfx-preview:hover {
  border-color: rgba(74, 21, 24, 0.4);
  color: #fff;
}
