/* =====================================================================
   STUDY ADDICT — CLEAN FINAL NEON UI
===================================================================== */

/* ----------------------------------------------------
   GLOBAL
---------------------------------------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html { scroll-behavior: smooth; }

body {
  background: #02000a;
  color: #dff8ff;
  font-family: 'Segoe UI', sans-serif;
  overflow-y: auto;
  min-height: 100vh;
}

/* GlassBreak / PrestigeBurst — FIXED so they never block clicks */
#glassBreak,
#prestigeBurst {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* Neon scrollbar */
body::-webkit-scrollbar { width: 8px; }
body::-webkit-scrollbar-track { background: rgba(0,0,0,0.25); border-radius: 10px; }
body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg,#00eaff,#9400ff);
  border-radius: 10px;
}

/* ----------------------------------------------------
   TITLE BAR
---------------------------------------------------- */
.titleBar {
  width: 100%;
  text-align: center;
  padding-top: 20px;
}

#usernameTitle {
  display: inline-block;
  max-width: 95%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ----------------------------------------------------
   FLOATING USER BAR
---------------------------------------------------- */
#loggedUserBar {
  width: 100%;
  padding: 20px;
  font-size: 15px;
  color: #00eaff;
  position: relative;
  z-index: 9999;
  text-align: left;
}

/* ----------------------------------------------------
   MAIN MENU
---------------------------------------------------- */
.menu {
  width: 100%;
  margin-top: 95px;
  padding-bottom: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  animation: fadeMenu 0.6s ease forwards;
}

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

#menuLoggedIn,
#menuLoggedOut {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  gap: 25px;
}

