/* ==========================================================================
   PVO.BET CHAOS FX LAYER (ALL OVERLAYS ARE STRICTLY pointer-events: none)
   ========================================================================== */

#chaos-layer,
#chaos-layer * {
  pointer-events: none !important;
  user-select: none;
}

#chaos-layer {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow: hidden;
}

/* Screen Shake Profiles */
@keyframes shakeMild {
  0%, 100% { transform: translate3d(0, 0, 0); }
  20% { transform: translate3d(-4px, 3px, 0) rotate(-0.3deg); }
  40% { transform: translate3d(5px, -4px, 0) rotate(0.4deg); }
  60% { transform: translate3d(-3px, -2px, 0) rotate(-0.2deg); }
  80% { transform: translate3d(3px, 3px, 0) rotate(0.2deg); }
}

@keyframes shakeViolent {
  0%, 100% { transform: translate3d(0, 0, 0); }
  10% { transform: translate3d(-12px, 9px, 0) rotate(-1.4deg) scale(1.015); }
  25% { transform: translate3d(14px, -11px, 0) rotate(1.6deg) scale(1.02); }
  40% { transform: translate3d(-15px, -8px, 0) rotate(-1.8deg) scale(0.99); }
  55% { transform: translate3d(11px, 12px, 0) rotate(1.2deg) scale(1.025); }
  70% { transform: translate3d(-9px, 7px, 0) rotate(-1deg); }
  85% { transform: translate3d(7px, -5px, 0) rotate(0.7deg); }
}

