/* CBE per-game real visuals — see cbeGameEffects.js (CBE_GAME_EFFECTS). */

@media (prefers-reduced-motion: reduce) {
  .cbe-fx-back,
  .cbe-fx-scene,
  .cbe-chaos-wrap,
  .cbe-fx-extra,
  .cbe-tx,
  .cbe-tx-particles,
  .cbe-tx-sweep,
  .cbe-tx-glow,
  .cbe-tx-veil {
    animation: none !important;
  }
  .cbe-xp-timer--vibrate .cbe-stage-inner {
    animation: none !important;
  }
}

/* --- FX layers (inside .cbe-stage) -------------------------------- */
.cbe-stage {
  position: relative;
}

.cbe-fx-back {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.cbe-fx-scene,
.cbe-chaos-wrap {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.cbe-chaos-wrap .cbe-chaos-disruption {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.cbe-fx-extra {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
}

/* Override sceneMoodSystem .scene-screen > * { z-index: 2 } for layered CBE */
.cbe-stage.scene-screen > .cbe-fx-back {
  z-index: 0 !important;
}
.cbe-stage.scene-screen > .cbe-fx-scene,
.cbe-stage.scene-screen > .cbe-chaos-wrap {
  z-index: 1 !important;
}
.cbe-stage.scene-screen > .cbe-fx-extra {
  z-index: 2 !important;
}
.cbe-stage.scene-screen > .cbe-stage-inner {
  z-index: 4 !important;
}

.cbe-stage-inner {
  position: relative;
}

/* G1 spotlight sim */
.cbe-stage[data-cbe-phase="scene1"] .cbe-fx-scene.cbe-fx-g1-scene-spotlight {
  background: radial-gradient(ellipse 55% 45% at 50% 18%, rgba(255, 255, 255, 0.14) 0%, transparent 62%);
  box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.45);
  animation: cbe-g1-spot-drift 6s ease-in-out infinite;
}

@keyframes cbe-g1-spot-drift {
  0%,
  100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.03);
  }
}

.cbe-stage[data-cbe-phase="scene1"].cbe-gen-g1 .cbe-stage-inner .cbe-choice:hover {
  box-shadow: 0 0 22px rgba(109, 213, 255, 0.25);
  animation: cbe-g1-card-pulse 1.4s ease-in-out infinite;
}

@keyframes cbe-g1-card-pulse {
  0%,
  100% {
    transform: translateY(-1px);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* .cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g1-chaos-projector {
  animation: cbe-g1-proj-flicker 0.5s ease-in-out infinite;
}

@keyframes cbe-g1-proj-flicker {
  0%,
  100% {
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    opacity: 0.5;
    filter: brightness(0.55) contrast(1.2);
  }
} */

/* G2 door beam */
.cbe-fx-g2-door-svg {
  background: linear-gradient(105deg, transparent 40%, rgba(255, 220, 160, 0.18) 48%, rgba(255, 200, 120, 0.06) 55%, transparent 70%);
  animation: cbe-g2-beam 9s ease-in-out infinite;
}

@keyframes cbe-g2-beam {
  0%,
  100% {
    transform: translateX(-6%) skewX(-2deg);
    opacity: 0.5;
  }
  50% {
    transform: translateX(4%) skewX(0deg);
    opacity: 0.95;
  }
}

.cbe-stage[data-cbe-phase="scene1"] .cbe-fx-scene.cbe-fx-g2-scene-doorbeam::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 40%, rgba(255, 200, 140, 0.2), transparent 55%);
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g2-chaos-narrow {
  background: radial-gradient(ellipse 70% 55% at 50% 50%, rgba(0, 0, 0, 0.35), transparent 70%);
  animation: cbe-g2-narrow 1.2s ease-out both;
}

@keyframes cbe-g2-narrow {
  from {
    clip-path: inset(0 0 0 0);
  }
  to {
    clip-path: inset(4% 8% 4% 8%);
  }
}

.cbe-recap-chip--g2 {
  border-width: 2px;
  border-color: rgba(255, 200, 140, 0.55);
  box-shadow: 0 0 28px rgba(255, 180, 100, 0.15);
  transform: scale(1.02);
}

/* G3 map + nodes */
.cbe-stage[data-cbe-phase="scene1"] .cbe-fx-scene.cbe-fx-g3-scene-map {
  background-image: repeating-linear-gradient(
    90deg,
    rgba(109, 213, 255, 0.07) 0 2px,
    transparent 2px 48px
  );
  opacity: 0.9;
}

.cbe-fx-g3-nodes {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  align-items: flex-end;
  padding: 8% 6% 22%;
  gap: 1.2rem;
}

.cbe-fx-g3-node {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(181, 125, 255, 0.95), rgba(109, 213, 255, 0.4));
  box-shadow: 0 0 12px rgba(155, 93, 255, 0.5);
  animation: cbe-g3-node 3.5s ease-in-out infinite;
}

