/* ============================================================
   screens.css — per-screen layout + responsive breakpoints
   ============================================================ */

/* ---------------- HOME ---------------- */
#screen-home { align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.home-content { position: relative; z-index: 2; max-width: 640px; padding: var(--space-6); }
.game-logo {
  display: inline-flex; align-items: center; gap: var(--space-3);
  font-family: var(--font-display); font-size: clamp(2.2rem, 8vw, 4rem); font-weight: 700;
  line-height: 1; margin-bottom: var(--space-3);
  background: var(--color-yellow); border: var(--bd-thick); border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-5); box-shadow: var(--shadow-lg);
  transform: rotate(-1.5deg);
}
.game-logo .icon { width: 1em; height: 1em; }
.game-tagline { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-3); }
.swachh-badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--color-surface); border: var(--bd-thin); border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-4); font-size: var(--text-sm); font-weight: 700;
  margin-bottom: var(--space-6); box-shadow: var(--shadow-sm);
}
.swachh-badge .icon { width: 1.2em; height: 1.2em; }
.home-splash-img { width: 100%; max-width: 460px; border: var(--bd); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); margin: 0 auto var(--space-6); }
.home-stats-row { display: flex; gap: var(--space-3); justify-content: center; margin-bottom: var(--space-6); flex-wrap: wrap; }
.home-stat { background: var(--color-surface); border: var(--bd-thin); border-radius: var(--radius-md); padding: var(--space-3) var(--space-5); box-shadow: var(--shadow-sm); }
.home-stat-num { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-green-dark); }
.home-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; }
.home-buttons { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); }
.install-hint { font-size: var(--text-xs); color: var(--color-text-muted); text-align: center; max-width: 280px; }

/* ---------------- REGISTER ---------------- */
#screen-register { align-items: center; justify-content: center; padding: var(--space-6); }
.register-card { background: var(--color-surface); border: var(--bd); border-radius: var(--radius-lg); padding: var(--space-6); max-width: 480px; width: 100%; box-shadow: var(--shadow-lg); }
.register-logo { display: flex; justify-content: center; margin-bottom: var(--space-3); }
.register-logo .icon { width: 56px; height: 56px; }
.register-card h2 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; text-align: center; margin-bottom: var(--space-2); }
.register-card > p { color: var(--color-text-muted); text-align: center; margin-bottom: var(--space-5); font-size: var(--text-sm); }
.field-heading { font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-2); }

/* ---------------- LEVEL SELECT ---------------- */
#screen-levelselect { overflow-y: auto; }
.ls-head { padding: var(--space-6) var(--space-4) var(--space-4); text-align: center; }
.ls-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--space-1); }
#player-greeting { font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-2); }
#total-score-display { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; background: var(--color-yellow); border: var(--bd-thin); border-radius: var(--radius-sm); padding: 2px var(--space-4); box-shadow: var(--shadow-sm); }
#total-score-display .icon { width: 1em; height: 1em; }
#policy-unlock-label { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: var(--space-2); font-weight: 600; }
.level-selector { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); padding: var(--space-4); max-width: 640px; margin: 0 auto; width: 100%; }
.level-btn { background: var(--color-surface); border: var(--bd); border-radius: var(--radius-md); padding: var(--space-4) var(--space-3); text-align: center; position: relative; box-shadow: var(--shadow-sm); transition: transform var(--transition), box-shadow var(--transition); }
.level-btn.unlocked { cursor: pointer; }
.level-btn.unlocked:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-md); }
.level-btn.unlocked:active { transform: translate(2px,2px); box-shadow: var(--shadow-press); }
.level-btn.locked { opacity: 0.5; cursor: not-allowed; }
.level-btn.completed { background: var(--color-surface-2); }
.level-btn-icon { width: 40px; height: 40px; margin: 0 auto var(--space-2); }
.level-btn-icon .icon { width: 100%; height: 100%; }
.level-btn-name { font-family: var(--font-display); font-size: var(--text-sm); font-weight: 700; margin-bottom: 4px; }
.level-btn-mode { font-size: 10px; color: var(--color-text-muted); margin-bottom: 4px; display: inline-flex; align-items: center; gap: 3px; justify-content: center; }
.level-btn-mode .icon { width: 12px; height: 12px; }
.level-btn-stars { display: inline-flex; gap: 2px; }
.level-btn-stars .icon { width: 16px; height: 16px; }
.level-btn-score { font-size: 10px; color: var(--color-gold); font-weight: 700; margin-top: 2px; }
.level-btn-lock { position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; }

