    
/* FULLSCREEN BACKGROUND WRAPPER */
.page-wrap{
  position:relative;   /* 🔑 THIS WAS MISSING */
  width:100vw;
  height:calc(100vh - 48px);
  display:flex;
  justify-content:center;
  align-items:center;
  overflow:hidden;
}

/* ===============================
   BACKGROUND LAYER
================================ */

.bg-media{
  position:absolute;
  inset:0;
  z-index:0;

  background-size:cover;
  background-position:center center;
  background-repeat:no-repeat;

  filter:saturate(1.05) contrast(1.05);
  transform:scale(1.03); /* lighter zoom */
  will-change:transform;
}

/* Overlay */
.bg-overlay{
  position:absolute;
  inset:0;
  z-index:1;

  background:
    linear-gradient(
      to bottom,
      rgba(5,7,13,.45) 0%,
      rgba(5,7,13,.75) 60%,
      rgba(5,7,13,.92) 100%
    );
}

@media (max-width:768px){

  .bg-media{
    background-position:center top; /* focus upper image */
    transform:scale(1);             /* no zoom on mobile */
  }

  .bg-overlay{
    background:
      linear-gradient(
        to bottom,
        rgba(5,7,13,.35) 0%,
        rgba(5,7,13,.85) 70%,
        rgba(5,7,13,1) 100%
      );
  }

}


.learn-wrap{
  position:relative;
  z-index:2;
  width:100%;
  height:100%;
  display:flex;
  justify-content:center;
  align-items:center;
}

.brain-canvas{
  width:100%;
  max-width:840px;
  padding:24px;
  display:flex;
  flex-direction:column;
  gap:22px;
  position:relative;

  background:linear-gradient(
    180deg,
    rgba(0,0,0,.55) 0%,
    rgba(0,0,0,.75) 60%,
    rgba(0,0,0,.85) 100%
  );

  backdrop-filter: blur(8px);
  border-radius:26px;
}

.brain-choice{
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.18),
    0 10px 30px rgba(99,102,241,.15);
}

@media (max-width:768px){

  .brain-canvas{
    background:linear-gradient(
      180deg,
      rgba(0,0,0,.65) 0%,
      rgba(0,0,0,.85) 70%,
      rgba(0,0,0,.95) 100%
    );

    backdrop-filter:none; /* performance */
    border-radius:0;
    min-height:100vh;
  }

}

/* ================= OVERLAY (CINEMATIC FLOAT) ================= */

.overlay{
  position:fixed;
  inset:0;
  z-index:1000;

  display:none;
  align-items:center;
  justify-content:center;

  background:
    radial-gradient(
      120% 120% at 50% -20%,
      rgba(99,102,241,.15),
      transparent 60%
    ),
    rgba(5,7,13,.92);

  backdrop-filter:blur(22px);
  padding:24px;
}

/* ===== Card ===== */

.overlay-card{
  width:100%;
  max-width:520px;              /* slightly bigger */
  padding:42px 36px;

  text-align:center;

  border-radius:28px;

  background:
    linear-gradient(
      180deg,
      rgba(15,23,42,.85),
      rgba(2,6,23,.95)
    );

  border:1px solid rgba(255,255,255,.08);

  box-shadow:
    0 60px 160px rgba(0,0,0,.65),
    inset 0 1px 0 rgba(255,255,255,.05);

  animation:fadeInScale .28s ease;
}

/* ===== Typography ===== */

.overlay-card h3{
  font-size:22px;
  font-weight:650;
  letter-spacing:.2px;
  color:#ffffff;
  margin-bottom:14px;
}

.overlay-card p{
  font-size:15px;
  line-height:1.6;
  color:#94a3b8;
  max-width:380px;
  margin:0 auto;
}

/* ===== Actions ===== */

.overlay-actions{
  margin-top:32px;
  display:flex;
  gap:16px;
}

/* ================= BUTTONS ================= */

.btn{
  flex:1;
  display:flex;
  align-items:center;
  justify-content:center;

  padding:16px 20px;
  border-radius:999px;

  font-size:14px;
  font-weight:650;
  letter-spacing:.2px;

  cursor:pointer;
  user-select:none;
  text-decoration:none;

  transition:
    transform .2s ease,
    box-shadow .2s ease,
    background .2s ease;
}