.cbe-fx-g3-node:nth-child(odd) {
  animation-delay: 0.4s;
}

@keyframes cbe-g3-node {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  50% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g3-chaos-route-break {
  animation: cbe-g3-route-snap 0.8s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes cbe-g3-route-snap {
  from {
    transform: translateX(0) skewX(0);
    filter: hue-rotate(0);
  }
  40% {
    transform: translateX(-8px) skewX(-2deg);
    filter: hue-rotate(-25deg);
  }
  to {
    transform: translateX(0) skewX(0);
    filter: hue-rotate(15deg);
  }
}

.cbe-fx-g3-risk-warning {
  top: auto;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  width: min(92%, 420px);
  padding: 0.5rem 0.85rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #ffd28a;
  border: 1px solid rgba(255, 107, 157, 0.55);
  border-radius: 10px;
  background: rgba(40, 0, 20, 0.45);
  animation: cbe-g3-warn-pulse 1.6s ease-in-out infinite;
}

@keyframes cbe-g3-warn-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 157, 0.35);
  }
  50% {
    box-shadow: 0 0 24px 2px rgba(255, 107, 157, 0.25);
  }
}

/* G4 meters */
.cbe-fx-g4-meter-bars {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  justify-content: flex-start;
  padding: 12% 8% 0;
  align-items: flex-end;
}

.cbe-fx-g4-meter-seg {
  height: 8px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(109, 213, 255, 0.85), rgba(155, 93, 255, 0.35));
  width: calc(35% + var(--seg, 0) * 12%);
  animation: cbe-g4-meter 4s ease-in-out infinite;
  animation-delay: calc(var(--seg, 0) * 0.35s);
}

@keyframes cbe-g4-meter {
  0%,
  100% {
    opacity: 0.65;
    transform: scaleX(1);
  }
  50% {
    opacity: 1;
    transform: scaleX(1.04);
  }
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-fx-g4-shuffle-ghost {
  background: repeating-linear-gradient(
    -8deg,
    transparent,
    transparent 40px,
    rgba(255, 255, 255, 0.04) 40px,
    rgba(255, 255, 255, 0.04) 41px
  );
  animation: cbe-g4-shuffle 2.2s ease-in-out infinite;
}

@keyframes cbe-g4-shuffle {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3%);
  }
}

/* G5 crack */
.cbe-stage[data-cbe-phase="scene1"] .cbe-fx-scene.cbe-fx-g5-scene-crack::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 42%, rgba(0, 0, 0, 0.35) 49%, transparent 52%),
    linear-gradient(75deg, transparent 55%, rgba(255, 255, 255, 0.06) 50%, transparent 58%);
  opacity: 0.85;
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g5-chaos-crack-light {
  animation: cbe-g5-crack-light 1.4s ease-out both;
}

@keyframes cbe-g5-crack-light {
  from {
    background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0.95));
  }
  to {
    background: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(255, 240, 200, 0.18), rgba(0, 0, 0, 0.25));
  }
}

.cbe-stage[data-cbe-phase="chaos"].cbe-gen-g5 .cbe-stage-inner .cbe-choice {
  animation: cbe-g5-cards-rise 0.9s ease-out both;
}

@keyframes cbe-g5-cards-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: brightness(0.4);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: brightness(1);
  }
}