/* ---------------- GAME ARENA ---------------- */
#screen-game { overflow: hidden; }
.game-arena { flex: 1; display: flex; flex-direction: column; align-items: center; padding: var(--space-4); gap: var(--space-4); position: relative; overflow: hidden; min-height: 0; }
#mode-label { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; background: var(--color-surface); border: var(--bd-thin); border-radius: var(--radius-sm); padding: 2px var(--space-3); box-shadow: var(--shadow-press); }
#mode-label .icon { width: 14px; height: 14px; }
.level-banner { text-align: center; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
#sorting-panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: var(--space-4); }

/* ---------------- QUIZ PANEL ---------------- */
#quiz-panel { width: 100%; padding: 0 var(--space-2); }
.quiz-panel { background: var(--color-surface); border: var(--bd); border-radius: var(--radius-lg); padding: var(--space-5); max-width: 600px; width: 100%; margin: auto; box-shadow: var(--shadow-md); }
.quiz-q-num { font-size: var(--text-xs); color: var(--color-text-muted); margin: var(--space-2) 0; text-transform: uppercase; font-weight: 700; }
.quiz-question { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-4); line-height: 1.3; }
.quiz-options { display: flex; flex-direction: column; gap: var(--space-3); }

/* ---------------- LEVEL COMPLETE ---------------- */
#screen-level-complete { align-items: center; justify-content: center; text-align: center; padding: var(--space-6); }
.lc-wrap { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: var(--space-6); width: 100%; }
.level-complete-card { background: var(--color-surface); border: var(--bd); border-radius: var(--radius-lg); padding: var(--space-6); max-width: 500px; width: 100%; box-shadow: var(--shadow-lg); }
.lc-trophy { width: 76px; height: 76px; margin: 0 auto var(--space-2); animation: trophy-bounce 0.9s ease; }
.lc-trophy .icon { width: 100%; height: 100%; }
@keyframes trophy-bounce { 0%{transform:scale(0) rotate(-16deg)} 60%{transform:scale(1.15) rotate(8deg)} 100%{transform:scale(1)} }
.lc-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--space-2); }
.lc-level-name { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-lg); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.lc-level-name .icon { width: 1.1em; height: 1.1em; }
.lc-stars { display: flex; justify-content: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.lc-star { width: 42px; height: 42px; animation: star-pop 0.4s ease forwards; opacity: 0; }
.lc-star:nth-child(1){animation-delay:0.15s} .lc-star:nth-child(2){animation-delay:0.4s} .lc-star:nth-child(3){animation-delay:0.65s}
@keyframes star-pop { 0%{transform:scale(0);opacity:0} 70%{transform:scale(1.3);opacity:1} 100%{transform:scale(1);opacity:1} }
.lc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); margin-bottom: var(--space-5); }
.lc-stat { background: var(--color-surface-2); border: var(--bd-thin); border-radius: var(--radius-sm); padding: var(--space-3); box-shadow: var(--shadow-press); }
.lc-stat-val { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-green-dark); }
.lc-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); text-transform: uppercase; font-weight: 600; }
.lc-policy-unlock { background: var(--color-surface-2); border: var(--bd-thin); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-5); text-align: left; }
.lc-policy-unlock-title { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); font-weight: 800; margin-bottom: var(--space-2); }
.lc-policy-unlock-title .icon { width: 1.1em; height: 1.1em; }
.lc-policy-unlock-text { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; }
.lc-buttons { display: flex; gap: var(--space-3); justify-content: center; flex-wrap: wrap; }

