/* Fake It — AAA Narrative Game polish. UI/UX only, no logic.
 * Scoped to .chaos-fake-it.chaos-cinematic-scene
 * Respects prefers-reduced-motion, Greek fonts, accessibility.
 */

@media (prefers-reduced-motion: reduce) {
  .chaos-fake-it.chaos-cinematic-scene *,
  .chaos-fake-it.chaos-cinematic-scene *::before,
  .chaos-fake-it.chaos-cinematic-scene *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
  }
  .chaos-fakeit-entry-overlay { display: none !important; }
}

/* A) Cinematic entry — fade from black */
.chaos-fakeit-entry-overlay {
  position: absolute;
  inset: 0;
  background: #000;
  z-index: 100;
  pointer-events: none;
  animation: fakeitFadeFromBlack 300ms ease-out forwards;
}

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

/* Stagger entry */
.chaos-fake-it.chaos-cinematic-scene .chaos-aaa-title { animation: fakeitEntryUp 0.4s ease-out 0ms both; }
.chaos-fake-it.chaos-cinematic-scene .chaos-aaa-progress { animation: fakeitEntryUp 0.4s ease-out 80ms both; }
.chaos-fake-it.chaos-cinematic-scene .chaos-aaa-card { animation: fakeitEntryUp 0.4s ease-out 140ms both; }
.chaos-fake-it.chaos-cinematic-scene .chaos-aaa-choices { animation: fakeitEntryUp 0.4s ease-out 220ms both; }

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

/* B) Background: vignette + film grain */
.chaos-fake-it.chaos-cinematic-scene {
  position: relative;
  overflow: hidden;
}

.chaos-fake-it.chaos-cinematic-scene::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-fake-it.chaos-cinematic-scene::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: fakeitGrainFlicker 8s ease-in-out infinite;
}

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

.chaos-fake-it.chaos-cinematic-scene > * {
  position: relative;
  z-index: 2;
}

/* C) Title — AAA headline */
.chaos-fake-it.chaos-cinematic-scene .chaos-game-title.chaos-aaa-title {
  font-size: 2.2rem;
  margin-bottom: 1.25rem;
  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: fakeitTitleShimmer 15s ease-in-out infinite;
}

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