/* G6 particles */
.cbe-fx-g6-dust-layer {
  background-image: radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.06) 0, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.05) 0, transparent 2px);
  background-size: 80px 80px, 60px 60px;
  animation: cbe-g6-dust 14s linear infinite;
}

@keyframes cbe-g6-dust {
  to {
    transform: translateY(12%);
  }
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g6-chaos-rebuild {
  animation: cbe-g6-rebuild 0.7s ease-out both;
}

@keyframes cbe-g6-rebuild {
  0% {
    opacity: 0;
    transform: scale(1.05);
    filter: brightness(0);
  }
  45% {
    opacity: 1;
    filter: brightness(0.3);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

/* G7 audience */
.cbe-fx-g7-heads {
  display: flex;
  justify-content: space-between;
  padding: 10% 5% 0;
  opacity: 0.35;
}

.cbe-fx-g7-head {
  width: 22px;
  height: 28px;
  border-radius: 40% 40% 8px 8px;
  background: linear-gradient(180deg, rgba(30, 40, 80, 0.9), rgba(10, 12, 30, 0.95));
  animation: cbe-g7-bob 4s ease-in-out infinite;
}

.cbe-fx-g7-head:nth-child(2n) {
  animation-delay: 0.5s;
}

@keyframes cbe-g7-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g7-chaos-audience-pulse {
  animation: cbe-g7-pulse 1.8s ease-in-out infinite;
}

@keyframes cbe-g7-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35);
  }
  50% {
    box-shadow: inset 0 0 100px rgba(255, 80, 120, 0.12);
  }
}

.cbe-stage[data-cbe-phase="chaos"].cbe-gen-g7 .cbe-choice {
  border-width: 2px;
}

/* G8 eval + chaos countdown feel */
.cbe-fx-g8-eval-decor {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 8%;
  gap: 1rem;
  opacity: 0.55;
}

.cbe-fx-g8-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 3px solid rgba(255, 143, 179, 0.35);
  border-top-color: rgba(255, 143, 179, 0.95);
  animation: cbe-g8-spin 2.8s linear infinite;
}

.cbe-fx-g8-ticks {
  width: 4px;
  height: 48px;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.35) 6px, transparent 6px, transparent 12px);
}

@keyframes cbe-g8-spin {
  to {
    transform: rotate(360deg);
  }
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g8-chaos-countdown {
  box-shadow: inset 0 0 80px rgba(255, 40, 80, 0.12);
}

.cbe-xp-timer--critical .cbe-xp-timer-track {
  border-color: rgba(255, 107, 157, 0.65);
}

.cbe-xp-timer--vibrate .cbe-stage-inner {
  animation: cbe-g8-vibrate 0.28s linear infinite;
}

@keyframes cbe-g8-vibrate {
  0%,
  100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-1px, 1px);
  }
  75% {
    transform: translate(1px, -1px);
  }
}

/* G9 fog */
.cbe-fx-g9-fog-layer {
  background: radial-gradient(ellipse 100% 80% at 50% 100%, rgba(200, 210, 255, 0.12), transparent 55%),
    radial-gradient(ellipse 80% 60% at 30% 20%, rgba(155, 93, 255, 0.1), transparent 50%);
  filter: blur(0px);
  animation: cbe-g9-fog 10s ease-in-out infinite;
}

@keyframes cbe-g9-fog {
  0%,
  100% {
    opacity: 0.55;
    transform: translateX(0);
  }
  50% {
    opacity: 0.85;
    transform: translateX(2%);
  }
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g9-chaos-fog-shift {
  animation: cbe-g9-fog-chaos 1.2s ease-out both;
}

@keyframes cbe-g9-fog-chaos {
  from {
    filter: blur(0px) brightness(1);
  }
  50% {
    filter: blur(2px) brightness(0.75);
  }
  to {
    filter: blur(0.5px) brightness(1.05);
  }
}

/* G10 convergence rails + final */
.cbe-fx-g10-signal-rails {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 14% 10% 0;
  opacity: 0.5;
}

.cbe-fx-g10-rail {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 211, 105, 0.7), rgba(255, 107, 157, 0.6), transparent);
  animation: cbe-g10-rail-in 2.4s ease-out both;
}

