/* =====================================================================
 * /css/qk-daily-reward.css — daily-reward modal (before + after claim)
 *
 * Hoisted from design-imports/before-claim.html + after-claim.html, with
 * the local :root blocks dropped. Tokens from stake.css. Same `.dr-*`
 * namespace the design uses so JS can swap states by toggling classes.
 * =================================================================== */

.dr-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(5, 8, 18, .8);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  animation: drFadeIn .35s ease;
}
@keyframes drFadeIn { from { opacity: 0; } to { opacity: 1; } }

.dr-modal {
  position: relative;
  width: 480px;
  max-width: 100%;
  /* Cap to viewport with the backdrop's 24px padding on each side so on
     short screens (≤ ~700 px tall) the modal becomes scrollable inside
     the backdrop instead of bleeding off the top — flex `align-items:
     center` alone doesn't constrain overflow. */
  max-height: calc(100vh - 48px);
  background:
    radial-gradient(ellipse at 50% -10%, rgba(127, 248, 0, .16), transparent 60%),
    var(--s-bg-2);
  border: 1px solid var(--s-line);
  border-radius: 18px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 0 1px rgba(127, 248, 0, .08);
  padding: 28px 28px 24px;
  text-align: center;
  /* Confetti + accent strip use absolute positioning, but we still need
     vertical scrolling when content exceeds max-height. overflow-y: auto
     keeps confetti within the modal frame while letting the body scroll. */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: drCardIn .45s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes drCardIn {
  from { opacity: 0; transform: translateY(12px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
.dr-modal::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--s-green), transparent);
  opacity: .7;
}
.dr-modal.dr-success {
  border-color: rgba(127, 248, 0, .3);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), 0 0 40px rgba(127, 248, 0, .2);
}

.dr-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--s-muted-2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  font-family: inherit;
  transition: background .15s, color .15s, border-color .15s;
}
.dr-close:hover {
  background: var(--s-bg-3);
  color: var(--s-text);
  border-color: var(--s-line);
}

/* ---- Kicker (state-dependent) ---- */
.dr-kicker {
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--s-green);
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.dr-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--s-green);
  box-shadow: 0 0 8px var(--s-green);
  animation: drPulse 1.6s infinite;
}
@keyframes drPulse { 0%, 100% { opacity: .5; } 50% { opacity: 1; } }

.dr-kicker.success {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(127, 248, 0, .1);
  border: 1px solid rgba(127, 248, 0, .4);
  animation: drCheckIn .5s cubic-bezier(.2, .8, .2, 1) both .1s;
}
.dr-kicker.success::before { display: none; }
.dr-kicker.success .dr-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--s-green);
  color: #061108;
  font-weight: 900;
  font-size: 11px;
}
@keyframes drCheckIn {
  from { opacity: 0; transform: scale(.8); }
  to   { opacity: 1; transform: none; }
}

/* ---- Illustration slot ---- */
.dr-ill {
  position: relative;
  height: 160px;
  margin: 4px auto 14px;
  width: 260px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse at 50% 110%, rgba(255, 209, 102, .35), transparent 70%),
    radial-gradient(ellipse at 50% 40%, rgba(127, 248, 0, .15), transparent 70%);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Variant when an actual <img> is mounted — drop the dashed placeholder
   border and let the image fill the frame. */
.dr-ill.has-img { border: 0; }
.dr-ill-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Post-claim "you got it" hero — hand-authored inline SVG (see
   qk-daily-reward.js openAfter). Single colour via currentColor on
   .dr-hero-after, which the .success kicker picks up — clean lime
   ring + checkmark + 12 radiating sparks. */
.dr-hero-after {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 6px auto 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--s-green, #7ff800);
  filter: drop-shadow(0 0 22px rgba(127, 248, 0, .45));
  animation: drHeroAfterPop .55s cubic-bezier(.2, 1.4, .3, 1) both;
}
.dr-hero-after-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.dr-hero-after .dr-sparks {
  transform-origin: 60px 60px;
  animation: drSparksRotate 6s linear infinite;
}
@keyframes drHeroAfterPop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes drSparksRotate {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .dr-hero-after, .dr-hero-after .dr-sparks { animation: none; }
}

