/* ============================================================================
   Glov Games · Daily Challenge
   ----------------------------------------------------------------------------
   Sits at the top of the library section, above the discovery cards. Colours are
   the existing home.css vocabulary: charcoal-purple grounds, violet accents,
   cyan highlight, and gold reserved solely for the reward.
   ============================================================================ */

.daily-challenge-panel{
  display:grid;gap:14px;
  margin:0 0 22px;padding:18px;
  border:1px solid #ffffff1a;border-radius:20px;
  background:
    radial-gradient(520px 240px at 84% -20%, #6d28d92e, transparent 66%),
    linear-gradient(152deg,#1d0c3a,#150829 62%,#120722);
  box-shadow:0 16px 38px #05000f5c;
}

/* ---------------------------------------------------------------- header --- */
.dc-head{display:grid;gap:8px}
.dc-head-top{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}

.dc-pill{
  display:inline-flex;align-items:center;gap:7px;
  padding:5px 11px;border-radius:999px;
  border:1px solid #e879f255;
  background:linear-gradient(120deg,#a72cc033,#6d28d91f);
  color:#dca1ff;
  font:800 10px/1 "Space Mono",ui-monospace,monospace;
  letter-spacing:.12em;text-transform:uppercase;
}
.dc-pill i{width:6px;height:6px;border-radius:50%;background:#e879f2;box-shadow:0 0 0 3px #e879f22e}

.dc-reset{color:#b9a8d4;font:600 12px/1 "Space Mono",ui-monospace,monospace;display:inline-flex;gap:6px;align-items:center}
.dc-reset b{color:#f9f5ff;font-weight:700}

.daily-challenge-panel h2{
  margin:0;
  font-family:"Space Grotesk","Plus Jakarta Sans",sans-serif;
  font-size:clamp(21px,3.4vw,27px);line-height:1.1;letter-spacing:-.024em;font-weight:700;color:#fff;
}
.dc-accent{
  background:linear-gradient(100deg,#e879f2,#dca1ff 46%,#67e8f9);
  -webkit-background-clip:text;background-clip:text;color:transparent;
}
.dc-sub{margin:0;color:#b9a8d4;font-size:13.5px;line-height:1.5;max-width:48ch}

/* -------------------------------------------------------------- progress --- */
.dc-progress{
  display:grid;gap:9px;padding:12px 14px;
  border:1px solid #ffffff17;border-radius:14px;background:#160a2c;
}
.dc-progress-row{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.dc-count{font:700 13px/1 "Space Grotesk",sans-serif;color:#f9f5ff}
.dc-count b{color:#e879f2}
.dc-pct{font:800 13px/1 "Space Mono",monospace;color:#dca1ff}

.dc-segments{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.dc-seg{
  height:9px;border-radius:999px;overflow:hidden;
  background:#ffffff12;border:1px solid #ffffff14;
}
.dc-seg > i{
  display:block;height:100%;width:0;border-radius:999px;
  background:linear-gradient(90deg,#a72cc0,#e879f2);
  box-shadow:0 0 10px #e879f26b;
  transition:width .5s cubic-bezier(.22,1,.36,1);
}
.dc-seg.is-done{border-color:#e879f266}
.dc-seg.is-done > i{width:100%}

/* ----------------------------------------------------------------- games --- */
.dc-games{display:grid;gap:9px}

.dc-game{
  display:grid;grid-template-columns:46px minmax(0,1fr) auto;
  align-items:center;gap:12px;
  padding:11px 12px;
  border:1px solid #ffffff1a;border-radius:13px;
  background:linear-gradient(150deg,#200f3f,#170a30);
  transition:border-color .16s,background .16s,transform .16s;
  position:relative;overflow:hidden;
}
.dc-game::before{
  content:"";position:absolute;inset:0 auto 0 0;width:3px;
  background:linear-gradient(180deg,#e879f2,#67e8f9);
  opacity:0;transition:opacity .16s;
}
.dc-game:hover{border-color:#e879f24d;background:linear-gradient(150deg,#261349,#1a0b33);transform:translateY(-1px)}
.dc-game:hover::before{opacity:1}
.dc-game:focus-within{border-color:#e879f2;box-shadow:0 0 0 3px #e879f22e}

.dc-icon{
  width:46px;height:46px;border-radius:12px;display:grid;place-items:center;
  font-size:21px;line-height:1;
  background:linear-gradient(145deg,#3a1663,#22103f);
  border:1px solid #ffffff1f;box-shadow:inset 0 1px #ffffff1a;
}
.dc-game[data-done="true"] .dc-icon{
  background:linear-gradient(145deg,#1d5c43,#123a2c);
  border-color:#3ddc9766;
}

.dc-meta{min-width:0}
.dc-meta h3{margin:0 0 3px;font:700 15px/1.2 "Space Grotesk",sans-serif;color:#fff;letter-spacing:-.01em}
.dc-game[data-done="true"] .dc-meta h3{color:#cbb3e8}
.dc-sub-meta{margin:0;color:#b9a8d4;font:600 11px/1 "Space Mono",monospace;letter-spacing:.03em}

.dc-tick{
  display:inline-block;width:15px;height:15px;margin-left:6px;border-radius:50%;
  background:#3ddc97;color:#06251a;text-align:center;
  font:900 10px/15px "Plus Jakarta Sans",sans-serif;vertical-align:1px;
}

.dc-revisit{
  display:inline-block;margin-top:4px;
  color:#c9a9ef;font:700 11px/1 "Plus Jakarta Sans",sans-serif;text-decoration:underline;
  text-underline-offset:3px;
}
.dc-revisit:hover{color:#e879f2}

/* PLAY is the loudest control. COMPLETED is deliberately quiet so it reads as a state. */
.dc-action{
  display:inline-flex;align-items:center;justify-content:center;
  /* 44px at every width, not just mobile. The mobile breakpoints were raised to 44 but this
     base rule stayed at 40, which left tablet and desktop below the comfortable tap minimum. */
  min-height:44px;padding:0 16px;border-radius:11px;
  font:800 11px/1 "Plus Jakarta Sans",sans-serif;letter-spacing:.05em;text-transform:uppercase;
  text-decoration:none;white-space:nowrap;
  color:#fff;border:0;cursor:pointer;
  background:linear-gradient(115deg,#a72cc0,#c23ad4);
  box-shadow:0 8px 18px #a72cc03d;
  transition:filter .16s,transform .12s;
}
.dc-action:hover{filter:brightness(1.12)}
.dc-action:active{transform:translateY(1px)}
.dc-action:focus-visible{outline:3px solid #67e8f9;outline-offset:2px}

.dc-action[data-state="done"]{
  cursor:default;color:#a8f7d0;
  background:#3ddc971a;border:1px solid #3ddc9755;box-shadow:none;
}
.dc-action[data-state="done"]:hover{filter:none}

/* ---------------------------------------------------------------- reward --- */
.dc-reward{
  display:grid;grid-template-columns:40px minmax(0,1fr);gap:11px;align-items:center;
  padding:11px 13px;border-radius:13px;
  border:1px dashed #f3b94c3d;
  background:linear-gradient(150deg,#2a1a1240,#1a0d2e);
}
.dc-reward-badge{
  width:40px;height:40px;border-radius:50%;display:grid;place-items:center;font-size:18px;
  background:radial-gradient(circle at 34% 28%,#5a4218,#2a1c0d);
  border:1px solid #f3b94c55;
  filter:grayscale(.75) opacity(.72);
  transition:filter .35s,border-color .35s;
}
.dc-reward h3{margin:0 0 2px;font:700 13px/1.2 "Space Grotesk",sans-serif;color:#ffe4a3}
.dc-reward p{margin:0;color:#b9a8d4;font-size:12px;line-height:1.45}
.dc-reward.is-unlocked{border-style:solid;border-color:#f3b94c66;background:linear-gradient(150deg,#3a2410,#1f1130)}
.dc-reward.is-unlocked .dc-reward-badge{filter:none;box-shadow:0 0 20px #f3b94c4d}

/* ------------------------------------------------------------ completion --- */
.dc-complete{
  display:none;position:relative;overflow:hidden;text-align:center;
  padding:22px 18px;border-radius:16px;
  border:1px solid #f3b94c66;
  background:
    radial-gradient(360px 170px at 50% -12%, #f3b94c2e, transparent 70%),
    linear-gradient(155deg,#2b1a12,#1a0e2e);
}
body.dc-finished .dc-complete{display:block;animation:dc-rise .5s cubic-bezier(.22,1,.36,1) both}
body.dc-finished .dc-reward{display:none}

.dc-complete-badge{
  width:66px;height:66px;margin:0 auto 12px;border-radius:50%;
  display:grid;place-items:center;font-size:29px;
  background:radial-gradient(circle at 34% 26%,#7a5a1e,#2f2009);
  border:2px solid #f3b94c99;
  box-shadow:0 0 34px #f3b94c59,inset 0 0 16px #f3b94c33;
  animation:dc-pop .55s cubic-bezier(.2,1.5,.4,1) both;
}
.dc-complete h3{
  margin:0 0 5px;font-family:"Space Grotesk",sans-serif;
  font-size:clamp(19px,3vw,23px);letter-spacing:-.02em;color:#fff;
}
.dc-champ{margin:0 0 10px;color:#f3b94c;font:800 13px/1.3 "Plus Jakarta Sans",sans-serif}
.dc-tally{
  display:inline-block;margin:0 0 10px;padding:5px 13px;border-radius:999px;
  background:#ffffff10;border:1px solid #ffffff1f;
  font:800 11px/1 "Space Mono",monospace;color:#f9f5ff;letter-spacing:.05em;
}
.dc-comeback{margin:0;color:#b9a8d4;font-size:12.5px}

.dc-spark{position:absolute;width:6px;height:6px;border-radius:50%;background:#f3b94c;opacity:0}
body.dc-finished .dc-spark{animation:dc-spark 1.1s ease-out .12s both}
.dc-spark:nth-child(1){top:30px;left:calc(50% - 42px);--dx:-15px}
.dc-spark:nth-child(2){top:24px;left:calc(50% + 36px);--dx:13px;animation-delay:.2s;background:#dca1ff}
.dc-spark:nth-child(3){top:56px;left:calc(50% - 56px);--dx:-20px;animation-delay:.28s;background:#67e8f9}
.dc-spark:nth-child(4){top:50px;left:calc(50% + 52px);--dx:18px;animation-delay:.34s}

@keyframes dc-rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@keyframes dc-pop{0%{transform:scale(.55);opacity:0}70%{transform:scale(1.06)}100%{transform:scale(1);opacity:1}}
@keyframes dc-spark{0%{opacity:0;transform:translate(0,0) scale(.4)}35%{opacity:1}100%{opacity:0;transform:translate(var(--dx,0),-24px) scale(1)}}

@media (prefers-reduced-motion:reduce){
  .dc-seg > i,.dc-game,.dc-action,.dc-reward-badge{transition:none}
  body.dc-finished .dc-complete,body.dc-finished .dc-spark,.dc-complete-badge{animation:none}
}

/* ------------------------------------------------------------ responsive --- */
@media (max-width:520px){
  .daily-challenge-panel{padding:14px;border-radius:16px}
  .dc-game{grid-template-columns:42px minmax(0,1fr) auto;gap:10px;padding:10px}
  .dc-icon{width:42px;height:42px;font-size:19px;border-radius:11px}
  .dc-meta h3{font-size:14px}
  .dc-action{padding:0 12px;min-height:44px;font-size:10px}
  .dc-reset{font-size:11px}
}
@media (max-width:360px){
  .dc-game{grid-template-columns:38px minmax(0,1fr) auto;gap:8px}
  .dc-icon{width:38px;height:38px;font-size:17px}
  .dc-action{padding:0 9px;min-height:44px;font-size:9.5px}
}

/* ------------------------------------------- panel inside the hero left column ---
 * The panel sits between the hero <h1> and the search/finder panel, so it takes its width from
 * that column (see .hero-copy>.daily-challenge-panel in home.css) and needs no page gutter of
 * its own. It also sits on the hero's dark gradient, so the internal rhythm is tightened to
 * keep the hero from growing too tall.
 */
.daily-challenge-panel{gap:11px;padding:15px}
.daily-challenge-panel h2{font-size:clamp(17px,2vw,21px);line-height:1.2}
.daily-challenge-panel .dc-sub{font-size:12.5px}
.daily-challenge-panel .dc-games{gap:9px}

/* ------------------------------------- hero panel · text fitting and alignment ---
 * Two problems once the panel moved into the hero's narrower column:
 *
 * 1. Text was clipped. Several labels used line-height equal to font-size (12/12, 13/13,
 *    11/11), so descenders and the ⏱ glyph were cut off by 2-3px. Every line box now gets
 *    a real leading value.
 * 2. The card's text column collapsed to 59px inside a 217px card, because the 46px icon and
 *    62px Play button took the rest and the meta column had no minimum. The card is now a
 *    two-row layout: icon + title/meta on top, full-width action underneath.
 */
#dailyChallenge .dc-reset,
#dailyChallenge .dc-reset b,
#dailyChallenge .dc-count,
#dailyChallenge .dc-pct,
#dailyChallenge .dc-sub-meta,
#dailyChallenge .dc-action,
#dailyChallenge .dc-pill{line-height:1.45!important;overflow:visible}

/* Card: stack the action under the text instead of squeezing the text between two blocks. */
.hero-copy>.daily-challenge-panel .dc-games > *,
#dailyChallenge .dc-games > *{
  display:grid!important;
  grid-template-columns:auto minmax(0,1fr)!important;
  grid-template-rows:auto auto!important;
  align-items:center!important;
  gap:8px 10px!important;
  padding:11px!important;
}
#dailyChallenge .dc-games > * .dc-icon{grid-column:1;grid-row:1}
#dailyChallenge .dc-games > * .dc-meta{grid-column:2;grid-row:1;min-width:0!important;width:auto!important}
#dailyChallenge .dc-games > * .dc-action{grid-column:1 / -1;grid-row:2;width:100%!important;justify-content:center}
#dailyChallenge .dc-games > * .dc-meta > *{min-width:0;overflow-wrap:anywhere}
#dailyChallenge .dc-games > * h3,
#dailyChallenge .dc-games > * strong{
  white-space:normal!important;overflow:visible!important;text-overflow:clip!important;
  line-height:1.25!important;
}

/* Header: let the reset badge drop below the pill rather than crushing it. */
#dailyChallenge .dc-head-top{align-items:center;flex-wrap:wrap;gap:8px 10px}
#dailyChallenge .dc-pill{flex:0 0 auto}
#dailyChallenge .dc-reset{flex:1 1 auto;min-width:0;text-align:right}
#dailyChallenge .dc-progress-row{align-items:baseline}

@media(max-width:520px){
  #dailyChallenge .dc-head-top{align-items:flex-start}
  #dailyChallenge .dc-reset{text-align:left}
}

/* On phones the three cards stacked vertically (3 x 118px = 372px), pushing the hero past
 * 1500px. They are compact enough to stay in one row, so keep three columns and shrink the
 * card furniture instead of stacking. */
@media(max-width:520px){
  #dailyChallenge .dc-games,
  .hero-copy>.daily-challenge-panel .dc-games{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
  #dailyChallenge .dc-games > *{
    grid-template-columns:minmax(0,1fr)!important;
    grid-template-rows:auto auto auto!important;
    justify-items:center;text-align:center;gap:5px!important;padding:8px 6px!important;
  }
  #dailyChallenge .dc-games > * .dc-icon{grid-column:1;grid-row:1;width:34px!important;height:34px!important;font-size:16px!important}
  #dailyChallenge .dc-games > * .dc-meta{grid-column:1;grid-row:2;text-align:center!important}
  #dailyChallenge .dc-games > * .dc-action{grid-column:1;grid-row:3}
  #dailyChallenge .dc-games > * h3,
  #dailyChallenge .dc-games > * strong{font-size:11px!important;line-height:1.2!important}
  #dailyChallenge .dc-games > * .dc-sub-meta{font-size:10px!important;line-height:1.3!important}
  #dailyChallenge .dc-head{padding:0}
  #dailyChallenge .dc-head h2{font-size:16px!important}
  #dailyChallenge .dc-sub{font-size:11.5px!important;line-height:1.35!important}
}

/* ------------------------------------------- daily challenge · entrance animation ---
 * A short, staggered reveal so the panel reads as a live daily feature rather than a static
 * block: the panel lifts in, the three game cards follow one after another, and the countdown
 * pill keeps a slow pulse while it counts down. Everything is transform/opacity only, so it
 * stays on the compositor and cannot trigger layout shifts mid-animation.
 */
@keyframes dc-in{from{opacity:0;transform:translateY(14px) scale(.985)}to{opacity:1;transform:none}}
@keyframes dc-card-in{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
@keyframes dc-pill-pulse{
  0%,100%{box-shadow:0 0 0 0 #e65ee300}
  50%{box-shadow:0 0 0 4px #e65ee32e}
}

#dailyChallenge{animation:dc-in .55s cubic-bezier(.22,1,.36,1) both}
#dailyChallenge .dc-games > *{
  animation:dc-card-in .5s cubic-bezier(.22,1,.36,1) both;
}
#dailyChallenge .dc-games > *:nth-child(1){animation-delay:.10s}
#dailyChallenge .dc-games > *:nth-child(2){animation-delay:.18s}
#dailyChallenge .dc-games > *:nth-child(3){animation-delay:.26s}
#dailyChallenge .dc-pill{animation:dc-pill-pulse 2.6s ease-in-out .6s infinite}

/* A slow sheen travelling across a completed segment. The sheen is layered as an extra
 * background layer so the purple fill underneath is preserved — setting background-image
 * alone would have replaced it. */
#dailyChallenge .dc-seg.is-done > i{
  background-image:linear-gradient(90deg,transparent 0%,#ffffff59 50%,transparent 100%),
                   linear-gradient(90deg,#a72cc0,#e879f2);
  background-size:200% 100%,100% 100%;
  background-repeat:no-repeat,no-repeat;
  background-position:-120% 0,0 0;
  animation:dc-seg-shine 2.2s ease-in-out infinite;
}
@keyframes dc-seg-shine{
  from{background-position:-120% 0,0 0}
  to{background-position:220% 0,0 0}
}

@media (prefers-reduced-motion:reduce){
  #dailyChallenge,
  #dailyChallenge .dc-games > *,
  #dailyChallenge .dc-pill,
  #dailyChallenge .dc-seg > i{
    animation:none!important;
  }
}

/* --------------------------------------------------- daily challenge · card previews ---
 * The icon tile now plays the game's looping preview clip, so each card shows actual gameplay
 * instead of a static emoji. The emoji remains rendered underneath the video and acts as the
 * poster frame: while the clip loads, if it is blocked, or when reduced-motion is on, the tile
 * still looks finished rather than empty.
 */
#dailyChallenge .dc-icon{position:relative;overflow:hidden}
#dailyChallenge .dc-icon.has-preview{background:#12071f}
#dailyChallenge .dc-icon-video{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:cover;
  border-radius:inherit;
  display:block;
  pointer-events:none;
}
/* A soft violet edge so the clip sits inside the card instead of looking pasted on. */
#dailyChallenge .dc-icon.has-preview::after{
  content:"";position:absolute;inset:0;border-radius:inherit;
  box-shadow:inset 0 0 0 1px #e879f24d;
  pointer-events:none;
}