.cbe-fx-g10-rail:nth-child(1) {
  animation-delay: 0s;
}
.cbe-fx-g10-rail:nth-child(2) {
  animation-delay: 0.12s;
}
.cbe-fx-g10-rail:nth-child(3) {
  animation-delay: 0.24s;
}
.cbe-fx-g10-rail:nth-child(4) {
  animation-delay: 0.36s;
}
.cbe-fx-g10-rail:nth-child(5) {
  animation-delay: 0.48s;
}

@keyframes cbe-g10-rail-in {
  from {
    transform: scaleX(0.2);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.cbe-fx-g10-final-veil {
  background: radial-gradient(circle at 50% 50%, rgba(255, 60, 100, 0.2), transparent 60%);
  animation: cbe-g10-veil 2s ease-in-out infinite;
}

@keyframes cbe-g10-veil {
  0%,
  100% {
    opacity: 0.4;
  }
  50% {
    opacity: 0.85;
  }
}

.cbe-stage[data-cbe-phase="chaos"] .cbe-chaos-wrap.cbe-fx-g10-chaos-final-disruption {
  animation: cbe-g10-final 0.5s steps(2) 3, cbe-g10-final2 1.2s ease-out 0.6s both;
}

@keyframes cbe-g10-final {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}

@keyframes cbe-g10-final2 {
  from {
    filter: saturate(0.3) contrast(1.4);
  }
  to {
    filter: saturate(1.2) contrast(1);
  }
}

/* Accent + animation utility classes on .cbe-stage */
.cbe-acc-g1-cool {
  --cbe-ui-accent: #6dd5ff;
}
.cbe-acc-g2-warm {
  --cbe-ui-accent: #ffc896;
}
.cbe-acc-g3-split {
  --cbe-ui-accent: #b57dff;
}
.cbe-acc-g4-hud {
  --cbe-ui-accent: #6dd5ff;
}
.cbe-acc-g5-muted {
  --cbe-ui-accent: #c4b8d8;
}
.cbe-acc-g6-muted {
  --cbe-ui-accent: #d8a8bc;
}
.cbe-acc-g7-stage {
  --cbe-ui-accent: #8ba3d4;
}
.cbe-acc-g8-urgent {
  --cbe-ui-accent: #ff6b9d;
}
.cbe-acc-g9-violet {
  --cbe-ui-accent: #c9a8ff;
}
.cbe-acc-g10-clash {
  --cbe-ui-accent: #ff6b9d;
}

.cbe-anim-g1-pulse-cards .cbe-choice--selected {
  box-shadow: 0 0 0 2px rgba(109, 213, 255, 0.55), 0 8px 32px rgba(0, 0, 0, 0.35);
}

.cbe-anim-g2-slow-reveal .cbe-choice {
  animation: cbe-reveal-soft 0.7s ease-out both;
}

.cbe-anim-g2-slow-reveal .cbe-choice:nth-child(2) {
  animation-delay: 0.1s;
}
.cbe-anim-g2-slow-reveal .cbe-choice:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes cbe-reveal-soft {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cbe-anim-g3-path-flow .cbe-fx-scene {
  animation: cbe-path-flow 12s linear infinite;
}

@keyframes cbe-path-flow {
  to {
    background-position: 200px 0;
  }
}

.cbe-anim-g4-meter-breathe .cbe-progress-fill {
  animation: cbe-progress-shimmer 2.5s ease-in-out infinite;
}

.cbe-anim-g5-breathe-slow .cbe-stage-inner {
  animation: cbe-breathe-slow 7s ease-in-out infinite;
}

@keyframes cbe-breathe-slow {
  0%,
  100% {
    opacity: 0.92;
  }
  50% {
    opacity: 1;
  }
}

.cbe-anim-g6-dust .cbe-game-title {
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.15));
}

.cbe-anim-g7-crowd-drift .cbe-fx-g7-heads {
  animation: cbe-crowd-drift 16s ease-in-out infinite;
}

@keyframes cbe-crowd-drift {
  50% {
    transform: translateX(3%);
  }
}

.cbe-anim-g8-tick-pulse .cbe-phase-badge--chaos {
  animation: cbe-badge-beat 0.6s ease-in-out infinite;
}

@keyframes cbe-badge-beat {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
}

.cbe-anim-g9-fog-drift .cbe-body {
  backdrop-filter: blur(0.5px);
}

.cbe-anim-g10-final-glitch .cbe-game-title {
  animation: cbe-title-glitch 3s ease-in-out infinite;
}

@keyframes cbe-title-glitch {
  0%,
  90%,
  100% {
    transform: none;
  }
  92% {
    transform: skewX(-2deg);
    text-shadow: 3px 0 #ff6b9d, -3px 0 #6dd5ff;
  }
  94% {
    transform: skewX(1deg);
  }
}

/* Background extra treatments (pair with .cbe-gen-g*) */
.cbe-bg-g1-spot-vignette .cbe-fx-back {
  background: radial-gradient(ellipse 100% 90% at 50% 15%, rgba(109, 213, 255, 0.08), transparent 55%);
}

.cbe-bg-g2-door-glow .cbe-fx-back {
  background: linear-gradient(100deg, rgba(255, 200, 140, 0.1) 0%, transparent 45%);
}

.cbe-bg-g3-map-path .cbe-fx-back {
  opacity: 0.9;
}

.cbe-bg-g4-energy-grid .cbe-fx-back {
  background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 28px, 28px 100%;
}

.cbe-bg-g5-crack-fade .cbe-fx-back {
  background: rgba(20, 12, 40, 0.35);
}

.cbe-bg-g6-particles-fall .cbe-fx-back {
  background: linear-gradient(180deg, rgba(30, 20, 50, 0.5), rgba(10, 8, 24, 0.65));
}

.cbe-bg-g7-silhouettes .cbe-fx-back {
  background: radial-gradient(ellipse 120% 80% at 50% 100%, rgba(0, 0, 0, 0.55), transparent 50%);
}

.cbe-bg-g8-timer-rings .cbe-fx-back {
  background: radial-gradient(circle at 50% 12%, rgba(255, 143, 179, 0.12), transparent 40%);
}

.cbe-bg-g9-fog .cbe-fx-back {
  background: radial-gradient(ellipse 90% 70% at 50% 30%, rgba(180, 170, 220, 0.12), transparent 60%);
}

.cbe-bg-g10-convergence .cbe-fx-back {
  background: conic-gradient(from 180deg at 50% 50%, rgba(255, 107, 157, 0.08), transparent, rgba(255, 211, 105, 0.08), transparent);
}

/* --- Cinematic transitions (.cbe-tx) ----------------------------- */
.cbe-tx {
  position: relative;
  min-height: min(58vh, 520px);
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cbe-tx-veil,
.cbe-tx-glow,
.cbe-tx-particles,
.cbe-tx-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.cbe-tx-glow {
  z-index: 0;
  background: radial-gradient(circle at 30% 30%, rgba(155, 93, 255, 0.18), transparent 45%);
  animation: cbe-tx-glow-move 7s ease-in-out infinite;
}

@keyframes cbe-tx-glow-move {
  50% {
    transform: scale(1.06);
  }
}

.cbe-tx-particles {
  opacity: 0.35;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.2) 1px, transparent 1px);
  background-size: 22px 26px;
}