/* ---------------- LEADERBOARD ---------------- */
#screen-leaderboard { overflow-y: auto; }
.lb-header { background: var(--color-surface); padding: var(--space-6) var(--space-6) var(--space-5); border-bottom: var(--bd); text-align: center; }
.lb-title { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--space-2); }
.lb-title .icon { width: 1em; height: 1em; }
.lb-tabs { display: flex; gap: var(--space-2); justify-content: center; margin-top: var(--space-4); }
.lb-tab { padding: var(--space-2) var(--space-4); border: var(--bd-thin); border-radius: var(--radius-sm); font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); background: var(--color-surface); box-shadow: var(--shadow-press); }
.lb-tab.active { background: var(--color-yellow); box-shadow: var(--shadow-sm); }
.lb-content { padding: var(--space-4); max-width: 700px; margin: 0 auto; width: 100%; }
.lb-your-rank-banner { background: var(--color-surface-2); border: var(--bd); border-radius: var(--radius-md); padding: var(--space-4); margin-bottom: var(--space-4); text-align: center; box-shadow: var(--shadow-sm); }
.lb-your-rank-banner h3 { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.lb-your-rank-banner h3 .icon { width: 1.2em; height: 1.2em; }
.lb-your-rank-banner p { font-size: var(--text-sm); color: var(--color-text-muted); }
.lb-rank-card { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); margin-bottom: var(--space-3); background: var(--color-surface); border: var(--bd); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); }
.lb-rank-card.rank-1 { background: #FEF7DC; }
.lb-rank-card.is-me { background: #E8F9EE; }
.lb-rank-num { display: inline-flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; min-width: 34px; }
.lb-rank-num .icon { width: 26px; height: 26px; }
.lb-avatar-circle { width: 44px; height: 44px; border: var(--bd-thin); border-radius: var(--radius-sm); background: var(--color-surface-2); overflow: hidden; flex-shrink: 0; padding: 2px; }
.lb-avatar-circle .icon { width: 100%; height: 100%; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 800; font-size: var(--text-base); }
.lb-location { display: inline-flex; align-items: center; gap: 3px; font-size: var(--text-xs); color: var(--color-text-muted); }
.lb-location .icon { width: 12px; height: 12px; }
.lb-level-badge { display: inline-block; background: var(--color-surface-2); border: var(--bd-thin); border-radius: var(--radius-sm); padding: 1px var(--space-2); font-size: var(--text-xs); font-weight: 700; margin-top: 2px; }
.you-badge { background: var(--color-green); border: var(--bd-thin); border-radius: var(--radius-sm); padding: 0 6px; font-size: 10px; font-weight: 800; }
.lb-score-col { text-align: right; }
.lb-score-val { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
.lb-score-label { font-size: var(--text-xs); color: var(--color-text-muted); }

/* ---------------- POLICIES ---------------- */
#screen-policies { overflow-y: auto; }
.policy-header { background: var(--color-surface); padding: var(--space-6); border-bottom: var(--bd); text-align: center; }
.policy-header h2 { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; margin-bottom: var(--space-2); }
.policy-header h2 .icon { width: 1em; height: 1em; }
.policy-header > p { color: var(--color-text-muted); font-size: var(--text-sm); }
#policy-unlock-progress-text { font-size: var(--text-sm); color: var(--color-gold); margin-top: var(--space-2); font-weight: 700; }
.policy-grid { display: grid; grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-4); max-width: 1000px; margin: 0 auto; width: 100%; }
.policy-card { background: var(--color-surface); border: var(--bd); border-radius: var(--radius-md); padding: var(--space-5); position: relative; overflow: hidden; box-shadow: var(--shadow-sm); }
.policy-card.locked { opacity: 0.55; }
.policy-card-icon { width: 44px; height: 44px; margin-bottom: var(--space-3); }
.policy-card-icon .icon { width: 100%; height: 100%; }
.policy-card-title { font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin-bottom: var(--space-2); }
.policy-card-desc { font-size: var(--text-sm); color: var(--color-text-muted); line-height: 1.5; margin-bottom: var(--space-3); }
.policy-card-lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); background: rgba(250,244,230,0.85); }
.policy-card-lock .icon { width: 32px; height: 32px; }
.policy-card-lock p { font-size: var(--text-sm); color: var(--color-text-muted); text-align: center; }
.policy-card-level { position: absolute; top: 10px; right: 12px; font-size: var(--text-xs); font-weight: 700; color: var(--color-text-faint); }