/* Primary */
.btn-primary{
  background:linear-gradient(180deg,#6366f1,#4f46e5);
  color:#fff;
  border:none;
  box-shadow:0 18px 40px rgba(79,70,229,.35);
}

.btn-primary:hover{
  transform:translateY(-2px);
  box-shadow:0 24px 50px rgba(79,70,229,.45);
}

/* Secondary */
.btn{
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
  color:#e2e8f0;
}

.btn:hover{
  transform:translateY(-2px);
  background:rgba(255,255,255,.08);
}

/* Danger */
.btn-danger{
  background:linear-gradient(180deg,#ef4444,#dc2626);
  color:#fff;
  border:none;
  box-shadow:0 18px 40px rgba(220,38,38,.3);
}

.btn-danger:hover{
  transform:translateY(-2px);
  box-shadow:0 24px 50px rgba(220,38,38,.45);
}

/* ================= MOBILE OPTIMISATION ================= */

@media(max-width:520px){

  .overlay-card{
    padding:32px 22px;
    border-radius:22px;
  }

  .overlay-card h3{
    font-size:20px;
  }

  .overlay-card p{
    font-size:14px;
  }

  .overlay-actions{
    flex-direction:column;   /* stack buttons */
    gap:14px;
  }

  .btn{
    padding:15px;
    font-size:14px;
  }
}

/* ================= ENTRY ANIMATION ================= */

@keyframes fadeInScale{
  from{
    opacity:0;
    transform:scale(.96);
  }
  to{
    opacity:1;
    transform:scale(1);
  }
}


/* ====== HUD ====== */
.hud{
  display:flex;
  flex-direction:column;
  gap:14px;
}

/* Score orb */

.score-orb-wrap{
  display:flex;
  justify-content:center;
  margin-bottom:4px;
}

.score-orb{
  width:40px;
  height:40px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  color:#eef0f6;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.06);
  background:rgba(255,255,255,.04);
}
.score-orb::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:999px;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.18);
  pointer-events:none;
}

.score-orb{
  position:relative;
  overflow:hidden;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.14);
  transition:border-color .25s ease, box-shadow .25s ease;
}

.orb-liquid{
  position:absolute;
  bottom:-100%;
  left:0;
  width:100%;
  height:100%;
  background:#22c55e; /* default green */
  opacity:0;
  transition:
    bottom .35s ease,
    opacity .2s ease,
    background .2s ease;
}

.score-orb span{
  position:relative;
  z-index:2;
}


.score-positive{
  background:rgba(34,197,94,.28);
  box-shadow:
    0 0 22px rgba(34,197,94,.45),     /* outer glow */
    inset 0 10px 18px rgba(34,197,94,.35);
}

.score-negative{
  background:rgba(239,68,68,.28);
  box-shadow:
    0 0 22px rgba(239,68,68,.45),
    inset 0 10px 18px rgba(239,68,68,.35);
}


.drop-green{
  background:#15803d; /* darker green */
  bottom:0%;
  opacity:.9;
}

.drop-red{
  background:#991b1b; /* darker red */
  bottom:0%;
  opacity:.9;
}

.score-orb.pulse{
  transform:scale(1.03);
  box-shadow:
    0 0 0 6px rgba(99,102,241,.14),
    inset 0 1px 0 rgba(255,255,255,.06);
}

/* ONE BAR ONLY: Journey bar */
.journey{
  position:relative;
  height:8px;
  border-radius:999px;
  background:rgba(255,255,255,.08);
  overflow:hidden;
}
.journey-fill{
  height:100%;
  width:0%;
  border-radius:999px;
  background:linear-gradient(90deg,#6366f1,#22c55e);
  transition:width .45s ease;
}

/* Reward marker (score->threshold) lives ON the same bar */
.reward-marker{
  position:absolute;
  top:50%;
  left:0%;
  transform:translate(-50%,-50%);
  width:14px;
  height:14px;
  border-radius:999px;
  background:radial-gradient(circle at 30% 30%, rgba(250,204,21,1), rgba(250,204,21,.55));
  box-shadow:0 0 0 6px rgba(250,204,21,.12);
  transition:left .45s ease, box-shadow .2s ease, transform .2s ease;
  pointer-events:none;
}
.reward-marker.ping{
  transform:translate(-50%,-50%) scale(1.08);
  box-shadow:0 0 0 8px rgba(250,204,21,.14);
}

/* A subtle inline legend (not heavy text) */
.legend{
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:11px;
  color:#9ca3af;
  letter-spacing:.2px;
}
.legend strong{color:#e0e7ff; font-weight:650}
.legend .pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.05);
  border:1px solid rgba(255,255,255,.08);
}

