/* Σταματάς ή Συνεχίζεις; — AAA Resource Tension polish.
 * Scoped to .chaos-quit-or-push.chaos-energy-screen
 * Energy system hero, cinematic depth, no logic changes.
 * Respects prefers-reduced-motion, Greek fonts, accessibility.
 */

@media (prefers-reduced-motion: reduce) {
  .chaos-quit-or-push.chaos-energy-screen *,
  .chaos-quit-or-push.chaos-energy-screen *::before,
  .chaos-quit-or-push.chaos-energy-screen *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .chaos-quit-entry-overlay { display: none !important; }
}

/* A) Remove red/pink — cinematic gradient edge */
.chaos-quit-or-push.chaos-energy-screen .chaos-cinematic-content::after {
  background: linear-gradient(135deg, rgba(155, 93, 255, 0.6), rgba(255, 107, 157, 0.5), rgba(0, 212, 255, 0.5)) !important;
  background-size: 200% 100% !important;
  opacity: 0.7 !important;
  animation: quitBorderShimmer 14s linear infinite !important;
}

@keyframes quitBorderShimmer {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* B) Cinematic background — vignette + grain */
.chaos-quit-or-push.chaos-energy-screen {
  position: relative;
  overflow: hidden;
}

.chaos-quit-or-push.chaos-energy-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 80% at 50% 50%, transparent 40%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 0;
}

.chaos-quit-or-push.chaos-energy-screen::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.07'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
  animation: quitGrainFlicker 8s ease-in-out infinite;
}

@keyframes quitGrainFlicker {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.09; }
}

.chaos-quit-or-push.chaos-energy-screen > * {
  position: relative;
  z-index: 2;
}

/* Main panel — glassmorphism */
.chaos-quit-or-push.chaos-energy-screen .chaos-cinematic-content {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  border-radius: 18px;
  padding: 2rem 2.25rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* C) Title — AAA headline */
.chaos-quit-or-push.chaos-energy-screen .chaos-game-title.chaos-aaa-title {
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  background: linear-gradient(135deg, #b57dff 0%, #ff8fb3 40%, #6dd5ff 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 24px rgba(155, 93, 255, 0.4));
  animation: quitTitleShimmer 15s ease-in-out infinite;
}

@keyframes quitTitleShimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* G) Cinematic entry */
.chaos-quit-entry-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 100;
  pointer-events: none;
  animation: quitFadeFromBlack 300ms ease-out forwards;
}

@keyframes quitFadeFromBlack {
  to { opacity: 0; }
}

.chaos-quit-or-push.chaos-energy-screen .chaos-aaa-title { animation: quitEntryUp 0.4s ease-out 0ms both; }
.chaos-quit-or-push.chaos-energy-screen .chaos-aaa-narrative { animation: quitEntryUp 0.4s ease-out 80ms both; }
.chaos-quit-or-push.chaos-energy-screen .chaos-aaa-energy { animation: quitEntryUp 0.4s ease-out 160ms both; }
/* Choices revealed by JS after last line — no stagger to avoid conflict */

@keyframes quitEntryUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* D) Narrative typography */
.chaos-quit-or-push.chaos-energy-screen .chaos-cinematic-line {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #e8ecff;
  max-width: 560px;
  margin: 0.35rem auto;
}

/* Last line emphasis */
.chaos-quit-or-push.chaos-energy-screen .chaos-cinematic-line.chaos-emphasis-line {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-top: 0.75rem;
  padding: 0.75rem 1rem;
  background: linear-gradient(90deg, rgba(155, 93, 255, 0.12), transparent 60%);
  border-radius: 10px;
  border-left: 3px solid rgba(155, 93, 255, 0.5);
  animation: quitEmphasisFade 0.5s ease-out 150ms both;
}

@keyframes quitEmphasisFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* E) Energy HUD */
.chaos-quit-or-push.chaos-energy-screen .chaos-energy-container.chaos-aaa-energy {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 14px;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chaos-quit-or-push.chaos-energy-screen .chaos-energy-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.75rem;
}

/* Energy bar — base */
.chaos-quit-or-push.chaos-energy-screen .chaos-energy-bar {
  height: 28px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  overflow: visible;
}

