/* =============================================================
   ALMA Gamification Layer — styles
   All new UI. Zero changes to style.css.
============================================================= */

/* ── Daily Challenge Card ─────────────────────────────────── */
#dailyChallengeCard {
  margin: 12px 16px 8px;
  border-radius: 16px;
  overflow: hidden;
  border: 1.5px solid #F58220;
  background: linear-gradient(135deg, #fff8f2 0%, #ffffff 100%);
  box-shadow: 0 2px 12px rgba(245, 130, 32, 0.12);
}

.dc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 6px;
  background: #F58220;
}

.dc-header-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: #fff;
  opacity: 0.9;
}

.dc-streak-pill {
  margin-left: auto;
  background: rgba(255,255,255,0.25);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.dc-body {
  padding: 12px 14px 14px;
}

.dc-title {
  font-size: 17px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 4px;
  line-height: 1.3;
}

.dc-context {
  font-size: 13px;
  color: #6b7280;
  margin: 0 0 12px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dc-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.dc-level-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: #fef3c7;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dc-exp-pill {
  font-size: 11px;
  color: #6b7280;
}

.dc-start-btn {
  width: 100%;
  padding: 11px;
  background: #F58220;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.dc-start-btn:active {
  opacity: 0.85;
}

/* ── Progress dots ───────────────────────────────────────── */
.dc-progress-dots {
  display: flex;
  gap: 5px;
  padding: 6px 14px 0;
}

.dc-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
  flex-shrink: 0;
}

.dc-dot-done {
  background: #F58220;
}

/* ── Completed state ─────────────────────────────────────── */
.dc-completed-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dc-completed-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dc-completed-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.dc-completed-text {
  flex: 1;
}

.dc-completed-title {
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 2px;
}

.dc-completed-sub {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
}

.dc-teaser {
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px 12px;
  border-left: 3px solid #F58220;
}

.dc-teaser-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #F58220;
  margin: 0 0 2px;
}

.dc-teaser-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 2px;
}

.dc-teaser-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 0;
  font-style: italic;
}

/* ── Gamification Card in Profile ────────────────────────── */
#gamificationCard {
  margin: 0;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  margin-bottom: 12px;
}

.gc-top {
  background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.gc-rank-block {
  display: flex;
  flex-direction: column;
}

.gc-rank-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: rgba(255,255,255,0.5);
  margin-bottom: 2px;
}

.gc-rank-name {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.gc-streak-block {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.gc-streak-number {
  font-size: 28px;
  font-weight: 800;
  color: #F58220;
  line-height: 1;
}

.gc-streak-label {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

.gc-bottom {
  padding: 12px 16px;
}

.gc-exp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.gc-exp-current {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
}

.gc-exp-next {
  font-size: 12px;
  color: #9ca3af;
}

.gc-exp-bar-track {
  height: 6px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.gc-exp-bar-fill {
  height: 100%;
  background: #F58220;
  border-radius: 999px;
  transition: width 0.6s ease;
}

/* ── Results Modal Gamification Block ────────────────────── */
#challengeResultsBlock {
  background: linear-gradient(135deg, #fff8f2 0%, #ffffff 100%);
  border: 1.5px solid #F58220;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.crb-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #F58220;
  margin: 0 0 12px;
}

.crb-exp-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.crb-exp-number {
  font-size: 36px;
  font-weight: 800;
  color: #F58220;
  line-height: 1;
}

.crb-exp-label {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.4;
}

.crb-exp-label strong {
  color: #1f2937;
  font-weight: 700;
}

.crb-bar-track {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}

.crb-bar-fill {
  height: 100%;
  background: #F58220;
  border-radius: 999px;
  transition: width 0.8s ease;
}

.crb-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.crb-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  background: #f3f4f6;
  color: #374151;
}

.crb-pill.rankup {
  background: #fef3c7;
  color: #92400e;
}

.crb-pill.streak {
  background: #fff7ed;
  color: #c2410c;
}

.crb-divider {
  height: 1px;
  background: #f3f4f6;
  margin-bottom: 12px;
}

.crb-teaser {
  background: #fff7ed;
  border-radius: 8px;
  padding: 10px 12px;
  border-left: 3px solid #F58220;
}

.crb-teaser-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  margin: 0 0 2px;
}

.crb-teaser-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 2px;
}

.crb-teaser-hint {
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
  margin: 0;
}

.crb-next-btn {
  margin-top: 8px;
  width: 100%;
  padding: 9px;
  background: #F58220;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.crb-next-btn:active {
  opacity: 0.85;
}

/* ── Welcome Challenge Modal ────────────────────────────── */
.cwm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 9999;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.cwm-card {
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 32px;
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: cwm-slide-up 0.28s ease;
}

@keyframes cwm-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cwm-icon {
  font-size: 36px;
  text-align: center;
  margin-bottom: 2px;
}

.cwm-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  text-align: center;
  margin: 0;
}