/* ----------------------------------------------------
   NEON BUTTONS
---------------------------------------------------- */
.btn {
  width: 82%;
  max-width: 380px;
  padding: 22px;
  border-radius: 22px;
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(0,238,255,0.45);
  color: #baf6ff;
  font-size: 24px;
  letter-spacing: 1.5px;
  text-align: center;
  cursor: pointer;
  transition: 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  box-shadow: 0 0 18px rgba(0,255,255,0.38);

  /* ★ Anti-Overlay Fix */
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.btn span { font-size: 26px; }

.btn:hover {
  transform: translateY(-6px);
  background: rgba(255,255,255,0.12);
  border-color: rgba(0,255,255,0.8);
  box-shadow: 0 0 40px #00eaff, 0 0 55px #9400ff;
}

.btn:active { transform: scale(0.93); }

/* Danger button */
.danger-btn {
  background: rgba(255,0,60,0.18);
  border: 2px solid #ff003c;
  color: #ff003c;
  animation: dangerPulse 1.7s infinite;
  box-shadow: 0 0 20px #ff003c80;
}

@keyframes dangerPulse {
  0% { box-shadow: 0 0 6px #ff003c; }
  50% { box-shadow: 0 0 25px #ff003c; }
  100% { box-shadow: 0 0 6px #ff003c; }
}

/* ----------------------------------------------------
   SCREENS — FIXED (this was the bug)
---------------------------------------------------- */
.screen {
  display: none;
  position: fixed;
  inset: 0;
  padding: 100px 20px 30px;
  overflow-y: auto;
  animation: fadeIn 0.35s ease;
  z-index: 50000;   /* FIXED — now above menu */
  pointer-events: auto; /* FIXED — clicks work */
}

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

.back {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 10px 20px;
  border: 2px solid #00eaff;
  background: rgba(0,0,0,0.45);
  border-radius: 10px;
  color: #00eaff;
  cursor: pointer;
  z-index: 999;
}

/* ----------------------------------------------------
   XP UI
---------------------------------------------------- */
.level {
  font-size: 32px;
  margin-top: 10px;
  text-align: center;
}

.xp-bar {
  width: 90%;
  max-width: 500px;
  height: 32px;
  border: 2px solid #00eaff;
  border-radius: 12px;
  margin: 25px auto;
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  width: 0%;
  background: #00eaff;
  box-shadow: 0 0 20px #00eaff;
  transition: width 0.8s ease;
}

.xp-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  justify-content: center;
}

.xp-btn {
  padding: 14px 22px;
  background: rgba(0,0,20,0.45);
  border: 2px solid #00eaff;
  border-radius: 10px;
  color: #00eaff;
  font-size: 18px;
  cursor: pointer;
}

.prestige-btn {
  border-color: gold;
  color: gold;
}

/* ----------------------------------------------------
   BADGES
---------------------------------------------------- */
.badge-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.badge-tile {
  display: flex;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
  background: rgba(0,0,20,0.45);
  border: 2px solid #00eaff60;
}

.badge-tile.locked { opacity: 0.4; }

.badge-icon { font-size: 30px; }
.badge-name { font-size: 20px; color: #00eaff; }

/* ----------------------------------------------------
   REWARDS
---------------------------------------------------- */
.rewardItem {
  padding: 18px;
  border-radius: 14px;
  margin: 14px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(0,0,20,0.45);
  border: 2px solid #9400ff60;
  backdrop-filter: blur(6px);
}

.reward-common { border-color:#00eaff70; }
.reward-rare { border-color:#9400ff90; }
.reward-epic { border-color:#ff00ff90; }
.reward-legendary { border-color:#ffd86b; }

.buyBtn {
  padding: 10px 18px;
  border-radius: 12px;
  background: rgba(0,20,40,0.45);
  color: #00eaff;
  border: 2px solid #00eaff;
  font-weight: 600;
  cursor: pointer;
  transition: 0.25s ease;
}

.buyBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 25px #00eaff;
}

.unlockedTag {
  padding: 10px 18px;
  border-radius: 12px;
  border: 2px solid #00ff9d;
  background: rgba(0,255,150,0.2);
  color:#00ff9d;
  font-weight: 700;
}

/* ----------------------------------------------------
   MISSIONS — CLEAN, ONLY ONE VERSION
---------------------------------------------------- */
.mission-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 25px;
}

.mission-card {
  background: rgba(0,0,20,0.45);
  border: 2px solid #00eaff66;
  border-radius: 16px;
  padding: 18px 20px;
  color: #dff8ff;
  backdrop-filter: blur(6px);
  box-shadow: 0 0 12px rgba(0,238,255,0.18);
  transition: 0.25s;
}

.mission-card.complete {
  border-color: #00ff99;
  box-shadow: 0 0 18px #00ff9966;
}

.mission-info h2 {
  margin: 0;
  font-size: 23px;
  color: #00eaff;
}

.mission-info p {
  margin-top: 6px;
  opacity: 0.85;
}

.mission-bar {
  width: 100%;
  height: 12px;
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  margin-top: 12px;
  overflow: hidden;
}

.mission-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00eaff, #9400ff);
  box-shadow: 0 0 12px #00eaff;
  transition: width 0.45s;
}

.claim-btn {
  margin-top: 14px;
  width: 110px;
  height: 40px;
  border-radius: 10px;
  border: 2px solid #00eaff;
  background: rgba(0,255,255,0.1);
  color: #00eaff;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s;
}

.claim-btn.locked {
  border-color: #444;
  background: rgba(255,255,255,0.05);
  color: #444;
  cursor: not-allowed;
}

.claim-btn.claimed {
  border-color: lime;
  background: rgba(0,255,0,0.18);
  color: lime;
}

/* XP pop */
.mission-xp-pop {
  position: absolute;
  right: 15px;
  top: -10px;
  font-size: 20px;
  font-weight: 800;
  color: #00eaff;
  animation: missionXpFloat 0.85s ease forwards;
}

@keyframes missionXpFloat {
  0%   { opacity: 1; transform: translateY(10px); }
  100% { opacity: 0; transform: translateY(-28px); }
}

/* ----------------------------------------------------
   POPUPS + TOAST
---------------------------------------------------- */
#toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #00eaff;
  padding: 14px 22px;
  border-radius: 12px;
  border: 2px solid #00eaff;
  display: none;
  z-index: 99999;
}

#popup {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,20,0.75);
  padding: 14px 24px;
  border-radius: 14px;
  color: #00eaff;
  font-size: 24px;
  font-weight: 700;
  border: 2px solid #00eaff;
  display: none;
  z-index: 999999;
  text-shadow: 0 0 12px #00eaff;
  box-shadow: 0 0 22px #00eaffaa;
}

.achievementPopup {
  position: fixed;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20,0,40,0.9);
  border: 2px solid #9400ff;
  color: #00eaff;
  padding: 18px 28px;
  border-radius: 14px;
  opacity: 0;
  transition: 0.35s;
  z-index: 999999;
}

.achievementPopup.show {
  top: 40px;
  opacity: 1;
}

/* ------------------------------------------------------------
   SYNC STATUS
------------------------------------------------------------ */
.syncBar {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0,0,10,0.45);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 14px;
  color: #00eaff;
  border: 1px solid #00eaff55;
  box-shadow: 0 0 15px #00eaff55;
  z-index: 99999;
}

.syncBar.good {
  color: #00ffbf;
  border-color: #00ffbf55;
  box-shadow: 0 0 20px #00ffbf99;
  transform: scale(1.04);
}
#glassBreak,
#prestigeBurst {
  pointer-events: none !important;
  z-index: 0 !important;
}
