/* Base Setup */
html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  /* Strictly prevent scrolling */
  position: fixed;
  /* Lock body in place to prevent rubber-banding */
}

body {
  background-color: #050510;
  display: flex;
  justify-content: center;
  align-items: center;
  /* UPDATED: Apple-style system font stack (San Francisco/SF Pro equivalent) */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
    "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
    sans-serif;
  touch-action: manipulation;
  /* Prevents double-tap zoom but allows scrolling in child elements */
}

/* PAGE PRELOADER */
#page-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #050510;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
}

#page-light-preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0000008f;
  z-index: 9999999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.loader-ring {
  width: 80px;
  height: 80px;
  border: 4px solid rgba(0, 234, 255, 0.2);
  border-top-color: #00eaff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow: 0 0 15px rgba(0, 234, 255, 0.2);
}

.loader-text {
  margin-top: 20px;
  font-size: 14px;
  color: #00eaff;
  letter-spacing: 4px;
  animation: blink 1s infinite;
  text-shadow: 0 0 10px #00eaff;
  text-transform: uppercase;
}

/* MODAL LOADER */
.modal-loader {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: none;
  /* Hidden by default */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(10, 15, 30, 0.95);
  /* Cover content */
  z-index: 50;
}

.modal-loader.active {
  display: flex;
}

.modal-content-wrapper {
  transition: opacity 0.3s ease;
}

.modal-content-wrapper.loading {
  opacity: 0;
  pointer-events: none;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.5;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Container for the entire widget */
.reactor-container {
  position: relative;
  width: 300px;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* ************************************** */
/* NEW: LAYERED BACKGROUND CHART STYLES   */
/* ************************************** */
#bg-chart-wrapper {
  position: fixed;
  top: 100px;
  left: 50%;
  width: 90%;
  height: 100px;
  z-index: 90;
  transform: translate(-50%);
  max-width: 500px;
  /* border: 1px solid #00eaff; */
  border-radius: 10px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.4),
    inset 0 0 10px rgba(0, 234, 255, 0.2);
  background: rgba(5, 20, 40, 0.3);
  overflow: hidden;
  /* NEW: Mask gradient for fade effect on the left edge */
  mask-image: linear-gradient(to right, transparent 0%, black 15%, black 100%);
  -webkit-mask-image: linear-gradient(
    to right,
    transparent 0%,
    black 15%,
    black 100%
  );
  /* filter: blur(1px); */
  /* -webkit-filter: blur(3px); */
}

.chart-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

#bg-layer-canvas {
  background: linear-gradient(to top, #00000000, #000000);
  filter: blur(2px) brightness(1.5);
  opacity: 0.6;
  z-index: 1;
}

#overlay-line-canvas {
  z-index: 2;
  opacity: 0.8;
}

#overlay-candle-canvas {
  z-index: 3;
  opacity: 0.9;
}

/* ************************************** */

/* NEW: FLOATING WHATSAPP BUTTON */
#whatsapp-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: #19723a;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4), 0 0 15px rgba(37, 211, 102, 0.6);
  cursor: pointer;
  z-index: 950;
  transition: transform 0.2s;
  font-size: 30px;
  color: white;
}

#whatsapp-btn:hover {
  transform: scale(1.1);
}

/* WHATSAPP MODAL LIST ITEM STYLES */
.group-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 234, 255, 0.1);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.15s;
}

.group-list-item:hover:not(.full) {
  background-color: rgba(0, 234, 255, 0.1);
}

.group-tag {
  font-size: 10px;
  padding: 3px 6px;
  border-radius: 4px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  pointer-events: none;
  /* Do not block clicks on parent */
}

.group-list-item.full {
  opacity: 0.5;
  cursor: not-allowed;
}

.group-list-item.full .group-tag {
  color: #ff003c;
  background-color: rgba(255, 0, 60, 0.1);
}

.group-list-item:not(.full) .group-tag {
  color: #00ff33;
  background-color: rgba(0, 255, 51, 0.1);
}