.cbe-tx-sweep {
  opacity: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.12) 50%, transparent 65%);
  animation: cbe-tx-sweep-anim 2.8s ease-in-out infinite;
}

@keyframes cbe-tx-sweep-anim {
  0% {
    opacity: 0;
    transform: translateX(-30%);
  }
  30% {
    opacity: 0.7;
  }
  100% {
    opacity: 0;
    transform: translateX(30%);
  }
}

.cbe-tx-lines {
  position: relative;
  width: 100%;
  display: flex;
  flex-grow: 1;
  flex-direction: column;
  z-index: 4;
  padding: 2rem 1.5rem 5.5rem;
  /* max-width: 38rem; */
}

.cbe-tx-line1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 3.45rem;
  line-height: 1.08;
}

.cbe-tx-line2 {
  margin: auto;
  font-size: clamp(1.1rem, 5vw, 1.75rem);
  letter-spacing: 1px;
  line-height: 1.55;
  color: rgba(210, 220, 255, 0.88);
}

.cbe-tx-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  padding: 1rem 1.25rem 1.35rem;
  background: linear-gradient(180deg, transparent, rgba(4, 8, 28, 0.92));
  display: flex;
  justify-content: flex-end;
}

.cbe-tx-cta {
  border-radius: 999px;
  padding: 0.75rem 1.6rem;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid rgba(125, 214, 255, 0.55);
  background: linear-gradient(135deg, rgba(155, 93, 255, 0.45), rgba(255, 107, 157, 0.35));
  color: #fff;
}

