/* ═══════════════════════════════════════════════════════
   DAILY TASK — One mission per day + code + reward
   Astro Bot style, space theme — FITS VIEWPORT, NO SCROLL
   ═══════════════════════════════════════════════════════ */

/* ── Page — fill viewport, center everything ───── */
.dl-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  height: 100dvh;
  height: 100vh;
  box-sizing: border-box;
  align-items: center;
}

/* ── Header — compact ──────────────────────────── */
.dl-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  flex-shrink: 0;
}
.dl-back {
  padding: 8px 16px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text2);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  flex-shrink: 0;
}
.dl-back:hover { background: var(--glass2); color: var(--text); border-color: var(--border2); }
.dl-header-center { flex: 1; }
.dl-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 24px;
  color: var(--text);
  text-shadow: 0 0 20px rgba(46,213,115,0.3);
  line-height: 1.1;
}
.dl-subtitle { font-size: 12px; color: var(--text3); font-weight: 600; margin-top: 1px; }
.dl-header-spacer { width: 80px; flex-shrink: 0; }

/* ═══════════════════════════════════════════════════
   TASK CARD — compact, centered
   ═══════════════════════════════════════════════════ */

.dl-card {
  position: relative;
  width: 100%;
  max-width: 700px;
  background: var(--glass);
  border: 1px solid rgba(46,213,115,0.25);
  border-radius: 20px;
  padding: 24px 32px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25), 0 0 60px rgba(46,213,115,0.06);
  overflow: hidden;
  animation: dlCardIn 0.5s ease;
  flex-shrink: 1;
}
@keyframes dlCardIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dl-card-glow {
  position: absolute;
  top: -30%;
  left: 50%;
  transform: translateX(-50%);
  width: 240px;
  height: 240px;
  background: radial-gradient(circle, rgba(46,213,115,0.08) 0%, transparent 70%);
  pointer-events: none;
  animation: dlGlowPulse 4s ease-in-out infinite;
}
@keyframes dlGlowPulse {
  0%, 100% { opacity: 0.5; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.1); }
}

.dl-card-icon {
  font-size: 48px;
  animation: dlIconBounce 2s ease-in-out infinite;
  position: relative;
  z-index: 1;
  line-height: 1;
}
@keyframes dlIconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.dl-date {
  font-size: 12px;
  font-weight: 700;
  color: rgba(46,213,115,0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  position: relative;
  z-index: 1;
  line-height: 1;
}

.dl-task-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 26px;
  color: var(--text);
  position: relative;
  z-index: 1;
  line-height: 1.15;
}

.dl-task-desc {
  font-size: 15px;
  color: var(--text2);
  line-height: 1.4;
  max-width: 550px;
  position: relative;
  z-index: 1;
}

.dl-task-steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 650px;
  position: relative;
  z-index: 1;
}

.dl-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  flex: 1 1 180px;
  max-width: 300px;
  min-width: 160px;
  background: rgba(46,213,115,0.06);
  border: 1px solid rgba(46,213,115,0.12);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text);
  text-align: left;
  line-height: 1.3;
}