/* ---------------- REWARDS ---------------- */
#screen-rewards { overflow-y: auto; }
.rewards-inner { padding: var(--space-6) var(--space-4) var(--space-4); width: 100%; max-width: 720px; margin: 0 auto; }
.rewards-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; text-align: center; margin-bottom: var(--space-1); display: inline-flex; align-items: center; gap: var(--space-2); justify-content: center; width: 100%; }
.rewards-title .icon { width: 1em; height: 1em; }
.rewards-sub { text-align: center; color: var(--color-text-muted); font-size: var(--text-sm); margin-bottom: var(--space-4); }
.rewards-section-title { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin: var(--space-5) 0 var(--space-3); }
.rewards-section-title .icon { width: 1.1em; height: 1.1em; }
.daily-reward-strip { display: flex; gap: var(--space-2); overflow-x: auto; padding: 4px 2px var(--space-2); }
.daily-day { flex: 0 0 auto; min-width: 76px; background: var(--color-surface); border: var(--bd-thin); border-radius: var(--radius-sm); padding: var(--space-2); text-align: center; box-shadow: var(--shadow-press); }
.daily-day.claimed { background: #E8F9EE; }
.daily-day.next { background: var(--color-yellow); box-shadow: var(--shadow-sm); animation: daily-pulse 1.6s ease-in-out infinite; }
@keyframes daily-pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.05)} }
.daily-day-num { font-size: 9px; color: var(--color-text-muted); font-weight: 700; text-transform: uppercase; }
.daily-day-icon { width: 26px; height: 26px; margin: 4px auto; }
.daily-day-icon .icon { width: 100%; height: 100%; }
.daily-day-label { font-size: 10px; font-weight: 800; }
.rewards-achievement-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }

/* ---------------- PROFILE ---------------- */
#screen-profile { overflow-y: auto; }
.profile-inner { padding: var(--space-6) var(--space-4); width: 100%; max-width: 560px; margin: 0 auto; }
.profile-title { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 700; text-align: center; margin-bottom: var(--space-4); }
.profile-card { background: var(--color-surface); border: var(--bd); border-radius: var(--radius-lg); padding: var(--space-5); text-align: center; box-shadow: var(--shadow-md); }
.profile-avatar-large { width: 72px; height: 72px; margin: 0 auto var(--space-2); border: var(--bd); border-radius: var(--radius-md); padding: 4px; background: var(--color-surface-2); }
.profile-avatar-large .icon { width: 100%; height: 100%; }
.profile-name { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; margin-bottom: var(--space-1); }
.profile-location { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-sm); color: var(--color-text-muted); margin-bottom: var(--space-4); }
.profile-location .icon { width: 14px; height: 14px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); }
.profile-stat-num { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 700; color: var(--color-green-dark); }
.profile-stat-label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; }
.profile-badges-title { display: inline-flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; margin: var(--space-5) 0 var(--space-3); justify-content: center; width: 100%; }
.profile-badges-title .icon { width: 1.1em; height: 1.1em; }
.badge-grid { display: flex; flex-wrap: wrap; gap: var(--space-2); justify-content: center; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (min-width: 480px) {
  .bins-row { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 600px) {
  .level-selector { grid-template-columns: repeat(3, 1fr); }
  .policy-grid { grid-template-columns: repeat(2, 1fr); }
  .lc-stats { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 960px) {
  .level-selector { grid-template-columns: repeat(4, 1fr); max-width: 860px; }
  .policy-grid { grid-template-columns: repeat(3, 1fr); }
  .game-arena { padding: var(--space-6); }
}
/* very small phones: relax HUD + logo */
@media (max-width: 360px) {
  .game-header { gap: var(--space-1); padding: var(--space-1) var(--space-2); }
  .hud-block { min-width: 44px; }
  .home-stats-row { gap: var(--space-2); }
  .game-logo { padding: var(--space-2) var(--space-3); }
}