.cbe-tx--g1-flicker .cbe-tx-veil {
  animation: cbe-tx-g1-flick 0.8s steps(2) infinite;
}

@keyframes cbe-tx-g1-flick {
  0%,
  100% {
    background: rgba(0, 0, 0, 0.55);
  }
  50% {
    background: rgba(0, 0, 0, 0.82);
  }
}

.cbe-tx--g1-noise-slice .cbe-tx-veil {
  clip-path: inset(0 100% 0 0);
  animation: cbe-tx-slice-in 0.55s ease-out forwards;
}

.cbe-tx--g2-door-sweep .cbe-tx-sweep {
  opacity: 1;
  animation-duration: 3.2s;
}

.cbe-tx--g2-soft-beam .cbe-tx-glow {
  background: linear-gradient(95deg, rgba(255, 200, 140, 0.25), transparent 60%);
}

.cbe-tx--g3-route-recalc .cbe-tx-veil {
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.4),
    rgba(0, 0, 0, 0.4) 3px,
    rgba(255, 60, 100, 0.12) 3px,
    rgba(255, 60, 100, 0.12) 6px
  );
  animation: cbe-tx-g3-blink 0.4s steps(2) 4;
}

@keyframes cbe-tx-g3-blink {
  50% {
    opacity: 0.5;
  }
}

.cbe-tx--g3-path-glitch .cbe-tx-particles {
  animation: cbe-tx-shake 0.35s ease-in-out 3;
}

.cbe-tx--g4-energy-shuffle .cbe-tx-particles {
  animation: cbe-tx-g4-shuf 1.6s ease-in-out infinite;
}

@keyframes cbe-tx-g4-shuf {
  50% {
    transform: translateY(4%) skewX(-1deg);
  }
}

.cbe-tx--g4-meter-snap .cbe-tx-sweep {
  animation-duration: 1.4s;
}

.cbe-tx--g5-crack-to-light .cbe-tx-veil {
  animation: cbe-tx-g5-veil 1.2s ease-out both;
}

@keyframes cbe-tx-g5-veil {
  from {
    background: #000;
  }
  to {
    background: radial-gradient(ellipse at 50% 40%, rgba(255, 230, 190, 0.2), rgba(0, 0, 0, 0.55));
  }
}

.cbe-tx--g5-soft-rise .cbe-tx-lines {
  animation: cbe-tx-rise 0.9s ease-out both;
}

.cbe-tx--g5-hold-fade .cbe-tx-veil {
  animation: cbe-tx-hold 1.4s ease-in-out both;
}

@keyframes cbe-tx-hold {
  0%,
  60% {
    opacity: 1;
    background: rgba(0, 0, 0, 0.88);
  }
  100% {
    opacity: 0.75;
  }
}

.cbe-tx--g6-blackout-rebuild .cbe-tx-veil {
  animation: cbe-tx-g6-bo 0.55s ease-in-out both;
}

@keyframes cbe-tx-g6-bo {
  0% {
    background: #000;
  }
  40% {
    background: #000;
  }
  100% {
    background: rgba(0, 0, 0, 0.7);
  }
}

.cbe-tx--g6-signal-rise .cbe-tx-glow {
  animation-duration: 3s;
}

.cbe-tx--g7-audience-pulse .cbe-tx-veil {
  animation: cbe-tx-g7 1.5s ease-in-out infinite;
}

@keyframes cbe-tx-g7 {
  50% {
    box-shadow: inset 0 0 80px rgba(255, 80, 120, 0.15);
  }
}

.cbe-tx--g7-noise-floor .cbe-tx-particles {
  opacity: 0.55;
}

