/* =============================================================
   LGG GAMIFICATION STYLES
   ============================================================= */

/* ── XP Badge in header ─────────────────────────────────────── */
#lgc-xp-badge {
  background: linear-gradient(135deg,#ffd700,#f59e0b);
  color: #7c4a00;
  font-size: .78rem; font-weight: 900;
  border-radius: 20px;
  padding: 4px 12px;
  cursor: default;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(245,158,11,.3);
}

/* ── Streak badge ───────────────────────────────────────────── */
#lgc-streak-badge {
  background: linear-gradient(135deg,#ff6b35,#ff4b4b);
  color: #fff;
  font-size: .78rem; font-weight: 900;
  border-radius: 20px;
  padding: 4px 10px;
  cursor: default;
  user-select: none;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(255,75,75,.3);
}

/* ── Leaderboard button ─────────────────────────────────────── */
#lgc-lb-btn {
  background: linear-gradient(135deg,#1cb0f6,#0891cc);
  color: #fff;
  font-size: .78rem; font-weight: 900;
  border-radius: 20px;
  padding: 4px 12px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

/* ── Gamify header strip ────────────────────────────────────── */
#lgc-gamify-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 16px 0;
  max-width: 560px;
  margin: 0 auto;
}

/* ── XP Toast ───────────────────────────────────────────────── */
#lgc-xp-toast {
  /* Force pill shape — never grows beyond text size */
  display: inline-block !important;
  width: fit-content !important;
  height: fit-content !important;
  position: fixed;
  top: 62px;
  right: 12px;
  left: auto;
  transform: translateY(-10px) scale(.9);
  background: linear-gradient(135deg,#ffd700,#f59e0b);
  color: #7c4a00;
  font-weight: 900;
  font-size: .78rem;
  line-height: 1;
  padding: 6px 12px;
  border-radius: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
  opacity: 0;
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 9999;
  white-space: nowrap;
  overflow: hidden;
}

/* ── Mini toast ─────────────────────────────────────────────── */
#lgc-mini-toast {
  position: fixed;
  bottom: 90px; left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #1e293b;
  color: #fff;
  font-size: .82rem; font-weight: 700;
  padding: 8px 20px;
  border-radius: 20px;
  max-width: 90vw;
  text-align: center;
  opacity: 0;
  transition: opacity .4s, transform .4s;
  pointer-events: none;
  z-index: 9998;
}

