/* ============================================================================
   Daily Coins — the daily check-in / streak sheet
   ----------------------------------------------------------------------------
   Aurora-glass rebuild of #dailyRewardsModal in the "tasks centre" shape:
   a dismissible notice, a streak progress row, a grid of day tiles paying
   coins, and one gradient CTA. Markup: views/partials/dashboard-modals.hbs.
   Tiles are rendered by renderDailyRewardsStreak() in public/js/user-points.js.

   Scoped under .dc-modal so it never leaks into the legacy .streak-* rules
   still living in user-points.css (used by the profile page).
   ========================================================================== */

.dc-modal {
  --dc-bg: var(--surface-sunken);
  --dc-elev: rgba(0, 0, 0, 0.045);
  --dc-elev-2: rgba(0, 0, 0, 0.075);
  --dc-line: var(--line);
  --dc-line-soft: var(--line-soft);
  --dc-text: var(--ink);
  --dc-text-soft: var(--ink-soft);
  --dc-text-muted: var(--ink-muted);
  --dc-brand: #777777;
  --dc-brand-light: var(--brand-fill);
  --dc-gold: #d79000;
  --dc-grad: linear-gradient(105deg, #636363 0%, #777777 52%, #7e7e7e 118%);
  --dc-grad-hover: linear-gradient(105deg, #575757 0%, #6c6c6c 50%, #6c6c6c 118%);
}

/* ID-scoped so these beat the legacy `#dailyRewardsModal .modal-dialog/.modal-content`
   sizing rules still in user-points.css (same specificity, loaded later). */
#dailyRewardsModal .modal-dialog {
  max-width: 520px;
  width: calc(100% - 1.5rem);
  height: auto;
  margin-top: 1.75rem;
  margin-bottom: 1.75rem;
}

#dailyRewardsModal .dc-panel {
  background:
    radial-gradient(120% 80% at 50% -18%, rgba(119, 119, 119, 0.18), transparent 62%),
    var(--dc-bg);
  border: 1px solid var(--dc-line);
  border-radius: 22px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 820px);
}

/* ── Head ─────────────────────────────────────────────────────────────── */
.dc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
}

.dc-head-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.dc-head-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  border: 1px solid rgba(187, 125, 0, 0.32);
  background: rgba(187, 125, 0, 0.13);
}

.dc-head-icon img { display: block; }

.dc-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--dc-text);
  line-height: 1.2;
}

.dc-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--dc-line);
  border-radius: 11px;
  background: var(--dc-elev);
  color: var(--dc-text-soft);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.dc-close:hover { background: var(--dc-elev-2); color: var(--dc-text); }
.dc-close:active { transform: scale(0.94); }

/* ── Body ─────────────────────────────────────────────────────────────── */
.dc-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 4px 20px 20px;
}

.dc-body::-webkit-scrollbar { display: none; }

/* ── Notice ───────────────────────────────────────────────────────────── */
.dc-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 14px 14px 13px;
  border: 1px solid rgba(119, 119, 119, 0.38);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(119, 119, 119, 0.17), rgba(126, 126, 126, 0.07));
  margin-bottom: 18px;
}

.dc-notice.is-hidden { display: none; }

.dc-notice-emoji { font-size: 18px; line-height: 1.4; flex: 0 0 auto; }

.dc-notice-text {
  flex: 1;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ink);
}

.dc-notice-close {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.dc-notice-close:hover { background: var(--glass-strong); color: var(--ink); }

/* ── Section head ─────────────────────────────────────────────────────── */
.dc-section-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 12px;
}

.dc-section-emoji { font-size: 18px; }

.dc-section-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--dc-text);
}

.dc-section-meta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--dc-text-muted);
  white-space: nowrap;
}

.dc-section-meta i { color: #c96100; font-size: 13px; }
.dc-section-meta .streak-count { color: var(--dc-text); font-weight: 700; }

/* ── Progress row ─────────────────────────────────────────────────────── */
.dc-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--dc-line-soft);
  border-radius: 15px;
  background: var(--veil);
  margin-bottom: 12px;
}

.dc-progress-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--dc-brand-light);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.dc-progress-dots {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  overflow: hidden;
  min-width: 0;
}

.dc-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--scrim-soft);
}

.dc-dot.is-done { background: var(--dc-brand-light); box-shadow: 0 0 8px rgba(0, 0, 0, 0.06); }
.dc-dot.is-today { background: var(--dc-gold); box-shadow: 0 0 8px rgba(0, 0, 0, 0.06); }

.dc-progress-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 12px;
  border: 1px solid var(--dc-line);
  border-radius: 999px;
  background: var(--dc-elev);
  color: var(--dc-text-soft);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.dc-progress-chip.is-member {
  border-color: rgba(187, 125, 0, 0.42);
  background: rgba(187, 125, 0, 0.14);
  color: var(--dc-gold);
}

/* ── Note ─────────────────────────────────────────────────────────────── */
.dc-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 2px 16px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--dc-text-muted);
}

.dc-note-emoji { flex: 0 0 auto; }