.cbe-tx--g8-countdown-cut .cbe-tx-line1 {
  animation: cbe-tx-g8-cut 0.5s ease-out 4;
}

@keyframes cbe-tx-g8-cut {
  50% {
    letter-spacing: 0.12em;
    color: #ff8fb3;
  }
}

.cbe-tx--g8-chromatic-slice .cbe-tx-sweep {
  opacity: 0.8;
  background: linear-gradient(90deg, rgba(255, 0, 80, 0.15), rgba(0, 200, 255, 0.12));
}

.cbe-tx--g8-results-flash .cbe-tx-veil {
  animation: cbe-tx-flash 0.35s ease-out 2;
}

@keyframes cbe-tx-flash {
  50% {
    background: #fff;
    opacity: 0.15;
  }
}

.cbe-tx--g9-fog-shift .cbe-tx-veil {
  filter: blur(1px);
  animation: cbe-tx-g9 1.8s ease-in-out both;
}

@keyframes cbe-tx-g9 {
  50% {
    filter: blur(3px);
  }
}

.cbe-tx--g9-blur-cut .cbe-tx-lines {
  animation: cbe-tx-wave 0.7s ease-out both;
}

.cbe-tx--g10-final-convergence .cbe-tx-glow {
  background: conic-gradient(from 0deg, rgba(255, 107, 157, 0.25), transparent, rgba(255, 211, 105, 0.2), transparent);
  animation: cbe-tx-g10-spin 4s linear infinite;
}

@keyframes cbe-tx-g10-spin {
  to {
    transform: rotate(360deg);
  }
}

.cbe-tx--g10-final-glitch .cbe-tx-veil {
  animation: cbe-tx-g10-gl 0.2s steps(2) 6;
}

.cbe-tx--g10-compile .cbe-tx-particles {
  animation: cbe-tx-compile 2s ease-out both;
}

@keyframes cbe-tx-compile {
  from {
    transform: scale(1.2);
    opacity: 0.8;
  }
  to {
    transform: scale(1);
    opacity: 0;
  }
}

.cbe-tx--results-sweep .cbe-tx-sweep {
  opacity: 0.6;
}

.cbe-tx--fallback .cbe-tx-veil {
  background: rgba(0, 0, 0, 0.6);
}

@keyframes cbe-tx-slice-in {
  to {
    clip-path: inset(0 0 0 0);
  }
}

@keyframes cbe-tx-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cbe-tx-shake {
  0%,
  100% {
    transform: translate(0, 0);
  }
  33% {
    transform: translate(-2px, 1px);
  }
  66% {
    transform: translate(2px, -1px);
  }
}

@keyframes cbe-tx-wave {
  from {
    transform: skewX(-2deg);
    opacity: 0;
  }
  to {
    transform: skewX(0);
    opacity: 1;
  }
}

/* --- Flamey positions (body.cbe-active) ------------------------ */
body.cbe-active[data-cbe-flamey='g1-br'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g2-br-soft'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g3-tr'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g4-below'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g5-far'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g6-min'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g7-behind'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g8-min'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g9-low'] .chaos-flamey-visual {
  width: 72px;
  opacity: 0.22;
}

body.cbe-active[data-cbe-flamey='g3-tr'] .chaos-flamey-visual {
  right: 0.5rem;
  top: 18%;
  bottom: auto;
  transform: none;
}

body.cbe-active[data-cbe-flamey='g4-below'] .chaos-flamey-visual {
  top: auto;
  bottom: 7rem;
}

body.cbe-active[data-cbe-flamey='g5-far'] .chaos-flamey-visual {
  opacity: 0.16;
  width: 64px;
}

body.cbe-active[data-cbe-flamey='g7-behind'] .chaos-flamey-visual {
  opacity: 0.12;
  z-index: 4;
}

body.cbe-active[data-cbe-flamey='g10-ghost'] .chaos-flamey-visual,
body.cbe-active[data-cbe-flamey='g10-ghost'] .chaos-flamey-img {
  opacity: 0.06;
  width: 56px;
}

@media (max-width: 640px) {
  body.cbe-active .chaos-flamey-visual {
    display: none !important;
  }
}