.reward-pill{
  display:inline-flex;
  align-items:center;
  gap:8px; /* applies ONLY between icon and text block */
  padding:6px 12px;
  border-radius:999px;

  background:
    linear-gradient(
      180deg,
      rgba(250,204,21,.18),
      rgba(250,204,21,.08)
    );

  border:1px solid rgba(250,204,21,.35);
  color:#fde68a;
  font-size:11px;
  letter-spacing:.25px;
}
.reward-text{
  white-space:nowrap; /* prevents odd wrapping on small screens */
}
.reward-icon{
  font-size:13px;
  filter:drop-shadow(0 0 6px rgba(250,204,21,.45));
}

.reward-pill strong{
  color:#fff7ed;
  font-weight:650;
}
/* ====== QUESTION ====== */
.brain-stimulus{
  font-size:26px;
  font-weight:600;                 /* was too heavy */
  line-height:1.38;
  text-align:center;
  color:#e5e7eb;                   /* ⬅ softer than pure white */
  text-shadow:0 1px 0 rgba(0,0,0,.25);
}

/* ====== OPTIONS ====== */
.brain-responses{
  display:flex;
  flex-direction:column;
  gap:16px;
  margin-top:15px;
}
.brain-choice{
  padding:18px 22px;
  border-radius:999px;
  cursor:pointer;
  transition:transform .22s ease, background .22s ease, border-color .22s ease, box-shadow .22s ease;
  text-align:center;
  font-size:16px;
  letter-spacing:.1px;
  background:
      linear-gradient(
        180deg,
        rgba(255,255,255,.08),
        rgba(255,255,255,.04)
      );
    border:1px solid rgba(255,255,255,.14);
    color:#f8fafc;
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,.18),  /* 👈 tactile highlight */
      0 12px 30px rgba(0,0,0,.35);

}

.brain-choice:hover{
  transform:scale(1.02);
  background:
    linear-gradient(
      180deg,
      rgba(99,102,241,.22),
      rgba(99,102,241,.12)
    );
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.25),
    0 16px 36px rgba(0,0,0,.45);
}


.brain-choice.correct{
  background:rgba(34,197,94,.25);
  box-shadow:0 0 30px rgba(34,197,94,.45);
}

.brain-choice.wrong{
  background:rgba(239,68,68,.25);
  box-shadow:0 0 30px rgba(239,68,68,.45);
}

/* Continue button */
.learn-next{
  margin-top:6px;
  padding:14px;
  border-radius:999px;
  background:linear-gradient(180deg,#6366f1,#4f46e5);
  font-weight:700;
  cursor:pointer;
  text-align:center;
  transition:transform .2s ease, box-shadow .2s ease;
}
.learn-next:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 30px rgba(79,70,229,.45);
}

/* Hint */
.brain-feedback{
  font-size:14px;
  color:#c7d2fe;
  text-align:center;
  min-height:20px;
}


.restart-footer{
  display:flex;
  justify-content:center;
  margin-top:14px;
}

.restart{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.6px;
  color:#fb7185;
  cursor:pointer;
  user-select:none;
  transition:
    opacity .18s ease,
    color .18s ease,
    transform .18s ease;
}

.restart:hover{
  opacity:.9;
  color:#ef4444;            /* stronger red */
  transform:translateY(-1px);
}


/* Mobile fit */
@media(max-width:420px){
  .brain-canvas{ padding:26px 16px 34px; }
  .brain-stimulus{ font-size:22px; }
  .brain-choice{ font-size:15px; padding:16px 18px; }
  .learn-wrap{
    display:block;
    background:rgba(0,0,0,0.6);
  }
}