/* D) Scene progress — cinematic dots + bar */
.chaos-fake-it.chaos-cinematic-scene .chaos-cinematic-progress.chaos-aaa-progress {
  margin-bottom: 1rem;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-progress-dots {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: inline-block;
  transition: all 0.3s ease;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-progress-dot.active {
  width: 12px;
  height: 12px;
  background: rgba(155, 93, 255, 0.9);
  box-shadow: 0 0 12px rgba(155, 93, 255, 0.6);
}

.chaos-fake-it.chaos-cinematic-scene .chaos-progress-bar {
  width: 100%;
  max-width: 200px;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  margin-top: 0.5rem;
  overflow: hidden;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #9b5dff, #65baff);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* E) Scene tag — badge */
.chaos-fake-it.chaos-cinematic-scene .chaos-scene-tag {
  display: inline-block;
  padding: 0.4rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8dcff;
  background: rgba(155, 93, 255, 0.15);
  border: 1px solid rgba(155, 93, 255, 0.35);
  border-radius: 999px;
  margin-bottom: 1rem;
  position: relative;
  overflow: hidden;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-scene-tag::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: -100%;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: fakeitTagSweep 1.2s ease-out 0.5s forwards;
}

@keyframes fakeitTagSweep {
  to { left: 100%; }
}

/* F) Narrative card — hero panel */
.chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card {
  padding: 2rem 2.25rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: fakeitBeamSlide 25s linear infinite;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card::after {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 20px;
  padding: 2px;
  background: linear-gradient(90deg, rgba(155, 93, 255, 0.4), rgba(0, 212, 255, 0.3), rgba(155, 93, 255, 0.4));
  background-size: 200% 100%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: fakeitEdgeShimmer 12s linear infinite;
  pointer-events: none;
  opacity: 0.6;
}

@keyframes fakeitBeamSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

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

.chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(155, 93, 255, 0.15);
}

.chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card .chaos-cinematic-line {
  font-size: 1.1rem;
  line-height: 1.7;
  color: #e8ecff;
  max-width: 580px;
  margin: 0.35rem auto;
}

/* G) Question emphasis */
.chaos-fake-it.chaos-cinematic-scene .chaos-cinematic-question.chaos-aaa-question {
  font-size: 1.35rem;
  font-weight: 700;
  color: #ffffff;
  margin-top: 1.5rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(90deg, rgba(155, 93, 255, 0.15), transparent 60%);
  border-radius: 12px;
  border-left: 3px solid rgba(155, 93, 255, 0.6);
  animation: fakeitQuestionFade 0.5s ease-out 120ms both;
}

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

/* H) Answer buttons — AAA */
.chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option {
  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;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option: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-fake-it.chaos-cinematic-scene .chaos-pretend-option:active {
  transform: translateY(-1px);
}

.chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option:focus-visible {
  outline: 2px solid rgba(155, 93, 255, 0.8);
  outline-offset: 3px;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option.dimmed {
  opacity: 0.5;
}

/* Ripple */
.chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option {
  position: relative;
  overflow: hidden;
}

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

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

/* I) Replace red/orange border — cinematic gradient */
.chaos-fake-it.chaos-cinematic-scene .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;
  opacity: 0.7 !important;
  animation: fakeitBorderShimmer 10s linear infinite !important;
}

@keyframes fakeitBorderShimmer {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

/* J) Responsive — all screens */

/* Base: container constraints + safe areas */
.chaos-fake-it.chaos-cinematic-scene {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  padding-left: max(1.25rem, env(safe-area-inset-left));
  padding-right: max(1.25rem, env(safe-area-inset-right));
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.chaos-fake-it.chaos-cinematic-scene .chaos-pretend-choices {
  max-width: 100%;
}

/* Tablet (769px–1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .chaos-fake-it.chaos-cinematic-scene {
    padding: 2rem 2rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card .chaos-cinematic-line {
    max-width: 100%;
  }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
  .chaos-fake-it.chaos-cinematic-scene {
    padding: 1.25rem 1rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-game-title.chaos-aaa-title {
    font-size: 1.8rem;
    margin-bottom: 1rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-cinematic-progress.chaos-aaa-progress {
    margin-bottom: 0.75rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-scene-tag {
    font-size: 0.7rem;
    padding: 0.35rem 0.85rem;
    letter-spacing: 0.1em;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card {
    padding: 1.5rem 1.25rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card .chaos-cinematic-line {
    font-size: 1rem;
    line-height: 1.6;
    max-width: 100%;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-cinematic-question.chaos-aaa-question {
    font-size: 1.15rem;
    padding: 0.85rem 1rem;
    margin-top: 1.25rem;
    margin-bottom: 1.25rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option {
    min-height: 52px;
    padding: 1rem 1.25rem;
    font-size: 0.98rem;
  }
}

/* Small phones (≤480px) */
@media (max-width: 480px) {
  .chaos-fake-it.chaos-cinematic-scene {
    padding: 1rem 0.85rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-game-title.chaos-aaa-title {
    font-size: 1.55rem;
    margin-bottom: 0.75rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-progress-dots {
    gap: 0.5rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-progress-dot {
    width: 8px;
    height: 8px;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-progress-dot.active {
    width: 10px;
    height: 10px;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-scene-tag {
    font-size: 0.65rem;
    padding: 0.3rem 0.75rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card {
    padding: 1.25rem 1rem;
    border-radius: 14px;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card .chaos-cinematic-line {
    font-size: 0.95rem;
    margin: 0.25rem auto;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-cinematic-question.chaos-aaa-question {
    font-size: 1.05rem;
    padding: 0.75rem 0.9rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option {
    min-height: 48px;
    padding: 0.9rem 1rem;
    font-size: 0.92rem;
  }
}

/* Very small phones (≤400px) */
@media (max-width: 400px) {
  .chaos-fake-it.chaos-cinematic-scene {
    padding: 0.85rem 0.75rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-game-title.chaos-aaa-title {
    font-size: 1.4rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-narrative-card {
    padding: 1rem 0.85rem;
  }
  .chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option {
    min-height: 44px;
    padding: 0.9rem 0.85rem;
    font-size: 0.9rem;
  }
}

/* Word wrap for long Greek text */
.chaos-fake-it.chaos-cinematic-scene .chaos-cinematic-line,
.chaos-fake-it.chaos-cinematic-scene .chaos-cinematic-question,
.chaos-fake-it.chaos-cinematic-scene .chaos-pretend-option {
  word-wrap: break-word;
  overflow-wrap: break-word;
}