/* ── Day grid ─────────────────────────────────────────────────────────── */
.dc-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.dc-grid-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 0;
  font-size: 13px;
  color: var(--dc-text-muted);
}

.dc-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px 11px;
  border: 1px solid var(--dc-line-soft);
  border-radius: 14px;
  background: var(--veil);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.dc-day-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--dc-text-soft);
  line-height: 1;
}

.dc-day-payout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--dc-text);
  line-height: 1;
}

.dc-day-payout img { display: block; }

/* Completed — already collected */
.dc-day.is-completed {
  background: var(--glass-strong);
  border-color: var(--line-strong);
}

.dc-day.is-completed .dc-day-label,
.dc-day.is-completed .dc-day-payout { color: var(--dc-brand-light); }

/* Today — the one tile that can be claimed */
.dc-day.is-current {
  cursor: pointer;
  background: linear-gradient(180deg, rgba(187, 125, 0, 0.18), rgba(187, 125, 0, 0.05));
  border-color: rgba(187, 125, 0, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 8px 22px rgba(0, 0, 0, 0.06);
}

.dc-day.is-current:hover { transform: translateY(-2px); }
.dc-day.is-current .dc-day-label { color: var(--dc-gold); font-weight: 700; }

/* Future — dimmed */
.dc-day.is-future { opacity: 0.55; }

/* Corner badge: 🏆 weekly / 👑 day 30 only. Collected days carry no badge —
   see renderDailyRewardsStreak(). */
.dc-day-badge {
  position: absolute;
  top: -7px;
  right: -5px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 11px;
  line-height: 1;
  background: var(--surface-sunken);
  border: 1px solid var(--dc-line);
}

.dc-day-badge.is-milestone { border-color: rgba(187, 125, 0, 0.55); background: rgba(60, 44, 12, 0.95); }

/* Pool tile — the maximum a full run pays out */
.dc-pool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 6px;
  border: 1px solid rgba(187, 125, 0, 0.5);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(187, 125, 0, 0.16), rgba(187, 125, 0, 0.04));
  text-align: center;
}

.dc-pool-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dc-gold);
  line-height: 1.2;
}

.dc-pool-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
}

.dc-pool-sub { font-size: 10.5px; color: var(--dc-text-muted); }

/* ── Claim block ──────────────────────────────────────────────────────── */
/* First thing in the body: the CTA used to sit under 30 day tiles, so claiming
   meant scrolling to the bottom of the sheet. */
.dc-claim {
  padding: 14px 16px 16px;
  border: 1px solid var(--dc-line-soft);
  border-radius: 18px;
  background: var(--veil);
  margin: 4px 0 18px;
}

.dc-claim-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dc-claim-label { font-size: 13.5px; color: var(--dc-text-soft); font-weight: 600; }

.dc-claim-amount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 20px;
  font-weight: 800;
  color: var(--dc-gold);
  line-height: 1;
}

.dc-claim-amount img { display: block; }

.dc-claim-bonus {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--dc-text-muted);
  min-height: 1em;
}

.dc-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  margin-top: 14px;
  border: none;
  border-radius: 14px;
  background: var(--dc-grad);
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.06);
  transition: background 0.2s ease, transform 0.16s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.dc-cta:hover:not(:disabled) {
  background: var(--dc-grad-hover);
  transform: translateY(-1px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.06);
}

.dc-cta:active:not(:disabled) { transform: translateY(0) scale(0.995); }
.dc-cta:disabled { opacity: 0.7; cursor: default; box-shadow: none; }

/* Already collected today — the CTA becomes a calm "done" confirmation. It stays
   enabled on purpose: pressing it clears the sheet, so there is always something
   to hit. */
.dc-cta.is-done {
  background: var(--dc-elev-2);
  color: var(--dc-text-soft);
  box-shadow: none;
}

.dc-cta.is-done:hover { background: var(--dc-elev-2); }

/* Every press pops, claimed or not — the tap is the payoff. */
.dc-cta.is-pressed { animation: dcPop 0.32s ease-out; }

@keyframes dcPop {
  0% { transform: scale(1); }
  38% { transform: scale(0.955); }
  100% { transform: scale(1); }
}

.dc-footnote {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--dc-text-muted);
}

.dc-footnote i { margin-top: 2px; }

/* ── Small screens ────────────────────────────────────────────────────── */
@media (max-width: 575.98px) {
  #dailyRewardsModal .modal-dialog {
    width: 100%;
    max-width: 100%;
    height: auto;
    margin: 0;
    align-items: flex-end;
    min-height: 100%;
  }

  #dailyRewardsModal .dc-panel {
    border-radius: 22px 22px 0 0;
    max-height: 94vh;
    border-bottom: none;
  }

  .dc-head { padding: 16px 16px 10px; }
  .dc-title { font-size: 19px; }
  .dc-body { padding: 4px 16px 18px; }
  .dc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .dc-progress { padding: 12px 13px; gap: 9px; }
  .dc-progress-chip { height: 26px; padding: 0 10px; font-size: 11.5px; }
}

@media (prefers-reduced-motion: reduce) {
  .dc-modal *,
  .dc-modal *::before,
  .dc-modal *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
