/* =========================================================================
   KTGP Sage Core  EHologram Stage, Canvas & Overlay HUD Styles
   ========================================================================= */

.hologram-stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  pointer-events: none;
  z-index: 900;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

.hologram-stage.is-speaking {
  pointer-events: auto;
}

.hologram-stage.is-transitioning {
  pointer-events: auto;
}

.hologram-stage.is-dormant {
  pointer-events: none !important;
  background: transparent !important;
}

.hologram-stage.shockwave-flash {
  box-shadow: inset 0 0 100px rgba(0, 255, 170, 0.45);
}

.hologram-stage.stage-shake {
  animation: stageShake 0.48s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes stageShake {
  0% {
    transform: translate(0, 0);
  }
  15% {
    transform: translate(-8px, 5px);
  }
  30% {
    transform: translate(7px, -6px);
  }
  45% {
    transform: translate(-6px, 4px);
  }
  60% {
    transform: translate(5px, -3px);
  }
  75% {
    transform: translate(-3px, 2px);
  }
  90% {
    transform: translate(2px, -1px);
  }
  100% {
    transform: translate(0, 0);
  }
}

canvas#coreCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 905;
}

/* Stage Isolation Glass Screen disabled: eliminates artificial phone frame border and prevents dimming/blurring of ARYA hologram */
.isolation-glass-screen {
  display: none !important;
}

/* Floating Center Overlay Text (Highest Z-Index: 920) */
.cinematic-overlay-content {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.92);
  z-index: 920;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  text-align: center;
  transition:
    opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  padding: 0 20px;
  max-width: 800px;
  width: 90vw;
}

.cinematic-overlay-content.visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.tier-badge {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 5px;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow:
    0 0 16px rgba(255, 220, 138, 0.75),
    0 2px 4px rgba(0, 0, 0, 0.8);
  margin-bottom: 6px;
  transition: color 0.2s;
}

.skill-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: #ffffff;
  text-shadow:
    0 0 24px rgba(255, 255, 255, 0.9),
    0 0 44px var(--mint-bright),
    0 3px 6px rgba(0, 0, 0, 0.9);
  transition:
    transform 0.1s ease-out,
    color 0.2s;
}

.sub-announcement {
  margin-top: 8px;
  font-size: 13px;
  color: #e2f9ee;
  opacity: 0.92;
  max-width: 520px;
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

@media (max-width: 600px) {
  .cinematic-overlay-content {
    padding: 0 12px;
    width: calc(100vw - 24px);
  }
  .skill-title {
    font-size: 22px;
    letter-spacing: 1px;
    line-height: 1.25;
  }
  .tier-badge {
    font-size: 10px;
    letter-spacing: 3px;
  }
  .sub-announcement {
    font-size: 11px;
    max-width: 100%;
    line-height: 1.4;
  }
}

/* Animated Rejection / Explanatory Reason Banner */
.reason-banner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 600px;
  font-size: 12px;
  line-height: 1.45;
  color: #e2f9ee;
  border-radius: 16px;
  background: #06150d;
  border: 0px solid rgba(143, 232, 192, 0.35);
  backdrop-filter: blur(14px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);

  /* Collapsed & invisible when not active: 0px layout footprint so text is perfectly centered */
  opacity: 0;
  max-height: 0;
  margin-top: 0;
  padding: 0 18px;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.96);

  /* Smooth fade & collapse transitions: fades away first, then height smoothly collapses to center text */
  transition:
    opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    max-height 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s,
    margin-top 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s,
    padding 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s,
    border-width 0.3s ease;
}

.reason-banner.visible {
  opacity: 1;
  max-height: 90px;
  margin-top: 14px;
  padding: 8px 18px;
  border-width: 1px;
  overflow: visible;
  pointer-events: auto;
  cursor: pointer;
  transform: translateY(0) scale(1);
  transition:
    max-height 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    margin-top 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    padding 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
    border-width 0.3s ease,
    opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s,
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s;
}