/* NEW: FLOATING FOREX CHART */
.forex-chart-overlay {
  position: absolute;
  /* Center vertically within .reactor-container */
  top: 50%;
  left: 50%;

  width: 350px;
  height: 150px;
  background: rgba(10, 20, 40, 0.8);
  border: 1px solid #00eaff;
  box-shadow: 0 0 15px rgba(0, 234, 255, 0.4);
  pointer-events: none;
  z-index: 30;
  opacity: 0;
  /* Use translate to center, and scale down for hidden state */
  transform: translate(-50%, -50%) scale(0.5);

  /* Smoother, more dramatic transition */
  transition: opacity 0.4s ease,
    transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

  clip-path: polygon(
    0 15px,
    15px 0,
    100% 0,
    100% calc(100% - 15px),
    calc(100% - 15px) 100%,
    0 100%
  );
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.forex-chart-overlay.visible {
  opacity: 1;
  /* Center and normal size */
  transform: translate(-50%, -50%) scale(1);
}

.chart-title {
  color: #fff;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  padding: 5px 0 0 0;
  text-shadow: 0 0 5px #00eaff;
}

#forex-canvas {
  width: 100%;
  height: 120px;
  margin: 5px;
}

@media (max-width: 600px) {
  .forex-chart-overlay {
    width: 90vw;
    height: 120px;
  }
}

/* * HEADER BAR */
.header-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 100;
  pointer-events: none;
  /* Let clicks pass through empty space */
}

.header-left,
.header-right {
  pointer-events: auto;
  /* Re-enable clicks for buttons */
  display: flex;
  gap: 15px;
  align-items: center;
}

/* * BACKGROUND ROTATORS */
.bg-rotator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 8;
  opacity: 1;
}

.bg-1 {
  width: 400px;
  height: 400px;
  border: 80px dashed #ffe000;
  filter: blur(19px);
  animation: spin-centered-right 60s linear infinite;
  opacity: 0.2;
}

.bg-2 {
  width: 650px;
  height: 650px;
  border: 40px solid rgba(174, 0, 255, 0.05);
  border-top-color: rgb(184 255 247 / 15%);
  border-bottom-color: rgba(174, 0, 255, 0.15);
  filter: blur(15px);
  animation: spin-centered-left 10s linear infinite;
}

.bg-3 {
  width: 1000px;
  height: 1000px;
  background: conic-gradient(
    from 0deg,
    transparent 0%,
    rgb(0 84 255 / 21%) 20%,
    transparent 40%,
    rgb(255 173 0 / 19%) 60%,
    transparent 80%
  );
  filter: blur(30px);
  animation: spin-centered-right 40s linear infinite;
  opacity: 1;
}

/* * RINGS */
/* Outer Ring (Cyan) */
.ring-outer {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    transparent 0deg,
    transparent 10deg,
    #00eaff 10deg,
    #00eaff 100deg,
    transparent 100deg,
    transparent 130deg,
    #00eaff 130deg,
    #00eaff 220deg,
    transparent 220deg,
    transparent 250deg,
    #00eaff 250deg,
    #00eaff 340deg,
    transparent 340deg
  );
  -webkit-mask: radial-gradient(transparent 62%, black 63%);
  mask: radial-gradient(transparent 62%, black 63%);

  filter: drop-shadow(0 0 2px rgba(0, 234, 255, 0.5));
  opacity: 0.15;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: spin-right 8s linear infinite;
  z-index: 1;
}