.dl-step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(46,213,115,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
  color: #2ed573;
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════
   CODE INPUT — compact row
   ═══════════════════════════════════════════════════ */

.dl-code-section {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  z-index: 1;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.dl-code-label {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
}

.dl-code-hint {
  font-size: 11px;
  color: var(--text3);
  line-height: 1.3;
}

.dl-code-row {
  display: flex;
  gap: 8px;
}

.dl-code-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid rgba(46,213,115,0.35);
  background: rgba(46,213,115,0.08);
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 18px;
  text-align: center;
  letter-spacing: 3px;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.dl-code-input:focus {
  border-color: rgba(46,213,115,0.5);
  box-shadow: 0 0 20px rgba(46,213,115,0.15);
}
.dl-code-input::placeholder {
  color: var(--text3);
  letter-spacing: 1px;
  font-size: 13px;
}

.dl-code-btn {
  padding: 10px 20px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #2ed573, #00b894);
  color: #fff;
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.dl-code-btn:hover { filter: brightness(1.15); transform: translateY(-1px); }
.dl-code-btn:active { transform: translateY(0); }

/* Shake on wrong code */
.dl-code-section.shake {
  animation: dlShake 0.5s ease;
}
@keyframes dlShake {
  0%, 100% { transform: translateX(0); }
  15% { transform: translateX(-8px); }
  30% { transform: translateX(8px); }
  45% { transform: translateX(-6px); }
  60% { transform: translateX(4px); }
  75% { transform: translateX(-2px); }
}

.dl-code-error {
  font-size: 11px;
  color: #ff6b6b;
  text-align: center;
  min-height: 16px;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════
   REWARD — centered overlay-style
   ═══════════════════════════════════════════════════ */

.dl-reward {
  width: 100%;
  max-width: 600px;
  animation: dlRewardIn 0.6s ease;
  flex-shrink: 1;
}
@keyframes dlRewardIn {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.dl-reward-card {
  background: linear-gradient(135deg, rgba(46,213,115,0.12), rgba(0,184,148,0.08));
  border: 2px solid rgba(46,213,115,0.35);
  border-radius: 20px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: 0 8px 40px rgba(46,213,115,0.15);
  animation: dlRewardGlow 2s ease-in-out infinite;
}
@keyframes dlRewardGlow {
  0%, 100% { box-shadow: 0 8px 40px rgba(46,213,115,0.15); }
  50% { box-shadow: 0 8px 60px rgba(46,213,115,0.3); }
}

.dl-reward-stars {
  font-size: 36px;
  animation: dlStarsBounce 0.8s ease infinite;
  line-height: 1;
}
@keyframes dlStarsBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.dl-reward-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 24px;
  color: var(--text);
  line-height: 1.1;
}

.dl-reward-text {
  font-size: 14px;
  color: var(--text2);
  line-height: 1.4;
}

.dl-reward-earned {
  font-size: 16px;
  font-weight: 800;
  color: #ffd32a;
  padding: 8px 16px;
  background: rgba(255,211,42,0.1);
  border: 1px solid rgba(255,211,42,0.2);
  border-radius: 10px;
}

.dl-reward-home {
  display: inline-flex;
  padding: 10px 24px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
  margin-top: 4px;
}
.dl-reward-home:hover { background: var(--glass2); border-color: var(--border2); }

/* ═══════════════════════════════════════════════════
   DONE STATE (already completed today)
   ═══════════════════════════════════════════════════ */

.dl-done-card {
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
}

.dl-done-icon { font-size: 48px; line-height: 1; }
.dl-done-title {
  font-family: 'Luckiest Guy', cursive;
  font-size: 24px;
  color: var(--text);
  line-height: 1.1;
}
.dl-done-text { font-size: 13px; color: var(--text2); line-height: 1.5; }
.dl-done-stars {
  font-size: 15px;
  font-weight: 800;
  color: #ffd32a;
  padding: 6px 14px;
  background: rgba(255,211,42,0.1);
  border-radius: 10px;
}

/* ═══════════════════════════════════════════════════
   CONFETTI OVERLAY
   ═══════════════════════════════════════════════════ */

.dl-confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}
.dl-confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  animation: dlConfettiFall 2s ease-out forwards;
}
@keyframes dlConfettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .dl-page { padding: 12px 14px 14px; gap: 12px; }
  .dl-card { padding: 20px 20px 18px; border-radius: 18px; gap: 10px; }
  .dl-card-icon { font-size: 40px; }
  .dl-task-title { font-size: 22px; }
  .dl-task-desc { font-size: 13px; max-width: 100%; }
  .dl-task-steps { max-width: 100%; }
  .dl-step { flex: 1 1 140px; min-width: 130px; padding: 6px 10px; font-size: 11px; }
  .dl-code-section { max-width: 100%; }
  .dl-code-input { font-size: 16px; padding: 10px 12px; }
  .dl-header-spacer { display: none; }
}

@media (max-width: 480px) {
  .dl-page { padding: 8px 8px 12px; gap: 10px; }
  .dl-title { font-size: 18px; }
  .dl-subtitle { font-size: 10px; }
  .dl-card { padding: 16px 14px 14px; border-radius: 16px; gap: 8px; }
  .dl-card-icon { font-size: 32px; }
  .dl-task-title { font-size: 18px; }
  .dl-task-desc { font-size: 12px; }
  .dl-step-num { width: 18px; height: 18px; font-size: 10px; }
  .dl-step { padding: 5px 8px; font-size: 10px; }
  .dl-code-row { flex-direction: column; }
  .dl-code-btn { padding: 10px; }
  .dl-reward-card { padding: 22px 16px; }
  .dl-reward-stars { font-size: 28px; }
  .dl-reward-title { font-size: 20px; }
  .dl-done-card { padding: 28px 18px; }
  .dl-back { font-size: 11px; padding: 6px 12px; }
}