.reason-banner.retracting {
  opacity: 0 !important;
  transform: translateY(12px) scale(0.96) !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  padding: 0 18px !important;
  pointer-events: none !important;
  transition:
    opacity 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1),
    max-height 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s,
    margin-top 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s,
    padding 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) 0.08s,
    border-width 0.3s ease !important;
}

.reason-banner.warning {
  border-color: #f97316;
  background: #230b05;
  box-shadow: 0 0 25px rgba(249, 115, 22, 0.45);
  color: #ffedd5;
}

.reason-banner.error {
  border-color: #ef4444;
  background: #1f0707;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.45);
  color: #fee2e2;
}

.reason-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(143, 232, 192, 0.2);
  color: var(--mint-bright);
  white-space: nowrap;
}

.reason-banner.warning .reason-tag {
  background: rgba(249, 115, 22, 0.25);
  color: #f97316;
}

.reason-banner.error .reason-tag {
  background: rgba(239, 68, 68, 0.25);
  color: #ef4444;
}

.reason-text {
  text-align: left;
}

.reason-header-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.reason-phase-counter {
  display: none;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 700;
  color: rgba(226, 249, 238, 0.65);
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

.reason-text-wrap {
  display: inline-block;
  min-width: 0;
  position: relative;
}

.reason-phase-bar {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--mint-bright);
  box-shadow: 0 0 6px var(--mint-bright);
  width: 0%;
  transition: width 0.25s linear;
}

/* 5 Animation Styles for Multi-Phase Reason Dissolve */