.cwm-sub {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  margin: 0 0 4px;
}

.cwm-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 8px;
}

.cwm-challenge-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f9fafb;
  border-radius: 10px;
  padding: 10px 12px;
}

.cwm-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #F58220;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cwm-challenge-info {
  flex: 1;
  min-width: 0;
}

.cwm-challenge-title {
  font-size: 13px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cwm-challenge-sub {
  font-size: 11px;
  color: #9ca3af;
  margin: 0;
}

.cwm-start-btn {
  width: 100%;
  padding: 13px;
  background: #F58220;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity 0.15s;
}

.cwm-start-btn:active { opacity: 0.85; }

.cwm-skip-btn {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: #9ca3af;
  border: none;
  font-size: 14px;
  cursor: pointer;
}

/* ── Rank-up toast overlay ───────────────────────────────── */
#rankUpToast {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: #1f2937;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  z-index: 99997;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  opacity: 0;
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
  white-space: nowrap;
}

#rankUpToast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ───────── Always-visible streak flame ───────── */
#streakFlamePill {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top, 0));
  right: 12px;
  z-index: 95;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1.5px solid #f3d9c2;
  background: #fff7ed;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  font-family: inherit;
  font-weight: 800;
  font-size: 15px;
  color: #9a3412;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.12s ease;
}
#streakFlamePill:active { transform: scale(0.94); }
#streakFlamePill .sf-flame { font-size: 16px; }
#streakFlamePill.unlit { filter: grayscale(0.9); opacity: 0.78; }
#streakFlamePill.unlit .sf-flame { filter: grayscale(1); }
#streakFlamePill.lit { animation: sf-pop 0.4s ease; }
@keyframes sf-pop { 0%{transform:scale(1);} 40%{transform:scale(1.18);} 100%{transform:scale(1);} }

/* ───────── Streak detail sheet (reuses .cwm-overlay / .cwm-card) ───────── */
.ss-card { align-items: center; text-align: center; }
.ss-flame { font-size: 56px; line-height: 1; margin: 4px 0 2px; }
.ss-flame.unlit { filter: grayscale(1); opacity: 0.6; }
.ss-headline { font-size: 22px; font-weight: 800; color: #111827; margin: 2px 0 0; }
.ss-sub { font-size: 13px; color: #6b7280; margin: 0 0 6px; }
.ss-shield {
  font-size: 12px; font-weight: 600; color: #1d4ed8;
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 10px;
  padding: 8px 12px; margin: 2px 0 4px;
}
.ss-goal { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 6px; }
.ss-goal-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; color: #9ca3af; }
.sg-ring-num { font-size: 26px; font-weight: 800; fill: #111827; }
.sg-ring-goal { font-size: 12px; font-weight: 700; fill: #9ca3af; }

/* ───────── Streak-up celebration (centered overlay) ───────── */
.cwm-overlay.streak-celebrate { align-items: center; }
.sc-card {
  align-items: center; text-align: center;
  border-radius: 20px; max-width: 340px; margin: 0 16px;
  animation: sc-pop 0.35s cubic-bezier(.2,1.2,.3,1);
}
@keyframes sc-pop { from{transform:scale(0.8);opacity:0;} to{transform:scale(1);opacity:1;} }
.sc-flame { font-size: 64px; line-height: 1; animation: sf-pop 0.6s ease 0.1s; }
.sc-number { font-size: 52px; font-weight: 900; color: #F58220; line-height: 1; margin: -6px 0 2px; }
.sc-title { font-size: 20px; font-weight: 800; color: #111827; margin: 4px 0 0; }
.sc-sub { font-size: 14px; color: #6b7280; margin: 0 0 6px; }