.ring-outer.active {
  opacity: 1;
  filter: drop-shadow(0 0 8px #00eaff) drop-shadow(0 0 15px #00eaff);
}

/* Inner Ring (Red) */
.ring-inner {
  position: absolute;
  width: 75%;
  height: 75%;
  border-radius: 50%;
  background: conic-gradient(
    transparent 0deg,
    transparent 20deg,
    #ff003c 20deg,
    #ff003c 110deg,
    transparent 110deg,
    transparent 140deg,
    #ff003c 140deg,
    #ff003c 230deg,
    transparent 230deg,
    transparent 260deg,
    #ff003c 260deg,
    #ff003c 350deg,
    transparent 350deg
  );
  -webkit-mask: radial-gradient(transparent 60%, black 61%);
  mask: radial-gradient(transparent 60%, black 61%);

  filter: drop-shadow(0 0 2px rgba(255, 0, 60, 0.5));
  opacity: 0.15;
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  animation: spin-left 6s linear infinite;
  z-index: 2;
}

.ring-inner.active {
  opacity: 1;
  filter: drop-shadow(0 0 8px #ff003c) drop-shadow(0 0 15px #ff003c);
}

/* HEALTHY STATE (Green override) */
.ring-inner.healthy {
  background: conic-gradient(
    transparent 0deg,
    transparent 20deg,
    #00ff33 20deg,
    #00ff33 110deg,
    transparent 110deg,
    transparent 140deg,
    #00ff33 140deg,
    #00ff33 230deg,
    transparent 230deg,
    transparent 260deg,
    #00ff33 260deg,
    #00ff33 350deg,
    transparent 350deg
  );
  filter: drop-shadow(0 0 8px #00ff33) drop-shadow(0 0 15px #00ff33);
}

/* * CORE BUTTON */
.core-btn {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #5a7da5, #2a3d55);
  border: 4px solid #8cabcd;
  color: #fff;
  font-size: 24px;
  font-weight: bold;
  letter-spacing: 2px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  justify-content: center;
  align-items: center;
  text-shadow: 0 0 5px #fff, 0 0 10px #00eaff;
  box-shadow: inset 0 0 20px rgba(0, 234, 255, 0.3),
    0 0 15px rgba(90, 125, 165, 0.6);
  transition: all 0.3s ease;
  user-select: none;
  text-transform: uppercase;
}

.core-btn:hover {
  box-shadow: inset 0 0 30px rgba(0, 234, 255, 0.5),
    0 0 25px rgba(0, 234, 255, 0.6);
  border-color: #bdeeff;
  text-shadow: 0 0 10px #fff, 0 0 20px #00eaff;
  transform: scale(1.05);
}

.core-btn:active {
  transform: scale(0.95);
}

.core-btn.active {
  background: radial-gradient(circle at 30% 30%, #ff2a2a, #550000);
  border-color: #ff8c8c;
  text-shadow: 0 0 10px #fff, 0 0 20px #ff003c;
  box-shadow: inset 0 0 30px rgba(255, 0, 60, 0.5),
    0 0 40px rgba(255, 0, 60, 0.6);
}

.core-btn.healthy {
  background: radial-gradient(circle at 30% 30%, #2aff2a, #005500) !important;
  border-color: #8cff8c !important;
  text-shadow: 0 0 10px #fff, 0 0 20px #00ff33 !important;
  box-shadow: inset 0 0 30px rgba(42, 255, 42, 0.5),
    0 0 40px rgba(42, 255, 42, 0.6) !important;
}

/* * GHOST RINGS */
.ghost-ring {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.8s ease-in-out;
  z-index: 0;
  pointer-events: none;
  mix-blend-mode: screen;
}

.ghost-ring.visible {
  opacity: 0.6;
}

.ghost-1 {
  width: 130%;
  height: 130%;
  background: conic-gradient(
    transparent 0deg,
    #ff9d00 45deg,
    transparent 80deg,
    transparent 180deg,
    #ff00ea 225deg,
    transparent 270deg
  );
  -webkit-mask: radial-gradient(transparent 65%, black 66%);
  mask: radial-gradient(transparent 65%, black 66%);
  filter: blur(8px);
  animation: spin-left 3s linear infinite;
}

.ghost-2 {
  width: 115%;
  height: 115%;
  background: conic-gradient(
    transparent 100deg,
    #ae00ff 140deg,
    transparent 180deg,
    transparent 280deg,
    #ae00ff 320deg,
    transparent 360deg
  );
  -webkit-mask: radial-gradient(transparent 68%, black 69%);
  mask: radial-gradient(transparent 68%, black 69%);
  filter: blur(4px);
  animation: spin-right 2s linear infinite;
}

.ghost-3 {
  width: 140%;
  height: 140%;
  background: conic-gradient(
    transparent 0deg,
    rgba(255, 255, 255, 0.8) 10deg,
    transparent 15deg
  );
  -webkit-mask: radial-gradient(transparent 70%, black 71%);
  mask: radial-gradient(transparent 70%, black 71%);
  filter: blur(2px);
  animation: spin-right 0.5s linear infinite;
  opacity: 0;
}

.ghost-3.visible {
  opacity: 0.15;
}

.ghost-4 {
  width: 55%;
  height: 55%;
  background: conic-gradient(
    transparent 0deg,
    #ffffff 20deg,
    transparent 40deg,
    transparent 180deg,
    #ff00ea 200deg,
    transparent 220deg
  );
  -webkit-mask: radial-gradient(transparent 50%, black 60%);
  mask: radial-gradient(transparent 50%, black 60%);
  filter: drop-shadow(0 0 10px #ff00ea) blur(4px);
  animation: spin-right 1s linear infinite;
  z-index: 5;
}

.ring-decoration {
  position: absolute;
  width: 170px;
  height: 170px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  z-index: 5;
  animation: spin-slow 20s linear infinite;
  pointer-events: none;
}

/* * STATUS OVERLAY */
.status-svg {
  position: absolute;
  width: 400px;
  height: 400px;
  top: -50px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.status-svg.visible {
  opacity: 1;
}

.status-path-text {
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 4px;
  fill: transparent;
  text-transform: uppercase;
}

/* * HUD CONTAINERS & BOXES */
.hud-container-top {
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  z-index: 25;
  pointer-events: none;
  width: 400px;
  max-width: 90%;
  /* Responsive width */
}

.hud-container-bottom {
  position: absolute;
  bottom: -120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 15px;
  z-index: 25;
  pointer-events: none;
  width: max-content;
  /* max-width: 100%; */
  flex-wrap: wrap;

  /* Responsive width */
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: auto;
  position: relative;
  max-width: 100%;
  /* Ensure row fits in container */
}

.hud-label {
  font-size: 10px;
  color: #97f6ff;
  letter-spacing: 2px;
  opacity: 0.8;
  text-shadow: 0 0 5px #00eaff;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 2px;
  text-align: center;
  width: 100%;
}

.balance-box {
  background: rgba(5, 20, 40, 0.9);
  border: 1px solid #00eaff;
  padding: 8px 15px;
  /* min-width: 30px; */
  /* Preferred width */
  /* min-width: 0; */
  /* Allow shrinking below content size */
  max-width: 100%;
  /* Prevent overflow */
  text-align: center;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 1px;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.2),
    inset 0 0 15px rgba(0, 234, 255, 0.1);
  position: relative;
  clip-path: polygon(
    10px 0,
    100% 0,
    100% calc(100% - 10px),
    calc(100% - 10px) 100%,
    0 100%,
    0 10px
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.balance-box.bonus {
  border-color: #d400ff;
  background: rgba(20, 5, 30, 0.9);
  box-shadow: 0 0 10px rgba(212, 0, 255, 0.2),
    inset 0 0 15px rgba(212, 0, 255, 0.1);
}

.balance-box.bonus .hud-label {
  color: #d400ff;
  text-shadow: 0 0 5px #d400ff;
}

/* Pulse effect */
.balance-box.pulse {
  transform: scale(1.05);
  filter: drop-shadow(0 0 15px #00ff33);
  transition: transform 0.1s;
}

.balance-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  border-top: 2px solid rgba(255, 255, 255, 0.8);
  border-left: 2px solid rgba(255, 255, 255, 0.8);
}

.balance-box::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 6px;
  height: 6px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.8);
  border-right: 2px solid rgba(255, 255, 255, 0.8);
}

/* NEW: SUB BALANCE (ZAR DISPLAY) */
.sub-balance {
  font-size: 14px;
  color: rgb(255 201 122);
  margin-top: 2px;
  font-weight: normal;
  letter-spacing: 0;
  font-weight: bold;
}

/* HUD Buttons */
.hud-btn {
  background: rgba(0, 234, 255, 0.1);
  border: 1px solid #00eaff;
  color: #00eaff;
  font-family: inherit;
  font-size: 10px;
  font-weight: bold;
  padding: 8px 12px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
  pointer-events: auto;
  clip-path: polygon(
    5px 0,
    100% 0,
    100% calc(100% - 5px),
    calc(100% - 5px) 100%,
    0 100%,
    0 5px
  );
}

.hud-btn:hover {
  background: #00eaff;
  color: #000;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.6);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* Catchy Add Credits Button - Bigger and Metallic Shiny */
.hud-btn.catchy {
  /* Bigger Size */
  padding: 12px 24px;
  font-size: 14px;
  letter-spacing: 2px;
  font-weight: 900;

  /* Metallic Gold Gradient Background */
  background: linear-gradient(
    to bottom,
    #ffec8b 0%,
    #ffebc1 50%,
    #ffc447 51%,
    #ffec8b 100%
  );
  /* font-weight: bold !important; */
  border: 2px solid #ffae00;
  color: #523a00;
  /* Darker color for contrast on gold */

  /* Metallic Shine and Glow */
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 174, 0, 0.6),
    0 0 20px rgba(255, 174, 0, 0.4);

  text-shadow: 0 1px 10px rgb(0 0 0 / 50%);
  animation: pulse-metallic-gold 3s infinite;
  /* font-family: sans-serif; */
  font-size: clamp(1vw, 3.5vw, 17px);
}

.hud-btn.catchy:hover {
  /* Brighter on hover */
  background: linear-gradient(
    to bottom,
    #fff2a0 0%,
    #ffbe3d 50%,
    #e6a800 51%,
    #fff2a0 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 0 15px rgba(255, 174, 0, 0.8),
    0 0 30px rgba(255, 174, 0, 0.6);
  transform: scale(1.05);
  color: #3b2a00;
}

@keyframes pulse-metallic-gold {
  0% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 174, 0, 0.6),
      0 0 20px rgba(255, 174, 0, 0.4);
  }

  50% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 174, 0, 0.8),
      0 0 35px rgba(255, 174, 0, 0.6);
    border-color: #fffbe6;
  }

  100% {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6),
      inset 0 -1px 0 rgba(0, 0, 0, 0.2), 0 0 10px rgba(255, 174, 0, 0.6),
      0 0 20px rgba(255, 174, 0, 0.4);
  }
}

/* Menu Button */
.menu-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #00eaff;
  width: 40px;
  height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.3s;
  clip-path: polygon(
    5px 0,
    100% 0,
    100% calc(100% - 5px),
    calc(100% - 5px) 100%,
    0 100%,
    0 5px
  );
}

.menu-btn:hover {
  background: #00eaff;
  box-shadow: 0 0 15px #00eaff;
}

.menu-btn .bar {
  width: 20px;
  height: 2px;
  background-color: #00eaff;
  transition: all 0.3s;
}

.menu-btn:hover .bar {
  background-color: #000;
}

.hud-btn.bonus-btn {
  border-color: #d400ff;
  color: #f5c5ff;
  background: rgba(212, 0, 255, 0.1);
}

.hud-btn.bonus-btn:hover {
  background: #d400ff;
  color: #fff;
  box-shadow: 0 0 10px rgba(212, 0, 255, 0.6);
}

.balance-delta {
  position: absolute;
  right: -60px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
}

.balance-delta.positive {
  color: #00ff33;
  text-shadow: 0 0 5px #00ff33;
  transform: translateY(-50%) translateX(0);
}

/* * LASER ENERGY */
.energy-beam {
  position: absolute;
  width: 3px;
  height: 50px;
  background: linear-gradient(to top, transparent, #00ff33, #ccffdd);
  filter: blur(2px) drop-shadow(0 0 8px #00ff33);
  opacity: 0;
  z-index: 15;
  pointer-events: none;
  top: 50%;
  left: 50%;
  transform-origin: bottom center;
}

@keyframes shoot-up {
  0% {
    transform: translate(-50%, 0) scaleY(0.2);
    opacity: 0;
    top: 40%;
  }

  20% {
    opacity: 1;
    transform: translate(-50%, 0) scaleY(1.5);
  }

  100% {
    transform: translate(-50%, 0) scaleY(0.5);
    opacity: 0;
    top: -180px;
  }
}

/* * GLASSY MODAL */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 17%);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.modal-overlay.visible {
  opacity: 1;
  pointer-events: all;
}

.glass-panel {
  background: rgba(10, 15, 30, 0.85);
  backdrop-filter: blur(15px);
  border: 1px solid #00eaff;
  box-shadow: 0 0 30px rgba(0, 234, 255, 0.1),
    inset 0 0 20px rgba(0, 234, 255, 0.05);
  padding: 20px;
  width: 320px;
  text-align: center;
  color: #00eaff;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

/* Specific Width for larger modals */
.glass-panel.wide {
  width: 450px;
}

/* Red variation for failure */
.glass-panel.failure {
  background: rgba(20, 0, 10, 0.75);
  border: 1px solid rgba(255, 0, 60, 0.5);
  box-shadow: 0 0 30px rgba(255, 0, 60, 0.2),
    inset 0 0 20px rgba(255, 0, 60, 0.1);
  color: #ff003c;
}

/* Green variation for successful trade status */
.glass-panel.success {
  background: rgba(5, 30, 10, 0.85);
  border: 1px solid #00ff33;
  box-shadow: 0 0 30px rgba(0, 255, 51, 0.2),
    inset 0 0 20px rgba(0, 255, 51, 0.1);
  color: #00ff33;
}

.modal-overlay.visible .glass-panel {
  transform: scale(1);
}

.glass-panel::before,
.glass-panel::after {
  content: "";
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid inherit;
  transition: all 0.3s;
  border-color: inherit;
}

.glass-panel::before {
  top: -2px;
  left: -2px;
  border-right: none;
  border-bottom: none;
}

.glass-panel::after {
  bottom: -2px;
  right: -2px;
  border-left: none;
  border-top: none;
}

.modal-title {
  font-size: 20px;
  font-weight: bold;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 0 10px currentColor;
}

.modal-message {
  font-size: 14px;
  line-height: 1.5;
  color: rgb(184 184 184 / 80%);
  margin-bottom: 25px;
}

/* SCIFI INPUTS */
.scifi-input {
  display: block;
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid #00eaff;
  padding: 10px;
  margin-bottom: 15px;
  color: #fff;
  font-family: inherit;
  text-align: center;
  letter-spacing: 1px;
  box-sizing: border-box;
}

.scifi-input:focus {
  outline: none;
  background: rgba(0, 234, 255, 0.1);
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.3);
}

.scifi-input.readonly {
  background: rgba(0, 234, 255, 0.05);
  border-color: rgba(0, 234, 255, 0.3);
  color: rgba(0, 234, 255, 0.8);
}

/* SCROLLABLE LISTS */
.scroll-list {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: 20px;
  border: 1px solid rgba(0, 234, 255, 0.2);
  padding: 5px;
  background: rgba(0, 0, 0, 0.2);
  /* Ensure touch scrolling works inside modals despite body lock */
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

/* Custom Scrollbar */
.scroll-list::-webkit-scrollbar {
  width: 6px;
}

.scroll-list::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.scroll-list::-webkit-scrollbar-thumb {
  background: #00eaff;
  border-radius: 3px;
}

.list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid rgba(0, 234, 255, 0.1);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.list-item:last-child {
  border-bottom: none;
}

.list-item span.green {
  color: #00ff33;
}

.list-item span.red {
  color: #ff003c;
}

.list-item span.dim {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
}

/* BUTTONS */
.modal-btn {
  background: rgba(0, 234, 255, 0.1);
  border: 1px solid currentColor;
  color: inherit;
  padding: 10px 20px;
  font-family: inherit;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
  width: 100%;
}

.modal-btn:hover {
  background: black;
  color: #d1d1d1;
  box-shadow: 0 0 15px currentColor;
}

.modal-btn.selected {
  background: #00eaff;
  color: #000;
  box-shadow: 0 0 10px #00eaff;
}

.modal-btn.small {
  width: auto;
  flex: 1;
  padding: 8px 5px;
  font-size: 12px;
}

.modal-btn.cancel {
  border-color: #ff003c;
  color: #ff003c;
  margin-top: 5px;
  opacity: 0.8;
  background: transparent;
}

.modal-btn.cancel:hover {
  background: #ff003c;
  color: #fff;
  box-shadow: 0 0 15px #ff003c;
  opacity: 1;
}

/* DETAILS ROW STYLING */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(0, 234, 255, 0.3);
  padding: 10px;
  margin-bottom: 8px;
  text-align: left;
}

.detail-info {
  flex: 1;
  min-width: 0;
  /* Allow truncation */
  margin-right: 10px;
}

.detail-label {
  font-size: 9px;
  color: rgba(0, 234, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.detail-value {
  font-size: 12px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* REVERTED FONT-FAMILY TO INHERIT FOR SAN-SERIF */
  font-family: inherit;
}

.copy-btn-small {
  background: transparent;
  border: 1px solid #00eaff;
  color: #00eaff;
  padding: 5px 8px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.2s;
  flex-shrink: 0;
}

.copy-btn-small:hover {
  background: #00eaff;
  color: #000;
}

/* ************************************** */
/* NEW TOASTER/CONSOLE STYLES (REPLACEMENT) */
/* ************************************** */

#toaster-container {
  position: fixed;
  bottom: 30px;
  right: 20px;
  z-index: 900;
  /* Below modals, above HUD */
  display: flex;
  flex-direction: column-reverse;
  /* New toasts appear on top */
  gap: 10px;
  max-height: 90vh;
  max-width: 90vw;
  overflow: hidden;
  pointer-events: none;
  /* Let clicks pass through empty space */
  align-items: flex-end;
  pointer-events: none;
}

.toast {
  width: 300px;
  max-width: 90vw;
  background: rgb(24 47 16 / 90%);
  backdrop-filter: blur(5px);
  border: 1px solid #588152;
  box-shadow: 0 0 10px rgba(0, 234, 255, 0.4);
  padding: 10px 15px;
  color: #ff9c9c;
  font-size: 12px;
  letter-spacing: 1px;
  pointer-events: auto;
  /* Re-enable clicks on the toast */
  position: relative;
  /* Animation properties */
  transform: translateY(150%);
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.19, 1, 0.22, 1),
    opacity 0.5s ease-out;
  border-radius: 5px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Small diagonal slice to give it a sci-fi look */
.toast::before {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  border-top: 5px solid transparent;
  border-right: 5px solid #00ffe8;
}

.toast-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  color: #c5ffae;
}

.toast-icon {
  font-size: 10px;
  line-height: 1;
  margin-right: 8px;
  color: #ddffcf;
  animation: blink 1s infinite;
}

.toast-title {
  font-size: 9px;
  /* text-transform: uppercase; */
  letter-spacing: 2px;
  opacity: 0.8;
  font-weight: bold;
}

.toast-time {
  margin-left: auto;
  font-size: 8px;
  opacity: 0.5;
}

.toast-body {
  /* Kept monospace for terminal aesthetic */
  font-family: monospace;
  font-size: 11px;
  line-height: 1.4;
  color: rgb(200 251 255);
}

.toast-body .highlight {
  color: #d0f5ff;
  text-shadow: 0 0 5px #00eaff;
}

@media (max-width: 600px) {
  #toaster-container {
    bottom: 10px;
    right: 10px;
  }

  .toast {
    width: calc(90vw - 90px);
  }
}

/* REVENUE STREAM LOG (KEPT, BUT MOVED Z-INDEX UP) */
.income-console {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 200px;
  height: 300px;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* Items stack at bottom */
  /* REVERTED FONT-FAMILY TO INHERIT FOR SAN-SERIF */
  font-family: inherit;
  z-index: 90;
  /* Fade mask at the top */
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
  mask-image: linear-gradient(to bottom, transparent 0%, black 40%);
  pointer-events: none;
}

.income-header {
  color: #ffae00;
  font-size: 12px;
  font-weight: bold;
  text-align: left;
  border-bottom: 1px solid rgba(255, 174, 0, 0.3);
  margin-bottom: 10px;
  padding-bottom: 5px;
  text-shadow: 0 0 5px #ffae00;
  width: 100%;
  opacity: 0.8;
}

.income-log-item {
  color: #ffae00;
  font-size: 11px;
  margin-bottom: 4px;
  text-shadow: 0 0 2px rgba(255, 174, 0, 0.5);
  animation: slideInLeft 0.3s ease-out;
  white-space: nowrap;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Animations */
@keyframes spin-right {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin-left {
  100% {
    transform: rotate(-360deg);
  }
}

@keyframes spin-slow {
  100% {
    transform: rotate(360deg);
  }
}

@keyframes spin-centered-right {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

@keyframes spin-centered-left {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(-360deg);
  }
}

/* REMOVED .overlay STYLES */

.btn-red {
  font-weight: bold;
  font-size: 15px;
}

.highlight-border {
  border-color: #f6d247;
}

.btn-success {
  border-color: #53c332;
  color: #54c977;
  background: #1a271a;
}

.btn-success:hover {
  background: #1a271a;
  border-color: #53c332;
  color: #54c977;
}

#payfast_div_container {
  z-index: 99999999999999;
}
