/* ============================================================
   progression.css — world map, level select, objectives panel,
   star rating, boss bar. Purely additive: reuses the existing
   --accent-*/--glass-* tokens from themes.css so it matches the
   game's established glassmorphism look without touching it.
   ============================================================ */

.screen.show ~ main.app-shell { display: none; }

/* ---------- full-screen map / select scenes ---------- */
.screen {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 30px;
  overflow-y: auto;
  background: radial-gradient(ellipse 120% 60% at 50% -10%, var(--nebula-1) 0%, transparent 55%),
              radial-gradient(ellipse 90% 50% at 85% 15%, var(--nebula-2) 0%, transparent 50%),
              var(--bg-void);
}
.screen.show { display: flex; }

.screen-header {
  width: 100%;
  max-width: 520px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.screen-header h2 {
  font-family: var(--font-display);
  font-size: 20px;
  margin: 0;
  flex: 1;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-pink));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.icon-btn:active { transform: scale(0.92); }

/* ---------- world map ---------- */
#worldGrid {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.world-node {
  border-radius: 18px;
  padding: 16px 14px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease;
}
.world-node:active { transform: scale(0.96); }
.world-node .wn-icon { font-size: 26px; }
.world-node .wn-name { font-family: var(--font-ui); font-weight: 700; font-size: 14px; margin-top: 6px; }
.world-node .wn-sub { font-size: 10.5px; color: var(--text-dim); margin-top: 2px; }
.world-node .wn-progress { margin-top: 10px; }
.world-node.locked { opacity: 0.42; cursor: not-allowed; filter: grayscale(0.6); }
.world-node.locked::after {
  content: '🔒'; position: absolute; top: 12px; right: 14px; font-size: 16px;
}

/* ---------- level select ---------- */
#levelGrid {
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.level-node {
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  position: relative;
  box-shadow: 0 0 18px rgba(139, 124, 246, 0.25);
  transition: transform 0.15s ease;
}
.level-node:active { transform: scale(0.94); }
.level-node .ln-num { font-family: var(--font-ui); font-weight: 800; font-size: 16px; }
.level-node .ln-stars { font-size: 9px; letter-spacing: 1px; }
.level-node.boss { box-shadow: 0 0 22px rgba(255, 110, 196, 0.55); }
.level-node.boss .ln-num { font-size: 20px; }
.level-node.locked { opacity: 0.35; cursor: not-allowed; filter: grayscale(0.7); box-shadow: none; }
.level-node.locked .ln-stars { display: none; }
.level-node.locked::after { content: '🔒'; position: absolute; font-size: 13px; }
.level-node.locked .ln-num { display: none; }

/* ---------- in-canvas objectives panel (replaces the single quota bar) ---------- */
#objectivesPanel {
  grid-column: 1 / -1;
  border-radius: 14px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#objectivesPanel .obj-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 9.5px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-faint);
  font-family: var(--font-ui);
}
#objectivesPanel .obj-header .constraint { color: var(--accent-gold); font-weight: 700; text-transform: none; letter-spacing: 0; }
.objective-row { display: flex; flex-direction: column; gap: 3px; }
.objective-row .obj-label {
  display: flex; justify-content: space-between; font-size: 10.5px; color: var(--text-dim); font-family: var(--font-ui);
}
.objective-row .obj-label b { color: var(--text-primary); }
.objective-row.done .obj-label { color: var(--accent-green); }
.objective-row .progress-track { height: 6px; }
.objective-row.done .progress-fill { background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan)); }

/* ---------- boss bar ---------- */
#bossBar {
  grid-column: 1 / -1;
  border-radius: 14px;
  padding: 8px 12px;
  display: none;
  flex-direction: column;
  gap: 5px;
}
#bossBar.show { display: flex; }
#bossBar .boss-label { font-size: 10.5px; color: var(--accent-pink); font-family: var(--font-ui); letter-spacing: 0.5px; }
#bossBar .progress-fill { background: linear-gradient(90deg, var(--accent-pink), var(--accent-violet)); box-shadow: 0 0 12px rgba(255, 110, 196, 0.6); }

/* ---------- star rating (level complete overlay) ---------- */
#starRow {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 16px;
}
#starRow .star {
  font-size: 30px;
  opacity: 0.25;
  filter: grayscale(1);
  transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}
#starRow .star.earned {
  opacity: 1;
  filter: none;
  transform: scale(1);
  text-shadow: 0 0 14px rgba(255, 209, 102, 0.8);
}
#starRow .star.earned.pop { animation: starPop 0.5s cubic-bezier(.3,1.6,.4,1); }
@keyframes starPop { 0% { transform: scale(0.3) rotate(-25deg); } 60% { transform: scale(1.25) rotate(8deg); } 100% { transform: scale(1) rotate(0deg); } }

/* ---------- fail banner (out of moves/time, not danger-line related) ---------- */
#missionFailNote { color: var(--accent-red); font-size: 12px; margin-top: 6px; }

/* ---------- row meter ---------- */
#rowMeter {
  width: 100%;
  max-width: 480px;
  border-radius: 12px;
  padding: 6px 12px;
  font-size: 10.5px;
  color: var(--text-dim);
  font-family: var(--font-ui);
  text-align: center;
  margin-top: 8px;
}
#rowMeter b { color: var(--text-primary); }