/* ── Badge popup ────────────────────────────────────────────── */
#lgc-badge-pop {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%) scale(.85);
  background: #fff;
  border-radius: 20px;
  padding: 32px 28px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.22);
  z-index: 10000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s, transform .35s;
  min-width: 240px;
}
#lgc-badge-pop.show {
  opacity: 1;
  transform: translate(-50%,-50%) scale(1);
  pointer-events: auto;
}
.lgc-badgepop-icon  { font-size: 3rem; margin-bottom: 8px; }
.lgc-badgepop-title { font-size: .72rem; font-weight: 900; text-transform: uppercase;
                      letter-spacing: .1em; color: #f59e0b; margin-bottom: 4px; }
.lgc-badgepop-name  { font-size: 1.2rem; font-weight: 800; color: #1e293b; margin-bottom: 6px; }
.lgc-badgepop-desc  { font-size: .84rem; color: #64748b; }

/* ── Leaderboard panel ──────────────────────────────────────── */
#lgc-leaderboard-panel {
  position: fixed;
  top: 0; right: -340px;
  width: 320px; height: 100vh;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0,0,0,.14);
  z-index: 9000;
  transition: right .35s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
  padding: 24px 0 0;
}
#lgc-leaderboard-panel.open { right: 0; }
.lgc-lb-title {
  font-size: 1.1rem; font-weight: 800;
  padding: 0 20px 12px;
  border-bottom: 1px solid #e5e7eb;
}
#lgc-lb-list { overflow-y: auto; flex: 1; padding: 8px 0; }
.lgc-lb-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  font-size: .88rem;
  border-bottom: 1px solid #f1f5f9;
}
.lgc-lb-row.me { background: #f0fdf4; font-weight: 800; }
.lgc-lb-rank   { width: 28px; font-size: 1rem; }
.lgc-lb-name   { flex: 1; }
.lgc-lb-xp     { color: #f59e0b; font-weight: 700; }
.lgc-lb-close  { position: absolute; top: 16px; right: 16px;
                  background: none; border: none; font-size: 1.2rem; cursor: pointer; color: #64748b; }

/* ── Confetti canvas ────────────────────────────────────────── */
#lgc-confetti {
  position: fixed; top: 0; left: 0;
  width: 100vw; height: 100vh;
  pointer-events: none; z-index: 9999;
  display: none;
}

/* ── Daily challenge ────────────────────────────────────────── */
#lgc-daily {
  max-width: 560px; margin: 12px auto 0;
  padding: 0 16px;
  display: none;
}
.lgc-daily-inner {
  background: linear-gradient(135deg,#fef3c7,#fde68a);
  border: 2px solid #f59e0b;
  border-radius: 16px;
  padding: 16px 20px;
  position: relative;
}
.lgc-daily-inner.done { background: linear-gradient(135deg,#d1fae5,#a7f3d0); border-color: #10b981; }
.lgc-daily-label  { font-size: .72rem; font-weight: 900; text-transform: uppercase;
                    letter-spacing: .1em; color: #92400e; margin-bottom: 6px; }
.lgc-daily-word   { font-size: 1.05rem; font-weight: 700; color: #1e293b; margin-bottom: 10px; }
.lgc-daily-q      { color: #d97706; }
.lgc-daily-opts   { display: flex; flex-wrap: wrap; gap: 8px; }
.lgc-daily-btn {
  background: #fff; border: 2px solid #f59e0b;
  border-radius: 10px; padding: 7px 14px;
  font-weight: 700; font-size: .88rem;
  cursor: pointer; transition: background .15s, border-color .15s;
}
.lgc-daily-btn:hover { background: #fef3c7; }
.lgc-daily-xp { font-size: .9rem; font-weight: 800; color: #059669; margin-top: 4px; }

/* ── Welcome back banner ────────────────────────────────────── */
#lgc-welcome-back {
  max-width: 560px; margin: 12px auto 0;
  padding: 0 16px;
  display: none;
}
.lgc-wb-inner {
  background: linear-gradient(135deg,#ede9fe,#ddd6fe);
  border: 2px solid #8b5cf6;
  border-radius: 16px;
  padding: 16px 20px;
  position: relative;
}
.lgc-wb-icon    { font-size: 1.8rem; margin-bottom: 4px; }
.lgc-wb-msg     { font-size: 1rem; font-weight: 800; color: #4c1d95; }
.lgc-wb-sub     { font-size: .84rem; color: #6d28d9; margin-top: 2px; }
.lgc-wb-close   { position: absolute; top: 10px; right: 12px;
                  background: none; border: none; font-size: 1rem; cursor: pointer; color: #6d28d9; }

/* ── Modal ──────────────────────────────────────────────────── */
#lgc-modal {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 10001;
  align-items: center; justify-content: center;
}
.lgc-modal-inner {
  background: #fff; border-radius: 20px;
  padding: 32px 28px; max-width: 360px; width: 90%;
  text-align: center;
  border-top: 4px solid #ffd700;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  animation: lgcModalPop .3s;
}
.lgc-modal-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 12px; }
.lgc-modal-body  { font-size: .95rem; color: #475569; line-height: 1.6; margin-bottom: 20px; }
.lgc-modal-close {
  background: #58cc02; color: #fff;
  border: none; border-radius: 12px;
  padding: 10px 28px; font-weight: 800; font-size: .95rem; cursor: pointer;
}

/* ── Mastery stars inline ───────────────────────────────────── */
.lgc-stars {
  font-size: .82rem; margin-left: 6px;
  letter-spacing: -.05em;
  vertical-align: middle;
}

/* ── Completion ring ────────────────────────────────────────── */
.lgc-ring { display: inline-block; vertical-align: middle; }

/* ── Card animations ────────────────────────────────────────── */
@keyframes lgcShake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-8px); }
  40%     { transform: translateX(8px); }
  60%     { transform: translateX(-5px); }
  80%     { transform: translateX(5px); }
}
@keyframes lgcFlashGreen {
  0%   { background: #fff; }
  40%  { background: #d1fae5; }
  100% { background: #fff; }
}
@keyframes lgcModalPop {
  from { transform: scale(.85); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ── Milestone path markers ─────────────────────────────────── */
.lgc-milestone {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  font-size: .78rem; font-weight: 800;
  color: #f59e0b;
  padding: 6px 0;
  letter-spacing: .05em;
}
.lgc-milestone::before,
.lgc-milestone::after {
  content: ''; flex: 1;
  height: 2px; background: #fde68a;
}