@keyframes shakeApocalypse {
  0%   { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
  6%   { transform: translate3d(-24px, 18px, 0) rotate(-3.2deg) scale(1.06); }
  13%  { transform: translate3d(26px, -22px, 0) rotate(3.6deg) scale(1.04) skewX(2deg); }
  21%  { transform: translate3d(-22px, -16px, 0) rotate(-2.8deg) scale(0.96) skewY(-1.5deg); }
  29%  { transform: translate3d(24px, 20px, 0) rotate(2.9deg) scale(1.05); }
  38%  { transform: translate3d(-18px, 14px, 0) rotate(-2.2deg) scale(1.02); }
  48%  { transform: translate3d(16px, -14px, 0) rotate(2.1deg) scale(1.03); }
  58%  { transform: translate3d(-14px, -10px, 0) rotate(-1.6deg) scale(0.98); }
  68%  { transform: translate3d(11px, 9px, 0) rotate(1.3deg) scale(1.01); }
  80%  { transform: translate3d(-7px, 5px, 0) rotate(-0.8deg); }
  90%  { transform: translate3d(4px, -4px, 0) rotate(0.4deg); }
  100% { transform: translate3d(0, 0, 0) rotate(0deg) scale(1); }
}

.shake-mild {
  animation: shakeMild 0.35s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.shake-violent {
  animation: shakeViolent 0.65s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.shake-apocalypse {
  animation: shakeApocalypse 1.05s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Anime / Arcade Impact Frame Invert Strobe */
@keyframes impactStrobeAnim {
  0%   { filter: invert(1) hue-rotate(180deg) contrast(320%) saturate(260%); }
  24%  { filter: invert(0) contrast(250%) brightness(190%); }
  48%  { filter: invert(1) contrast(360%) grayscale(100%); }
  74%  { filter: saturate(320%) hue-rotate(-35deg) contrast(190%); }
  100% { filter: none; }
}

body.impact-invert-strobe {
  animation: impactStrobeAnim 0.22s steps(1, end) 1;
}

/* Chromatic Aberration + Thermal Flicker */
.chromatic-aberration {
  text-shadow: -3px 0 rgba(255, 0, 72, 0.85), 3px 0 rgba(0, 235, 255, 0.85);
}

.chromatic-aberration .panel,
.chromatic-aberration .rocket-arena-card,
.chromatic-aberration .bet-card {
  box-shadow:
    -5px 0 14px rgba(255, 0, 68, 0.48),
    5px 0 14px rgba(0, 230, 255, 0.48),
    0 0 28px rgba(255, 30, 66, 0.4) !important;
}

/* Impact Flash Overlay */
.chaos-flash {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: radial-gradient(circle at center, #ffffff 0%, #ffb800 35%, #ff1e42 75%, rgba(0, 0, 0, 0) 100%);
  mix-blend-mode: screen;
}

.chaos-flash.active {
  animation: flashBoom 0.65s ease-out forwards;
}

@keyframes flashBoom {
  0% { opacity: 0.95; }
  20% { opacity: 0.72; }
  100% { opacity: 0; }
}

/* FLIR Thermal Scanlines + Glitch Overlay */
.chaos-flir {
  position: absolute;
  inset: 0;
  opacity: 0;
  background:
    repeating-linear-gradient(
      0deg,
      rgba(0, 255, 136, 0.08) 0px,
      rgba(0, 255, 136, 0.08) 2px,
      rgba(255, 20, 60, 0.09) 2px,
      rgba(0, 0, 0, 0.25) 4px
    );
  transition: opacity 0.2s ease;
}

.chaos-flir.active {
  opacity: 1;
  animation: flirJitter 0.16s infinite;
}

@keyframes flirJitter {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(2px); }
}

/* Emergency Corner Beacons */
.chaos-beacon {
  position: absolute;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.chaos-beacon.tl { top: -90px; left: -90px; background: radial-gradient(circle, rgba(255, 25, 60, 0.85), transparent 68%); }
.chaos-beacon.tr { top: -90px; right: -90px; background: radial-gradient(circle, rgba(0, 170, 255, 0.85), transparent 68%); }
.chaos-beacon.bl { bottom: -90px; left: -90px; background: radial-gradient(circle, rgba(255, 184, 0, 0.8), transparent 68%); }
.chaos-beacon.br { bottom: -90px; right: -90px; background: radial-gradient(circle, rgba(255, 25, 60, 0.85), transparent 68%); }

#chaos-layer.sirens-on .chaos-beacon.tl,
#chaos-layer.sirens-on .chaos-beacon.br {
  animation: sirenPulseA 0.34s infinite alternate;
}

#chaos-layer.sirens-on .chaos-beacon.tr,
#chaos-layer.sirens-on .chaos-beacon.bl {
  animation: sirenPulseB 0.34s infinite alternate;
}

@keyframes sirenPulseA {
  from { opacity: 0.12; transform: scale(0.9); }
  to { opacity: 0.95; transform: scale(1.25); }
}

@keyframes sirenPulseB {
  from { opacity: 0.95; transform: scale(1.25); }
  to { opacity: 0.12; transform: scale(0.9); }
}

/* Scrolling Hazard Tape */
.chaos-tape {
  position: absolute;
  left: -10%;
  width: 120%;
  height: 30px;
  display: flex;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-40px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  background: repeating-linear-gradient(
    -45deg,
    #ffb800 0px,
    #ffb800 18px,
    #111217 18px,
    #111217 36px
  );
  border-top: 2px solid #ff1e42;
  border-bottom: 2px solid #ff1e42;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.chaos-tape.top {
  top: 0;
}

.chaos-tape.bottom {
  bottom: 0;
  transform: translateY(40px);
}

.chaos-tape.active {
  opacity: 0.96;
  transform: translateY(0);
}

.chaos-tape-track {
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow: 0 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000;
  background: rgba(180, 0, 30, 0.88);
  padding: 2px 0;
  animation: tapeScroll 8s linear infinite;
}

.chaos-tape.bottom .chaos-tape-track {
  animation-direction: reverse;
}

@keyframes tapeScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Cracked Glass SVG Container */
.chaos-cracks {
  position: absolute;
  inset: 0;
}

/* Giant Tilted Stamp */
.chaos-stamp-wrap {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.chaos-stamp {
  padding: 16px 34px;
  border: 6px solid #ff1e42;
  border-radius: 14px;
  background: rgba(15, 2, 6, 0.86);
  box-shadow:
    0 0 50px rgba(255, 30, 66, 0.95),
    inset 0 0 28px rgba(255, 30, 66, 0.45);
  text-align: center;
  animation: stampSlam 0.42s cubic-bezier(0.18, 1.35, 0.35, 1) forwards;
}

.chaos-stamp-main {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 56px);
  line-height: 1.02;
  color: #ff274b;
  letter-spacing: 2px;
  text-shadow: 0 0 24px rgba(255, 30, 66, 0.95), 0 4px 0 #2b0009;
}

.chaos-stamp-sub {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: clamp(12px, 1.8vw, 18px);
  font-weight: 800;
  color: #ffb800;
  letter-spacing: 1px;
}

@keyframes stampSlam {
  0%   { opacity: 0; transform: scale(3.4) rotate(-22deg); }
  65%  { opacity: 1; transform: scale(0.92) rotate(-7deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}

/* Chaotic Popups (XP Errors, BSOD, ECG, FLIR Cam, Badges) */
.chaos-popups {
  position: absolute;
  inset: 0;
}

.chaos-popup {
  position: absolute;
  border-radius: 10px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.8);
  animation: popupCrashIn 0.32s cubic-bezier(0.22, 1.35, 0.36, 1) forwards;
}

@keyframes popupCrashIn {
  0% { opacity: 0; transform: scale(0.35) rotate(var(--rot, -6deg)); }
  100% { opacity: 0.96; transform: scale(1) rotate(var(--rot, -6deg)); }
}

.popup-xp {
  width: 270px;
  background: #ece9d8;
  color: #111;
  border: 2px solid #0054e3;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
  overflow: hidden;
}

.popup-xp-bar {
  background: linear-gradient(180deg, #095bc7 0%, #0046ad 100%);
  color: #fff;
  font-weight: 700;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
}

.popup-xp-body {
  padding: 10px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.35;
}

.popup-xp-icon {
  font-size: 22px;
}

.popup-bsod {
  width: 290px;
  background: #0020a8;
  color: #ffffff;
  border: 2px solid #7aa6ff;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.38;
}

.popup-ecg {
  width: 245px;
  background: #05110b;
  border: 2px solid #ff1e42;
  padding: 8px 10px;
  font-family: var(--font-mono);
  color: #ff4764;
  box-shadow: 0 0 24px rgba(255, 30, 66, 0.65);
}

.popup-ecg-line {
  height: 28px;
  margin-top: 6px;
  position: relative;
  border-bottom: 2px solid #ff1e42;
}

.popup-ecg-line::after {
  content: '---^v---______________ 0 BPM ☠️';
  position: absolute;
  bottom: 4px;
  left: 0;
  font-size: 11px;
  color: #ff1e42;
}

.popup-flir {
  width: 245px;
  background: #04150d;
  border: 2px solid #00ff88;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: #00ff88;
  box-shadow: 0 0 24px rgba(0, 255, 136, 0.45);
}

.popup-badge {
  padding: 8px 14px;
  background: linear-gradient(135deg, #ff1e42, #ffb800);
  color: #130004;
  border: 2px solid #fff;
  font-family: var(--font-display);
  font-size: 14px;
  text-transform: uppercase;
  animation: popupSpinBounce 0.45s ease-out forwards;
}

@keyframes popupSpinBounce {
  0% { opacity: 0; transform: scale(2.2) rotate(28deg); }
  100% { opacity: 0.96; transform: scale(1) rotate(var(--rot, 8deg)); }
}

/* VHS Tracking Glitch Bars */
.chaos-vhs {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: repeating-linear-gradient(
    180deg,
    transparent 0px,
    transparent 26px,
    rgba(255, 255, 255, 0.14) 26px,
    rgba(0, 255, 225, 0.18) 29px,
    rgba(255, 0, 75, 0.2) 32px,
    transparent 35px
  );
  mix-blend-mode: screen;
}

.chaos-vhs.active {
  opacity: 0.9;
  animation: vhsRoll 0.22s steps(4, end) infinite;
}

@keyframes vhsRoll {
  0% { transform: translateY(0) skewX(0deg); }
  33% { transform: translateY(-14px) skewX(3deg); }
  66% { transform: translateY(10px) skewX(-4deg); }
  100% { transform: translateY(0) skewX(0deg); }
}

/* Additional Unhinged Popup Archetypes */
.popup-sms {
  width: 265px;
  background: #101725;
  color: #f4f7ff;
  border: 2px solid #00d4ff;
  padding: 9px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  box-shadow: 0 0 24px rgba(0, 212, 255, 0.45);
}

.popup-sms-head {
  color: #00d4ff;
  font-weight: 800;
  margin-bottom: 4px;
}

.popup-gos {
  width: 270px;
  background: #ffffff;
  color: #0b1f44;
  border: 2px solid #0d4cd3;
  border-top: 8px solid #ee3f58;
  padding: 9px 11px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
}

.popup-gos-title {
  color: #0d4cd3;
  font-weight: 800;
  margin-bottom: 4px;
}

.popup-mfo {
  width: 250px;
  background: linear-gradient(135deg, #270036, #4b0014);
  color: #ffe89e;
  border: 2px solid #ffb800;
  padding: 9px 11px;
  font-family: var(--font-mono);
  font-size: 11px;
  box-shadow: 0 0 24px rgba(255, 184, 0, 0.55);
}

.popup-sticker {
  font-size: 46px;
  filter: drop-shadow(0 0 18px rgba(255, 30, 66, 0.9));
  animation: stickerWobble 0.36s ease-in-out infinite alternate;
}

@keyframes stickerWobble {
  from { transform: scale(0.92) rotate(-14deg); }
  to { transform: scale(1.2) rotate(14deg); }
}

/* Win Celebration Coins & Confetti */
.win-confetti-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.win-piece {
  position: absolute;
  top: -32px;
  font-size: 20px;
  font-weight: 900;
  animation: winDrop var(--dur, 1.8s) cubic-bezier(0.25, 0.7, 0.4, 1) forwards;
}

@keyframes winDrop {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
  85% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--dx, 40px), 105vh, 0) rotate(var(--spin, 540deg)) scale(0.8);
  }
}

/* Floating Balance Delta */
.balance-float {
  position: fixed;
  z-index: 940;
  font-family: var(--font-display);
  font-size: 16px;
  color: #00ff88;
  text-shadow: 0 0 12px rgba(0, 255, 136, 0.9), 0 2px 4px #000;
  pointer-events: none !important;
  animation: floatDeltaUp 1.1s ease-out forwards;
}

.balance-float.neg {
  color: #ff3b5c;
  text-shadow: 0 0 12px rgba(255, 30, 66, 0.9), 0 2px 4px #000;
}

@keyframes floatDeltaUp {
  0% { opacity: 0; transform: translateY(6px) scale(0.75); }
  20% { opacity: 1; transform: translateY(-8px) scale(1.1); }
  100% { opacity: 0; transform: translateY(-48px) scale(0.95); }
}

/* Radio Walkie-Talkie Subtitle Banner */
.radio-subtitle-toast {
  position: absolute;
  top: 42px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 935;
  max-width: min(92vw, 680px);
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(6, 18, 12, 0.94);
  border: 2px solid #00ff88;
  box-shadow: 0 0 28px rgba(0, 255, 136, 0.5), 0 8px 24px rgba(0, 0, 0, 0.85);
  font-family: var(--font-mono);
  text-align: center;
  animation: radioToastIn 0.25s cubic-bezier(0.18, 1.3, 0.35, 1) forwards;
}

.radio-subtitle-head {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffb800;
  margin-bottom: 3px;
}

.radio-subtitle-text {
  font-size: 14px;
  font-weight: 800;
  color: #00ff88;
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

@keyframes radioToastIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(-14px) scale(0.88); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* Messenger & Job Invite Chaos Popups */
.popup-chat {
  width: 268px;
  background: #17212b;
  color: #f5f5f5;
  border: 2px solid #2b5278;
  padding: 9px 11px;
  font-family: 'Segoe UI', Tahoma, sans-serif;
  font-size: 11px;
  box-shadow: 0 0 22px rgba(43, 82, 120, 0.6);
}

.popup-chat-from {
  color: #64b5f6;
  font-weight: 800;
  margin-bottom: 3px;
}

.popup-job {
  width: 270px;
  background: #fff8ee;
  color: #1c1917;
  border: 2px solid #d6001c;
  padding: 9px 11px;
  font-family: Tahoma, Arial, sans-serif;
  font-size: 11px;
}

.popup-job-head {
  color: #d6001c;
  font-weight: 800;
  margin-bottom: 3px;
}

/* Post-Chaos TV/Esports Announcer Broadcast Card */
.announcer-overlay {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 945;
  width: min(94vw, 720px);
  display: none;
}

.announcer-overlay.active {
  display: block;
  animation: announcerSlideIn 0.34s cubic-bezier(0.18, 1.28, 0.35, 1) forwards;
}

@keyframes announcerSlideIn {
  0% { opacity: 0; transform: translateX(-50%) translateY(34px) scale(0.92); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

.announcer-card {
  background: linear-gradient(135deg, rgba(16, 10, 24, 0.96) 0%, rgba(28, 8, 18, 0.96) 100%);
  border: 2px solid #ffb800;
  border-left: 7px solid #ff1e42;
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow:
    0 14px 42px rgba(0, 0, 0, 0.92),
    0 0 32px rgba(255, 184, 0, 0.32),
    inset 0 0 18px rgba(255, 30, 66, 0.16);
}

.announcer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
  flex-wrap: wrap;
}

.announcer-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 30, 66, 0.92);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.7px;
}

.announcer-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: blinkDot 0.65s infinite;
}

.announcer-persona {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: #ffb800;
  flex: 1;
}

.announcer-eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.announcer-eq-bar {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, #00ff88, #ffb800);
  animation: eqBounce 0.45s ease-in-out infinite alternate;
}

.announcer-eq-bar:nth-child(1) { height: 7px; animation-delay: 0s; }
.announcer-eq-bar:nth-child(2) { height: 15px; animation-delay: 0.1s; }
.announcer-eq-bar:nth-child(3) { height: 11px; animation-delay: 0.2s; }
.announcer-eq-bar:nth-child(4) { height: 17px; animation-delay: 0.08s; }
.announcer-eq-bar:nth-child(5) { height: 9px; animation-delay: 0.28s; }

@keyframes eqBounce {
  from { transform: scaleY(0.35); opacity: 0.7; }
  to { transform: scaleY(1.1); opacity: 1; }
}

.announcer-quote {
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}