/* 1. cross-dissolve (Default: subtle rise & settle) */
.phase-out-dissolve {
  animation: phaseDissolveOut 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.phase-in-dissolve {
  animation: phaseDissolveIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes phaseDissolveOut {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-4px);
  }
}
@keyframes phaseDissolveIn {
  0% {
    opacity: 0;
    transform: translateY(4px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 2. blur-flare (Holographic Optical Blur & Flare) */
.phase-out-blur {
  animation: phaseBlurOut 0.16s ease forwards;
}
.phase-in-blur {
  animation: phaseBlurIn 0.22s ease forwards;
}
@keyframes phaseBlurOut {
  0% {
    opacity: 1;
    filter: blur(0px);
  }
  100% {
    opacity: 0.1;
    filter: blur(4px);
  }
}
@keyframes phaseBlurIn {
  0% {
    opacity: 0;
    filter: blur(5px) brightness(1.4);
  }
  100% {
    opacity: 1;
    filter: blur(0px) brightness(1);
  }
}

/* 3. slide-fade (Directional Horizontal Pagination) */
.phase-out-slide {
  animation: phaseSlideOut 0.17s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
.phase-in-slide {
  animation: phaseSlideIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes phaseSlideOut {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-16px);
  }
}
@keyframes phaseSlideIn {
  0% {
    opacity: 0;
    transform: translateX(16px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 4. glitch-shutter (Sci-Fi Cyber Scanline Shutter) */
.phase-out-glitch {
  animation: phaseGlitchOut 0.14s steps(3) forwards;
}
.phase-in-glitch {
  animation: phaseGlitchIn 0.18s steps(3) forwards;
}
@keyframes phaseGlitchOut {
  0% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
  50% {
    opacity: 0.7;
    clip-path: inset(25% 0 35% 0);
    transform: translateX(-3px);
  }
  100% {
    opacity: 0;
    clip-path: inset(50% 0 50% 0);
    transform: translateX(2px);
  }
}
@keyframes phaseGlitchIn {
  0% {
    opacity: 0;
    clip-path: inset(45% 0 45% 0);
    transform: translateX(3px);
  }
  50% {
    opacity: 0.85;
    clip-path: inset(10% 0 15% 0);
    transform: translateX(-1px);
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateX(0);
  }
}

/* 5. typewriter (Streaming Telemetry) */
.phase-out-typewriter {
  animation: phaseFadeQuick 0.12s ease forwards;
}
@keyframes phaseFadeQuick {
  0% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
.reason-cursor {
  display: inline-block;
  width: 2px;
  height: 1.1em;
  background: var(--mint-bright);
  animation: cursorBlink 0.6s infinite;
  margin-left: 2px;
  vertical-align: middle;
}
@keyframes cursorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.reason-banner.card-swap {
  animation: reasonCardSwap 0.38s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes reasonCardSwap {
  0% {
    transform: scale(0.97);
    filter: brightness(1.25);
  }
  50% {
    transform: scale(1.02);
    filter: brightness(1.35);
  }
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

/* Futuristic Mid-Speech Status Presentation Overlay */
.status-event-overlay {
  position: fixed;
  top: 48px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.94);
  z-index: 930;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.status-event-overlay.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.status-event-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 20px;
  border-radius: 22px;
  background: #04120a;
  border: 1px solid var(--status-color, #22c55e);
  box-shadow:
    0 0 24px var(--status-glow, rgba(34, 197, 94, 0.5)),
    inset 0 0 14px var(--status-glow, rgba(34, 197, 94, 0.25));
  backdrop-filter: blur(12px);
  transition:
    border-color 0.4s ease,
    box-shadow 0.4s ease;
}

.status-event-icon {
  font-size: 15px;
  font-weight: 800;
  color: var(--status-color, #22c55e);
  line-height: 1;
}

.status-event-title {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  text-shadow: 0 0 12px var(--status-color, #22c55e);
}

.status-event-message {
  font-family: "Outfit", sans-serif;
  font-size: 12px;
  color: #e2f9ee;
  max-width: 480px;
  text-align: center;
  padding: 4px 14px;
  border-radius: 12px;
  background: #030a06;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(6px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  opacity: 0.95;
}

.status-event-message:empty {
  display: none;
}

/* Dormant Resting Orb Callout */
.dormant-callout {
  position: fixed;
  bottom: 28px;
  right: 120px;
  left: auto;
  transform: none;
  z-index: 910;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--mint);
  letter-spacing: 2px;
  text-transform: uppercase;
  background: rgba(10, 26, 19, 0.7);
  border: 1px solid rgba(143, 232, 192, 0.25);
  padding: 6px 18px;
  border-radius: 20px;
  backdrop-filter: blur(10px);
  pointer-events: none;
  transition: opacity 0.3s;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.hologram-stage.is-speaking .dormant-callout,
.hologram-stage.is-transitioning .dormant-callout {
  opacity: 0 !important;
  display: none !important;
}

@media (max-width: 768px) {
  .dormant-callout {
    display: none !important;
  }

  .reason-banner {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: calc(100vw - 32px);
    max-width: 380px;
    padding: 10px 14px 12px;
    border-radius: 14px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
  }

  .reason-banner.visible {
    max-height: 140px;
    margin-top: 10px;
    padding: 10px 14px 12px;
  }

  .reason-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  .reason-tag {
    font-size: 8.5px;
    letter-spacing: 0.8px;
    padding: 2.5px 6px;
    border-radius: 4px;
  }

  .reason-phase-counter {
    display: inline-block;
  }

  .reason-text-wrap {
    width: 100%;
    min-width: 0;
  }

  .reason-text {
    display: block;
    font-size: 11.5px;
    line-height: 1.42;
    text-align: left;
    width: 100%;
    word-break: break-word;
  }

  .reason-phase-bar {
    display: block;
  }

  .reason-banner.warning .reason-phase-bar {
    background: #f97316;
    box-shadow: 0 0 6px #f97316;
  }

  .reason-banner.error .reason-phase-bar {
    background: #ef4444;
    box-shadow: 0 0 6px #ef4444;
  }

  /* Stage Top HUD on mobile: pinned to top-left with only the green pulse orb */
  .stage-top-hud {
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    right: auto !important;
    width: auto !important;
    z-index: 1002 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .state-pill.speaking .state-dot,
  .hologram-stage.is-speaking .state-pill .state-dot {
    width: 12px !important;
    height: 12px !important;
  }

  /* ESC button on mobile: shifted to top right, shortened to only ESC */
  .esc-return-hint {
    position: fixed !important;
    top: 12px !important;
    right: 12px !important;
    left: auto !important;
    z-index: 1002 !important;
    padding: 5px 10px !important;
    border-radius: 12px !important;
    font-size: 11px !important;
    gap: 0 !important;
    background: rgba(10, 26, 19, 0.9) !important;
    border: 1px solid rgba(0, 255, 170, 0.4) !important;
    box-shadow:
      0 4px 16px rgba(0, 0, 0, 0.7),
      0 0 10px rgba(0, 255, 170, 0.25) !important;
  }

  .esc-return-hint .esc-text {
    display: none !important;
  }

  .esc-return-hint .esc-kbd {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    color: var(--mint-bright) !important;
    font-family: "JetBrains Mono", monospace !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    letter-spacing: 1px !important;
  }

  /* Stage Bottom HUD on mobile: smaller, one in left, other in right */
  .stage-bottom-hud {
    position: fixed !important;
    bottom: 10px !important;
    left: 10px !important;
    right: 10px !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 915 !important;
    box-sizing: border-box !important;
    gap: 8px !important;
  }

  .stage-bottom-hud .meter-container {
    padding: 3px 8px !important;
    border-radius: 10px !important;
    font-size: 9.5px !important;
    gap: 5px !important;
    background: rgba(4, 18, 12, 0.85) !important;
    border: 1px solid rgba(143, 232, 192, 0.22) !important;
    backdrop-filter: blur(8px) !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
  }

  .meter-label-full {
    display: none !important;
  }

  .meter-label-short {
    display: inline !important;
    font-weight: 700 !important;
    color: var(--text-muted) !important;
  }

  .rms-bar {
    width: 36px !important;
    height: 5px !important;
  }

  .meter-right .active-word-snippet {
    display: none !important;
  }
}

/* Floating Confirmation Toast */
.confirm-toast {
  position: fixed;
  top: 55px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px) scale(0.95);
  z-index: 935;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2.5px;
  color: #ffffff;
  background: #051a10;
  background-image: linear-gradient(180deg, #092617 0%, #03120b 100%);
  border: 1px solid var(--mint-bright);
  box-shadow: 0 0 28px rgba(0, 255, 170, 0.55);
  padding: 7px 22px;
  border-radius: 20px;
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
  text-transform: uppercase;
}

.confirm-toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

/* Stage Telemetry Header */
.stage-top-hud {
  position: fixed;
  top: 14px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 915;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.hologram-stage.is-speaking .stage-top-hud {
  opacity: 1;
  pointer-events: auto;
}

/* Stage Telemetry Bottom HUD (Down Left & Down Right) */
.stage-bottom-hud {
  position: fixed;
  bottom: 14px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 915;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

.hologram-stage.is-speaking .stage-bottom-hud,
.hologram-stage:not(.is-dormant) .stage-bottom-hud {
  opacity: 1;
  pointer-events: auto;
}

.hologram-stage.is-dormant .stage-top-hud,
.hologram-stage.is-dormant .stage-bottom-hud {
  opacity: 0 !important;
  pointer-events: none !important;
}

.stage-bottom-hud .meter-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(4, 18, 12, 0.78);
  padding: 5px 12px;
  border-radius: 14px;
  border: 1px solid rgba(143, 232, 192, 0.25);
  backdrop-filter: blur(8px);
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.meter-label-full {
  display: inline;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.meter-label-short {
  display: none;
}

.rms-bar {
  width: 80px;
  height: 8px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid rgba(143, 232, 192, 0.3);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.7);
  position: relative;
  display: block;
}

.rms-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #1d7c57 0%, var(--mint-bright) 100%);
  box-shadow: 0 0 10px var(--mint-bright);
  transition: width 0.04s ease-out;
  border-radius: 3px;
}

#rmsValue {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  font-size: 11px;
  color: var(--mint-bright);
  min-width: 34px;
  text-align: right;
  display: inline-block;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 20px;
  background: rgba(143, 232, 192, 0.15);
  border: 1px solid var(--border-glow);
  font-weight: 700;
  color: var(--mint);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  transition: all 0.2s;
}

/* When speaking, remove that Speaking pill container and text  Eshow ONLY the glowing green pulse orb */
.state-pill.speaking,
.hologram-stage.is-speaking .state-pill {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.state-pill.speaking #stateText,
.hologram-stage.is-speaking .state-pill #stateText {
  display: none !important;
}

.state-pill.dormant {
  background: rgba(143, 232, 192, 0.08);
  border-color: rgba(143, 232, 192, 0.2);
  color: var(--text-muted);
}

.state-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

/* Glowing green pulse orb for active speaking mode */
.state-pill.speaking .state-dot,
.hologram-stage.is-speaking .state-pill .state-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    #ffffff 15%,
    var(--mint-bright) 65%,
    #00ffa2 100%
  );
  box-shadow:
    0 0 10px var(--mint-bright),
    0 0 22px rgba(0, 255, 170, 0.85),
    0 0 35px rgba(0, 255, 170, 0.45);
  animation: greenPulseOrb 1.1s infinite ease-in-out;
  position: relative;
}

.state-pill.speaking .state-dot::before,
.hologram-stage.is-speaking .state-pill .state-dot::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1.5px solid var(--mint-bright);
  opacity: 0.8;
  animation: greenOrbAura 1.4s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

@keyframes greenPulseOrb {
  0%,
  100% {
    transform: scale(0.92);
    box-shadow:
      0 0 8px var(--mint-bright),
      0 0 18px rgba(0, 255, 170, 0.65);
    opacity: 0.88;
  }
  50% {
    transform: scale(1.28);
    box-shadow:
      0 0 16px var(--mint-bright),
      0 0 30px rgba(0, 255, 170, 0.95),
      0 0 45px rgba(0, 255, 170, 0.5);
    opacity: 1;
  }
}

@keyframes greenOrbAura {
  0% {
    transform: scale(0.7);
    opacity: 0.9;
  }
  100% {
    transform: scale(2.2);
    opacity: 0;
  }
}

/* =========================================================================
   ARYA AI: Viewport Floating Orb & Fullscreen Transition Styles
   ========================================================================= */

/* Fullscreen Black Transition Pulse Veil */
.fullscreen-black-transition {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 902;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at var(--pulse-x, 50%) var(--pulse-y, 50%),
    #010403 0%, #000000 100%
  );
  transition: opacity 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  backdrop-filter: blur(12px);
}

.fullscreen-black-transition.active {
  opacity: 1;
  pointer-events: auto;
}

/* BTU Wave Mask: Synchronously unmasks/erases black veil outward from docked position in sync with BTU wave */
.fullscreen-black-transition.btu-dissolving {
  opacity: 1 !important;
  pointer-events: none;
  transition: none !important;
  -webkit-mask-image: radial-gradient(
    circle at var(--pulse-x, 50%) var(--pulse-y, 50%),
    transparent 0px,
    transparent var(--btu-wave-radius, 0px),
    rgba(0, 0, 0, 0.45) calc(var(--btu-wave-radius, 0px) + 24px),
    rgba(0, 0, 0, 1) calc(var(--btu-wave-radius, 0px) + 60px)
  );
  mask-image: radial-gradient(
    circle at var(--pulse-x, 50%) var(--pulse-y, 50%),
    transparent 0px,
    transparent var(--btu-wave-radius, 0px),
    rgba(0, 0, 0, 0.45) calc(var(--btu-wave-radius, 0px) + 24px),
    rgba(0, 0, 0, 1) calc(var(--btu-wave-radius, 0px) + 60px)
  );
}

/* Floating Draggable Orb Handle (Hit target for mouse / touch) */
.dormant-orb-handle {
  position: fixed;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  z-index: 999;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease-out;
}

.hologram-stage.is-speaking .dormant-orb-handle,
.hologram-stage.is-transitioning .dormant-orb-handle {
  display: none !important;
  pointer-events: none !important;
}

.dormant-orb-handle:active {
  cursor: grabbing;
}

.dormant-orb-handle::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(143, 232, 192, 0.35);
  opacity: 0;
  transition:
    opacity 0.25s,
    transform 0.25s;
  pointer-events: none;
}

.dormant-orb-handle:hover::after {
  opacity: 1;
  transform: scale(1.08);
  border-color: var(--mint-bright);
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.4);
}

/* Escape Key Return Hint Chip */
.esc-return-hint {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 1001;
  background: rgba(10, 26, 19, 0.85);
  border: 1px solid rgba(143, 232, 192, 0.3);
  border-radius: 20px;
  padding: 8px 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--mint);
  backdrop-filter: blur(12px);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    opacity 0.3s ease,
    transform 0.3s ease,
    background 0.2s,
    border-color 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.esc-return-hint.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.esc-return-hint:hover {
  background: rgba(143, 232, 192, 0.2);
  border-color: var(--mint-bright);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(0, 255, 170, 0.35);
}

.esc-kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* Gear Icon Button in Top Header */
.gear-icon-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(143, 232, 192, 0.25);
  border-radius: 12px;
  padding: 7px 11px;
  cursor: pointer;
  color: var(--mint);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gear-icon-btn:hover {
  background: rgba(143, 232, 192, 0.15);
  border-color: var(--mint-bright);
  color: #ffffff;
  box-shadow: 0 0 14px rgba(0, 255, 170, 0.3);
}

.gear-icon-btn svg {
  transition: transform 0.4s ease;
}

.gear-icon-btn:hover svg {
  transform: rotate(60deg);
}

/* Settings Modal Backdrop & Dialog */
.settings-modal-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(2, 6, 4, 0.82);
  backdrop-filter: blur(14px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.settings-modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.settings-modal {
  background: rgba(10, 26, 19, 0.95);
  border: 1px solid rgba(143, 232, 192, 0.35);
  border-radius: 24px;
  width: 540px;
  max-width: 92vw;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.8),
    0 0 40px rgba(0, 255, 170, 0.15);
  padding: 24px 28px;
  transform: scale(0.94);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
  color: var(--text-main);
}

.settings-modal-backdrop.open .settings-modal {
  transform: scale(1);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(143, 232, 192, 0.15);
  margin-bottom: 20px;
}

.settings-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1.5px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.settings-close-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-close-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #ef4444;
  color: #ffffff;
}

.settings-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.setting-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-row-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  color: var(--mint);
  letter-spacing: 1px;
  display: flex;
  justify-content: space-between;
}

.setting-row-ctrl {
  display: flex;
  gap: 10px;
  align-items: center;
}

.setting-slider {
  flex: 1;
  accent-color: var(--mint-bright);
}

.setting-manifested-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(143, 232, 192, 0.2);
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.5;
  color: #e2fdf1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-manifested-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1.5px;
  font-weight: 700;
}

.setting-action-btn {
  background: rgba(143, 232, 192, 0.12);
  border: 1px solid var(--mint);
  color: var(--mint-bright);
  font-family: "Outfit", sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
}

.setting-action-btn:hover {
  background: var(--mint-bright);
  color: #04120a;
  box-shadow: 0 0 16px rgba(0, 255, 170, 0.45);
}

/* Announcement Update Pulse Animation with Center Preservation */
@keyframes announcementUpdatePulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.02);
    opacity: 0.95;
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.overlay-content.announcement-updated {
  animation: announcementUpdatePulse 0.5s ease-out;
}