.chaos-quit-or-push.chaos-energy-screen .chaos-energy-fill {
  border-radius: 14px;
  transition: width 0.5s ease-out;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Color shift by level — UI only */
.chaos-quit-or-push.chaos-energy-screen .chaos-energy-bar.energy-high .chaos-energy-fill {
  background: linear-gradient(90deg, #00d4ff 0%, #4a90e2 100%);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.chaos-quit-or-push.chaos-energy-screen .chaos-energy-bar.energy-mid .chaos-energy-fill {
  background: linear-gradient(90deg, #7a6bff 0%, #9b5dff 100%);
  box-shadow: 0 0 16px rgba(155, 93, 255, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.chaos-quit-or-push.chaos-energy-screen .chaos-energy-bar.energy-low .chaos-energy-fill {
  background: linear-gradient(90deg, #ff8fb3 0%, #ffb347 100%);
  box-shadow: 0 0 16px rgba(255, 143, 179, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Glowing cap + shimmer on fill */
.chaos-quit-or-push.chaos-energy-screen .chaos-energy-fill::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 8px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5));
  border-radius: 0 14px 14px 0;
  pointer-events: none;
}

.chaos-quit-or-push.chaos-energy-screen .chaos-energy-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  animation: quitEnergyShimmer 3s ease-in-out infinite;
}

@keyframes quitEnergyShimmer {
  0% { left: -100%; }
  100% { left: 150%; }
}

/* Energy row — value + elapsed timer (always visible) */
.chaos-quit-or-push.chaos-energy-screen .chaos-energy-row {
  display: flex !important;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
  gap: 1rem;
  min-height: 2rem;
  visibility: visible !important;
  opacity: 1 !important;
}
.chaos-quit-or-push.chaos-energy-screen .chaos-elapsed-timer {
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(125, 214, 255, 0.95);
  font-variant-numeric: tabular-nums;
  visibility: visible !important;
  opacity: 1 !important;
  text-shadow: 0 0 8px rgba(125, 214, 255, 0.5);
}
/* Energy value — HUD readout */
.chaos-quit-or-push.chaos-energy-screen .chaos-energy-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 0;
  text-shadow: 0 0 12px rgba(155, 93, 255, 0.5);
}

/* F) Choice buttons */
.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn {
  min-height: 52px;
  padding: 1.1rem 1.5rem;
  font-size: 1.05rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 2px solid rgba(155, 93, 255, 0.35);
  border-radius: 14px;
  color: #f5f7ff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  position: relative;
  overflow: hidden;
}

.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.06));
  border-color: rgba(155, 93, 255, 0.6);
  box-shadow: 0 8px 24px rgba(155, 93, 255, 0.25);
}

.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn:active {
  transform: translateY(-1px);
}

.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn:focus-visible {
  outline: 2px solid rgba(155, 93, 255, 0.8);
  outline-offset: 3px;
}

/* Continue — brighter/forward */
.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn[data-value="continue"] {
  border-color: rgba(0, 212, 255, 0.4);
}
.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn[data-value="continue"]:hover {
  border-color: rgba(0, 212, 255, 0.7);
  box-shadow: 0 8px 24px rgba(0, 212, 255, 0.3);
}

/* Pause — calmer/softer */
.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn[data-value="pause"] {
  border-color: rgba(155, 93, 255, 0.3);
}
.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn[data-value="pause"]:hover {
  border-color: rgba(155, 93, 255, 0.55);
}

/* Quit */
.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn[data-value="quit"] {
  border-color: rgba(255, 143, 179, 0.35);
}
.chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn[data-value="quit"]:hover {
  border-color: rgba(255, 143, 179, 0.6);
  box-shadow: 0 8px 24px rgba(255, 143, 179, 0.2);
}

/* Ripple */
.chaos-quit-ripple {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: translate(-50%, -50%) scale(0);
  animation: quitRipple 0.5s ease-out forwards;
  pointer-events: none;
}

@keyframes quitRipple {
  to {
    transform: translate(-50%, -50%) scale(15);
    opacity: 0;
  }
}

/* Override chaos.css energy pulse for AAA — ensure energy + timer visible */
.chaos-quit-or-push.chaos-energy-screen .chaos-energy-container {
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.2) !important;
  animation: none !important;
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Responsive */
@media (max-width: 768px) {
  .chaos-quit-or-push.chaos-energy-screen .chaos-game-title.chaos-aaa-title {
    font-size: 1.8rem;
  }
  .chaos-quit-or-push.chaos-energy-screen .chaos-cinematic-content {
    padding: 1.5rem 1.25rem;
  }
  .chaos-quit-or-push.chaos-energy-screen .chaos-cinematic-line.chaos-emphasis-line {
    font-size: 1.1rem;
  }
  .chaos-quit-or-push.chaos-energy-screen .chaos-energy-value {
    font-size: 1.2rem;
  }
  .chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn {
    min-height: 50px;
    padding: 1rem 1.25rem;
    font-size: 0.98rem;
  }
}

@media (max-width: 480px) {
  .chaos-quit-or-push.chaos-energy-screen .chaos-game-title.chaos-aaa-title {
    font-size: 1.55rem;
  }
  .chaos-quit-or-push.chaos-energy-screen .chaos-energy-bar {
    height: 24px;
  }
  .chaos-quit-or-push.chaos-energy-screen .chaos-energy-value {
    font-size: 1.1rem;
  }
  .chaos-quit-or-push.chaos-energy-screen .chaos-quit-choice-btn {
    min-height: 48px;
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
  }
}