/* ---- Big figure ---- */
.dr-amount {
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
  background: linear-gradient(180deg, #d6ff7a 0%, var(--s-green) 55%, #4da200 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  text-shadow: 0 0 40px rgba(127, 248, 0, .35);
  filter: drop-shadow(0 8px 20px rgba(127, 248, 0, .2));
  margin: 0 0 4px;
  font-variant-numeric: tabular-nums;
}
.dr-modal.dr-success .dr-amount {
  font-size: 84px;
  animation: drAmountPop .6s cubic-bezier(.2, 1.3, .3, 1) both .2s;
}
@keyframes drAmountPop {
  from { transform: scale(.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
.dr-amount-sub {
  color: var(--s-muted);
  font-size: 13px;
  margin: 0 0 18px;
}

/* ---- Streak row ---- */
.dr-streak {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--s-line);
  border-radius: 12px;
  margin: 0 0 18px;
  position: relative;
}
.dr-streak::before {
  content: "";
  position: absolute;
  left: 26px;
  right: 26px;
  top: 24px;
  height: 2px;
  background: var(--s-bg-4);
  z-index: 0;
}
.dr-day {
  flex: 1;
  max-width: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 0;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}
.dr-day .dr-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  background: var(--s-bg-3);
  border: 1px solid var(--s-line);
  color: var(--s-muted);
  transition: all .2s;
}
.dr-day.done .dr-circle {
  background: rgba(127, 248, 0, .12);
  border-color: rgba(127, 248, 0, .45);
  color: var(--s-green);
}
.dr-day.done .dr-circle::after {
  content: "\2713";
  font-size: 12px;
}
.dr-day.done .dr-circle .dr-n { display: none; }
.dr-day.current .dr-circle {
  background: var(--s-green);
  color: #061108;
  border-color: var(--s-green);
  box-shadow: 0 0 0 4px rgba(127, 248, 0, .18), 0 0 18px rgba(127, 248, 0, .5);
  animation: drCurBeat 1.8s ease-in-out infinite;
}
@keyframes drCurBeat {
  0%, 100% { box-shadow: 0 0 0 4px rgba(127, 248, 0, .18), 0 0 18px rgba(127, 248, 0, .5); }
  50%      { box-shadow: 0 0 0 7px rgba(127, 248, 0, .08), 0 0 26px rgba(127, 248, 0, .65); }
}
.dr-day.just .dr-circle {
  background: var(--s-green);
  color: #061108;
  border-color: var(--s-green);
  box-shadow: 0 0 0 4px rgba(127, 248, 0, .15), 0 0 16px rgba(127, 248, 0, .5);
  animation: drJust .8s cubic-bezier(.2, 1.3, .3, 1) both .4s;
}
.dr-day.just .dr-circle::after { content: "\2713"; }
.dr-day.just .dr-circle .dr-n { display: none; }
@keyframes drJust {
  0%   { transform: scale(.3); opacity: 0; }
  60%  { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(1); }
}
.dr-day .dr-lbl {
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--s-muted-2);
  font-weight: 800;
}
.dr-day.current .dr-lbl,
.dr-day.just .dr-lbl { color: var(--s-green); }
.dr-day.done .dr-lbl { color: var(--s-muted); }
.dr-day .dr-amt {
  font-size: 10px;
  font-weight: 800;
  color: var(--s-muted-2);
  font-variant-numeric: tabular-nums;
}
.dr-day.current .dr-amt { color: var(--s-text); }

/* ---- CTA button (primary) ---- */
.dr-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 24px;
  background: var(--s-green);
  color: #061108;
  border: 0;
  border-radius: 12px;
  font-weight: 900;
  font-size: 14px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s;
  box-shadow: 0 10px 24px rgba(127, 248, 0, .28);
  font-family: inherit;
}
.dr-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(127, 248, 0, .55), 0 10px 24px rgba(127, 248, 0, .35);
}
.dr-cta:active  { transform: translateY(0); }
.dr-cta:disabled {
  opacity: .6;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.dr-foot {
  margin-top: 10px;
  font-size: 11px;
  color: var(--s-muted-2);
  letter-spacing: .06em;
}
.dr-foot b { color: var(--s-muted); font-weight: 700; }

/* ---- Balance bump chip (after-claim only) ---- */
.dr-balance {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--s-bg);
  border: 1px solid var(--s-line);
  border-radius: 10px;
  font-family: ui-monospace, monospace;
  font-size: 13px;
  margin: 0 0 18px;
}
.dr-balance .dr-bal-lbl { color: var(--s-muted-2); font-weight: 700; letter-spacing: .1em; }
.dr-balance .dr-bal-arrow { color: var(--s-muted-2); }
.dr-balance .dr-bal-new { color: var(--s-green); font-weight: 900; font-size: 14px; }

.dr-credited {
  color: var(--s-muted);
  font-size: 13px;
  margin: 0 0 18px;
}
.dr-credited b { color: var(--s-text); font-weight: 700; }

/* ---- Countdown ---- */
.dr-countdown {
  padding: 16px 20px;
  background: rgba(255, 255, 255, .02);
  border: 1px solid var(--s-line);
  border-radius: 12px;
  margin: 0 0 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.dr-countdown .dr-cd-label {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--s-muted);
  font-weight: 800;
}
.dr-clock {
  display: inline-flex;
  gap: 8px;
  font-family: ui-monospace, monospace;
}
.dr-clock .dr-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  padding: 8px 10px 6px;
  background: var(--s-bg);
  border: 1px solid var(--s-line);
  border-radius: 8px;
}
.dr-clock .dr-clock-n {
  font-size: 22px;
  font-weight: 900;
  color: var(--s-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}
.dr-clock .dr-clock-u {
  font-size: 8px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--s-muted-2);
  font-weight: 800;
}
.dr-clock .dr-sep {
  font-size: 22px;
  font-weight: 900;
  color: var(--s-muted-2);
  align-self: center;
  margin-top: -6px;
}

/* ---- Action button row (after-claim) ---- */
.dr-actions {
  display: flex;
  gap: 10px;
}
.dr-btn {
  flex: 1;
  padding: 14px 16px;
  border-radius: 12px;
  border: 0;
  font-weight: 900;
  font-size: 13px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, background .15s, box-shadow .15s, color .15s;
}
.dr-btn.primary {
  background: var(--s-green);
  color: #061108;
  box-shadow: 0 8px 20px rgba(127, 248, 0, .28);
}
.dr-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 26px rgba(127, 248, 0, .5), 0 8px 20px rgba(127, 248, 0, .35);
}
.dr-btn.ghost {
  background: var(--s-bg-3);
  color: var(--s-text);
  border: 1px solid var(--s-line);
}
.dr-btn.ghost:hover { background: var(--s-bg-4); }

/* ---- Confetti (after-claim) ---- */
.dr-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.dr-confetti span {
  position: absolute;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation: drConfetti 2.6s ease-in forwards;
}
@keyframes drConfetti {
  0%   { transform: translate(0, -20px) rotate(0); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translate(var(--dx), 380px) rotate(540deg); opacity: 0; }
}
