@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@500;700;900&family=Bebas+Neue&family=JetBrains+Mono:wght@400;700&family=Inter:wght@400;500;600;700&family=Sora:wght@400;600;700;800&display=swap');

.overlay-root {
  --bg-deep: #07070d;
  --bg-mid: #0e0e1a;
  --bg-soft: #161628;
  --ink: #f5f6ff;
  --ink-dim: #9aa0c3;
  --ink-faint: #5a5f80;
  --line: rgba(255,255,255,0.08);
  --line-bright: rgba(255,255,255,0.18);
  --accent: #ff3344;
  --accent-soft: rgba(255,51,68,0.32);
  --accent-glow: rgba(255,51,68,0.7);
  --font-display: 'Big Shoulders Display', 'Impact', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-challenge-title: 'Bebas Neue', 'Big Shoulders Display', 'Impact', sans-serif;
  --font-highlight: 'Sora', 'Inter', system-ui, sans-serif;
  --font-social: 'Sora', 'Inter', system-ui, sans-serif;
}
html, body {
  background: transparent;
  overflow: hidden;
}

.overlay-root {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay-root.layout-stacked {
  flex-direction: column;
  gap: 28px;
  padding: 36px;
  align-items: center;
}

.counter-widget {
  position: relative;
  width: 320px;
  height: 320px;
  border-radius: 28px;
  overflow: hidden;
  --accent: #ff3344;
  --accent-soft: rgba(255,51,68,0.32);
  --accent-glow: rgba(255,51,68,0.7);
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.55)) drop-shadow(0 0 30px var(--accent-soft));
}

.counter-card {
  position: absolute;
  inset: 10px;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(255,255,255,0.06), rgba(255,255,255,0) 60%),
    radial-gradient(140% 100% at 100% 100%, var(--accent-soft), rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(10,10,20,0.55), rgba(6,6,12,0.85));
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 60px rgba(0,0,0,0.45);
  backdrop-filter: blur(14px) saturate(1.4);
  z-index: 10;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 22px 24px 26px;
  overflow: hidden;
  will-change: transform, box-shadow;
}

.counter-card::before {
  content: '';
  position: absolute;
  inset: -18%;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 22%, rgba(58,255,213,0.24) 0 2px, transparent 2.5px),
    radial-gradient(circle at 78% 68%, rgba(255,90,203,0.20) 0 2px, transparent 2.5px),
    radial-gradient(circle at 42% 84%, rgba(255,206,74,0.16) 0 2px, transparent 2.5px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 11px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 11px);
  background-size: 180px 180px, 220px 220px, 200px 200px, 14px 14px, 14px 14px;
  mix-blend-mode: screen;
  opacity: 0.42;
  animation: card-pixel-drift 20s linear infinite;
}

.counter-card::after {
  content: '';
  position: absolute;
  inset: -30% -10% -10% -30%;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255,255,255,0.22) 0 1px, transparent 1.5px) 0 0 / 16px 16px,
    radial-gradient(circle, rgba(58,255,213,0.20) 0 1px, transparent 1.5px) 8px 8px / 20px 20px;
  opacity: 0.24;
  filter: blur(0.15px);
  animation: card-pixel-float 11s steps(40) infinite;
}

@keyframes card-pixel-drift {
  0% { transform: translate3d(-6%, -4%, 0) rotate(0.001deg); }
  50% { transform: translate3d(4%, 3%, 0) rotate(0.001deg); }
  100% { transform: translate3d(-6%, -4%, 0) rotate(0.001deg); }
}

@keyframes card-pixel-float {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(4%, -3%, 0); }
  50% { transform: translate3d(8%, 1%, 0); }
  75% { transform: translate3d(3%, 4%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.counter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-dim);
  position: relative;
  z-index: 2;
}

.counter-icon {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 0 12px var(--accent-glow));
}

.counter-label {
  font-family: var(--font-mono);
  font-size: 23px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  text-shadow: 0 0 12px var(--accent-soft);
}

.counter-value-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
  z-index: 2;
}

.counter-value {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 118px;
  line-height: 0.85;
  color: #ffffff;
  text-shadow:
    0 0 18px var(--accent-glow),
    0 0 34px var(--accent-soft),
    0 8px 30px rgba(0,0,0,0.6);
  letter-spacing: -0.04em;
  will-change: transform, opacity, text-shadow, filter;
}

.counter-corner {
  position: absolute;
  width: 22px; height: 22px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  z-index: 3;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.counter-corner.tl { top: 14px; left: 14px; border-top-width: 3px; border-left-width: 3px; border-top-left-radius: 10px; }
.counter-corner.tr { top: 14px; right: 14px; border-top-width: 3px; border-right-width: 3px; border-top-right-radius: 10px; }
.counter-corner.bl { bottom: 14px; left: 14px; border-bottom-width: 3px; border-left-width: 3px; border-bottom-left-radius: 10px; }
.counter-corner.br { bottom: 14px; right: 14px; border-bottom-width: 3px; border-right-width: 3px; border-bottom-right-radius: 10px; }

.counter-widget.counter-missing .counter-value {
  font-size: 22px;
  color: var(--ink-dim);
  text-shadow: none;
}

.challenge-widget {
  position: relative;
  width: 680px;
  max-width: calc(100vw - 48px);
  min-height: 220px;
}

.challenge-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.challenge-card-host {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  --accent: #3affd5;
  --accent-soft: rgba(58,255,213,0.32);
  --accent-glow: rgba(58,255,213,0.7);
  --challenge-height: 220px;
  height: var(--challenge-height);
  filter: drop-shadow(0 24px 48px rgba(0,0,0,0.55)) drop-shadow(0 0 22px var(--accent-soft));
  perspective: 1200px;
  will-change: transform;
}

.challenge-card {
  position: relative;
  height: 100%;
  border-radius: 22px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.08), rgba(255,255,255,0) 60%),
    radial-gradient(120% 120% at 100% 100%, var(--accent-soft), rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(12,12,22,0.6), rgba(6,6,14,0.85));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 80px rgba(0,0,0,0.5);
  backdrop-filter: blur(14px) saturate(1.4);
  z-index: 10;
  padding: 22px 26px 24px;
  display: grid;
  grid-template-columns: 1fr 220px;
  grid-template-rows: auto 1fr;
  gap: 14px 22px;
  transform-style: preserve-3d;
  will-change: transform, opacity, filter;
  overflow: hidden;
}

.challenge-shimmer {
  position: absolute;
  inset: -18%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 10% 20%, rgba(58,255,213,0.18) 0 2px, transparent 2.5px),
    radial-gradient(circle at 82% 18%, rgba(255,90,203,0.18) 0 2px, transparent 2.5px),
    radial-gradient(circle at 64% 74%, rgba(255,206,74,0.16) 0 2px, transparent 2.5px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 13px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 13px);
  background-size: 220px 220px, 260px 260px, 240px 240px, 16px 16px, 16px 16px;
  mix-blend-mode: screen;
  opacity: 0.34;
  animation: challenge-pixel-drift 24s linear infinite;
}

.challenge-card::after {
  content: '';
  position: absolute;
  inset: -25% -8% -12% -25%;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(circle, rgba(255,255,255,0.2) 0 1px, transparent 1.5px) 0 0 / 18px 18px,
    radial-gradient(circle, rgba(58,255,213,0.16) 0 1px, transparent 1.5px) 9px 9px / 22px 22px;
  opacity: 0.22;
  filter: blur(0.2px);
  animation: challenge-pixel-float 13s steps(46) infinite;
}

@keyframes challenge-pixel-drift {
  0% { transform: translate3d(-5%, -3%, 0); }
  50% { transform: translate3d(5%, 4%, 0); }
  100% { transform: translate3d(-5%, -3%, 0); }
}

@keyframes challenge-pixel-float {
  0% { transform: translate3d(0, 0, 0); }
  25% { transform: translate3d(3%, -2%, 0); }
  50% { transform: translate3d(7%, 2%, 0); }
  75% { transform: translate3d(2%, 5%, 0); }
  100% { transform: translate3d(0, 0, 0); }
}

.challenge-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  position: relative;
  z-index: 2;
}

.challenge-header-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.challenge-type-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--accent);
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent-glow);
  box-shadow: 0 0 18px var(--accent-soft) inset, 0 0 12px var(--accent-soft);
}
.challenge-type-badge .cb-icon { font-size: 16px; }

.challenge-complete-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px 4px;
  border-radius: 6px;
  border: 2px solid rgba(255, 77, 77, 0.92);
  background: rgba(48, 4, 10, 0.56);
  color: #ffd8d8;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 77, 77, 0.55);
  box-shadow: inset 0 0 14px rgba(255, 77, 77, 0.22), 0 0 12px rgba(255, 77, 77, 0.2);
  transform: rotate(-4deg) translateY(1px);
}
.challenge-complete-badge[hidden] {
  display: none !important;
}

.challenge-body {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 8px;
  padding-top: 4px;
  position: relative;
  z-index: 2;
  min-width: 0;
}

.challenge-title {
  font-family: var(--font-challenge-title);
  font-weight: 900;
  font-size: 56px;
  line-height: 1.0;
  letter-spacing: 0.005em;
  color: #fff;
  text-shadow: 0 0 22px var(--accent-soft), 0 8px 26px rgba(0,0,0,0.72);
  word-break: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
  max-width: 100%;
  white-space: normal;
}

.challenge-description {
  font-family: var(--font-highlight);
  font-size: 21px;
  font-weight: 700;
  color: #d4fff7;
  line-height: 1.18;
  text-shadow:
    0 0 14px rgba(58,255,213,0.42),
    0 0 30px rgba(58,255,213,0.18),
    0 4px 12px rgba(0,0,0,0.65);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.challenge-progress {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 2;
  padding: 8px;
  border-radius: 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.07);
}
.challenge-progress.progress-streak {
  --streak-shift-y: -2px;
  align-self: center;
  justify-self: center;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  min-width: 0;
  overflow: hidden;
  transform: translateY(var(--streak-shift-y));
}

.streak-dots {
  --ball-size: 12px;
  --ball-gap: 3px;
  --streak-rows: 1;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--ball-gap);
  justify-content: center;
  align-items: center;
  min-height: calc(var(--streak-rows) * var(--ball-size) + (var(--streak-rows) - 1) * var(--ball-gap));
}
.streak-row {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--ball-gap);
}
.streak-dot {
  width: var(--ball-size);
  height: var(--ball-size);
  flex: 0 0 var(--ball-size);
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background:
    radial-gradient(circle at 35% 28%, rgba(255,255,255,0.32), rgba(255,255,255,0.08) 36%, rgba(255,255,255,0.02) 68%),
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03));
  box-shadow: inset 0 -2px 4px rgba(0,0,0,0.42), 0 0 8px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.22s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.streak-dot.filled {
  background:
    radial-gradient(circle at 34% 24%, rgba(255,255,255,0.9), rgba(255,255,255,0.28) 26%, transparent 42%),
    radial-gradient(circle at 50% 58%, var(--accent) 0 58%, rgba(0,0,0,0.2) 100%);
  border-color: var(--accent);
  box-shadow:
    0 0 12px var(--accent-glow),
    0 0 22px var(--accent-soft),
    inset 0 -2px 4px rgba(0,0,0,0.28);
}
.streak-text {
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
}
.streak-text .big { font-family: var(--font-display); font-size: 32px; font-weight: 900; line-height: 1; }
.streak-text .of { color: var(--ink-dim); font-size: 17px; font-weight: 700; }

.timed-clock {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 54px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: #fff;
  text-shadow: 0 0 18px var(--accent-glow);
  font-variant-numeric: tabular-nums;
}
.timed-clock.urgency-low { color: #ffce4a; text-shadow: 0 0 18px rgba(255,206,74,0.7); }
.timed-clock.urgency-crit { color: #ff3344; text-shadow: 0 0 24px rgba(255,51,68,0.9); }
.timed-clock.time-up {
  color: #ff3344;
  font-size: 42px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.timed-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.objective-check {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-dim);
  background: rgba(0,0,0,0.3);
  transition: all 0.35s ease;
  position: relative;
  overflow: hidden;
}
.objective-check::before,
.objective-check::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  pointer-events: none;
}
.objective-check::before {
  width: 14px;
  height: 14px;
  background: radial-gradient(circle, #ffffff 0 12%, var(--accent) 44%, transparent 72%);
  box-shadow: 0 0 14px var(--accent-glow), 0 0 28px var(--accent-soft);
  transform: translate(-50%, -50%);
  animation: objective-pending-core 1.45s ease-in-out infinite;
}
.objective-check::after {
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  box-shadow: 0 0 14px var(--accent-glow), inset 0 0 10px var(--accent-soft);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.18);
  animation: objective-pending-ripple 1.45s ease-out infinite;
}
.objective-mark {
  font-family: var(--font-display);
  font-size: 48px;
  line-height: 1;
  opacity: 0;
  transform: scale(0.6);
  color: #07070d;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.objective-check.done {
  background: var(--accent);
  box-shadow: 0 0 32px var(--accent-glow);
  transform: scale(1.05);
}
.objective-check.done::after {
  display: none;
}
.objective-check.done::before {
  display: none;
}
.objective-check.done .objective-mark {
  opacity: 1;
  transform: scale(1);
}
@keyframes objective-pending-core {
  0%, 100% { opacity: 0.72; transform: translate(-50%, -50%) scale(0.82); }
  45% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
}
@keyframes objective-pending-ripple {
  0% { opacity: 0.72; transform: translate(-50%, -50%) scale(0.18); }
  70% { opacity: 0.18; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(4.4); }
}
.objective-sub {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--ink-dim);
  text-transform: uppercase;
}

.counter-goal-num {
  font-family: var(--font-mono);
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--ink);
}
.counter-goal-num .big { font-family: var(--font-display); font-size: 36px; font-weight: 900; line-height: 1; }
.counter-goal-num .of { color: var(--ink-dim); font-size: 18px; font-weight: 700; }
.counter-goal-bar {
  width: 100%;
  height: 14px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.12), rgba(255,255,255,0.03)),
    rgba(0,0,0,0.34);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow:
    inset 0 0 14px rgba(0,0,0,0.72),
    0 0 16px rgba(255,255,255,0.04);
}
.counter-goal-fill {
  position: relative;
  overflow: hidden;
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(80% 180% at 100% 50%, rgba(255,255,255,0.8), transparent 45%),
    linear-gradient(90deg, var(--accent-soft), var(--accent) 66%, #ffffff 100%);
  box-shadow:
    0 0 18px var(--accent-glow),
    0 0 34px var(--accent-soft),
    inset 0 0 12px rgba(255,255,255,0.3);
  transition: width 0.5s cubic-bezier(0.2, 1.2, 0.5, 1);
}
.counter-goal-fill::before {
  content: '';
  position: absolute;
  top: 50%;
  right: -5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(255,255,255,0.95), var(--accent) 42%, transparent 70%);
  box-shadow: 0 0 18px var(--accent-glow), 0 0 34px var(--accent-soft);
  opacity: 0.95;
}
.counter-goal-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, rgba(255,255,255,0) 18%, rgba(255,255,255,0.78) 48%, rgba(255,255,255,0) 78%);
  transform: translateX(-140%);
  animation: counter-goal-flow 1.05s linear infinite;
}

@keyframes counter-goal-flow {
  0% { transform: translateX(-140%); }
  100% { transform: translateX(140%); }
}

.challenge-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  z-index: 3;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.challenge-corner.tl { top: 10px; left: 10px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 10px; }
.challenge-corner.tr { top: 10px; right: 10px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 10px; }
.challenge-corner.bl { bottom: 10px; left: 10px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 10px; }
.challenge-corner.br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 10px; }

.challenge-stamp {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 100px;
  letter-spacing: 0.05em;
  color: #ffffff;
  z-index: 80;
  pointer-events: none;
  text-shadow: 0 0 40px rgba(255,255,255,0.9), 0 0 80px var(--accent-glow);
  transform: rotate(-6deg);
}
.challenge-stamp.time-up {
  color: #ff3344;
  text-shadow:
    0 0 30px rgba(255, 51, 68, 0.95),
    0 0 70px rgba(255, 51, 68, 0.7),
    0 0 120px rgba(120, 0, 20, 0.6);
  -webkit-text-stroke: 2px rgba(255, 255, 255, 0.15);
}

.challenge-idle {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 60px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.social-card-host {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  --accent: #3affd5;
  --accent-soft: rgba(58,255,213,0.28);
  --accent-glow: rgba(58,255,213,0.72);
  --social-height: 122px;
  width: 460px;
  max-width: calc(100vw - 48px);
  height: var(--social-height);
  filter: drop-shadow(0 16px 32px rgba(0,0,0,0.48)) drop-shadow(0 0 14px var(--accent-soft));
  perspective: 1200px;
}

.social-card {
  position: relative;
  height: 100%;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(255,255,255,0.08), rgba(255,255,255,0) 60%),
    radial-gradient(120% 120% at 100% 100%, var(--accent-soft), rgba(0,0,0,0) 65%),
    linear-gradient(180deg, rgba(12,12,22,0.62), rgba(6,6,14,0.88));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 72px rgba(0,0,0,0.48);
  backdrop-filter: blur(14px) saturate(1.35);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 12px;
  row-gap: 4px;
  overflow: hidden;
}

.social-shimmer {
  position: absolute;
  inset: -18%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 18%, rgba(58,255,213,0.16) 0 2px, transparent 2.5px),
    radial-gradient(circle at 78% 68%, rgba(255,90,203,0.14) 0 2px, transparent 2.5px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 12px);
  background-size: 200px 200px, 220px 220px, 14px 14px, 14px 14px;
  mix-blend-mode: screen;
  opacity: 0.3;
  animation: social-pixel-drift 22s linear infinite;
}

@keyframes social-pixel-drift {
  0% { transform: translate3d(-5%, -3%, 0); }
  50% { transform: translate3d(5%, 4%, 0); }
  100% { transform: translate3d(-5%, -3%, 0); }
}

.social-header,
.social-body,
.social-link {
  position: relative;
  z-index: 2;
}
.social-header {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
}
.social-body {
  grid-column: 2;
  grid-row: 1;
}
.social-link {
  grid-column: 2;
  grid-row: 2;
}

.social-brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,0.4);
  border: 1px solid var(--accent);
  color: var(--accent);
  box-shadow: 0 0 14px var(--accent-soft) inset, 0 0 8px var(--accent-soft);
}

.social-brand-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.social-icon-svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.social-brand-label {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.social-card.is-logo-only .social-brand-badge {
  padding: 7px 9px;
  border-radius: 10px;
}
.social-card.is-logo-only .social-brand-label {
  display: none;
}
.social-card.is-logo-only .social-brand-icon {
  width: 26px;
  height: 26px;
}
.social-card.is-upi-text .social-brand-badge {
  padding: 6px 12px;
  gap: 0;
}
.social-card.is-upi-text .social-brand-label {
  font-size: 12px;
  letter-spacing: 0.16em;
}

.social-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.social-title {
  font-family: var(--font-social);
  font-size: 26px;
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.012em;
  color: #fff;
  text-shadow: 0 0 14px var(--accent-soft), 0 6px 18px rgba(0,0,0,0.62);
  white-space: normal;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.social-subtitle {
  font-family: var(--font-highlight);
  font-size: 14px;
  font-weight: 600;
  color: #d7fff8;
  line-height: 1.2;
  text-shadow: 0 0 8px rgba(58,255,213,0.32);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.social-link {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-dim);
  text-transform: uppercase;
  text-decoration: none;
  max-width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.social-link:hover {
  color: var(--accent);
}

.social-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  z-index: 3;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.social-corner.tl { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 8px; }
.social-corner.tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 8px; }
.social-corner.bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 8px; }
.social-corner.br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 8px; }

.playing-card-host {
  position: relative;
  border-radius: 18px;
  overflow: visible;
  --accent: #3affd5;
  --accent-2: #ff5acb;
  --accent-3: #ffd86b;
  --accent-soft: rgba(58,255,213,0.3);
  --accent-soft-2: rgba(255,90,203,0.22);
  --accent-soft-3: rgba(255,216,107,0.18);
  --accent-glow: rgba(58,255,213,0.72);
  --playing-subtitle-color: #d7fff8;
  --playing-height: 158px;
  --playing-strip-height: 108px;
  --playing-poster-width: 144px;
  width: 660px;
  max-width: calc(100vw - 48px);
  height: var(--playing-height);
  filter: drop-shadow(0 16px 32px rgba(0,0,0,0.48)) drop-shadow(0 0 16px var(--accent-soft));
  perspective: 1200px;
}

.playing-shell {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
}

.playing-card {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: var(--playing-strip-height);
  border-radius: 16px;
  background:
    radial-gradient(90% 80% at 0% 0%, var(--accent-soft-3), rgba(255,255,255,0) 64%),
    radial-gradient(120% 120% at 100% 100%, var(--accent-soft), rgba(0,0,0,0) 65%),
    radial-gradient(90% 120% at 72% 0%, var(--accent-soft-2), rgba(0,0,0,0) 70%),
    linear-gradient(180deg, rgba(12,12,22,0.62), rgba(6,6,14,0.88));
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 72px rgba(0,0,0,0.48);
  backdrop-filter: blur(14px) saturate(1.35);
  padding: 11px 18px 11px 14px;
  display: grid;
  grid-template-rows: auto 1fr;
  align-items: stretch;
  row-gap: 4px;
  overflow: hidden;
}

.playing-card.has-two-line-title {
  padding-top: 8px;
  padding-bottom: 8px;
  row-gap: 2px;
}

.playing-card.has-two-line-title .playing-header {
  line-height: 1;
}

.playing-card.has-two-line-title .playing-badge {
  padding: 2px 6px;
  font-size: 8px;
  line-height: 1;
}

.playing-shimmer {
  position: absolute;
  inset: -18%;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(circle at 18% 18%, var(--accent-soft) 0 2px, transparent 2.5px),
    radial-gradient(circle at 78% 68%, var(--accent-soft-2) 0 2px, transparent 2.5px),
    radial-gradient(circle at 54% 42%, var(--accent-soft-3) 0 1.5px, transparent 2.2px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 12px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 12px);
  background-size: 200px 200px, 220px 220px, 180px 180px, 14px 14px, 14px 14px;
  mix-blend-mode: screen;
  opacity: 0.32;
  animation: social-pixel-drift 20s linear infinite;
}

.playing-header,
.playing-poster-dock,
.playing-body {
  position: relative;
  z-index: 2;
}

.playing-header {
  grid-row: 1;
}

.playing-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 7px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: rgba(0,0,0,0.34);
  box-shadow: 0 0 8px var(--accent-soft) inset, 0 0 5px var(--accent-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.playing-poster-dock {
  position: relative;
  flex: 0 0 var(--playing-poster-width);
  width: var(--playing-poster-width);
  height: calc(var(--playing-height) - 2px);
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.22);
  background:
    radial-gradient(90% 70% at 50% 20%, var(--accent-soft), rgba(58,255,213,0) 70%),
    radial-gradient(80% 90% at 100% 0%, var(--accent-soft-2), rgba(58,255,213,0) 70%),
    linear-gradient(180deg, rgba(6,8,18,0.72), rgba(5,6,14,0.9));
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.05),
    inset 0 0 20px rgba(0,0,0,0.45),
    0 0 16px var(--accent-soft),
    0 0 26px var(--accent-soft-2);
}

.playing-card-host:not(.has-poster) .playing-poster-dock {
  display: none;
}

.playing-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.playing-fallback-icon {
  width: 66px;
  height: 66px;
  color: var(--accent);
  opacity: 0.92;
}

.playing-fallback-svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
}

.playing-card-host.has-poster .playing-fallback-icon {
  display: none;
}

.playing-body {
  grid-row: 2;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  padding-right: 2px;
}

.playing-body.has-two-line-title {
  gap: 3px;
}

.playing-title {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 0 12px var(--accent-soft), 0 6px 18px rgba(0,0,0,0.62);
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  text-transform: uppercase;
  transform-origin: left center;
}

.playing-title.is-two-line {
  font-size: 32px;
  line-height: 0.92;
}

.playing-title-line {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.playing-title.is-clamped {
  letter-spacing: 0.01em;
}

.playing-subtitle {
  font-family: var(--font-highlight);
  font-size: 18px;
  font-weight: 600;
  color: var(--playing-subtitle-color);
  line-height: 1.1;
  text-shadow: 0 0 8px var(--accent-soft-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playing-body.has-two-line-title .playing-subtitle {
  font-size: 14px;
  line-height: 1;
}

.playing-subtitle[hidden] {
  display: none;
}

.playing-corner {
  position: absolute;
  width: 14px;
  height: 14px;
  border-color: var(--accent);
  border-style: solid;
  border-width: 0;
  z-index: 3;
  filter: drop-shadow(0 0 6px var(--accent-glow));
}
.playing-corner.tl { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 8px; }
.playing-corner.tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 8px; }
.playing-corner.bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 8px; }
.playing-corner.br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 8px; }

.counters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  align-items: center;
}

.counter-slot {
  width: 320px;
  height: 320px;
}

.empty-note {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.32em;
  color: var(--ink-faint);
  text-transform: uppercase;
  padding: 40px;
}

#status-pill {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 1000;
}

.overlay-error {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 0.1em;
  color: #ff6b6b;
  background: rgba(8, 8, 14, 0.85);
  z-index: 999;
}

/* ============ Hype mode ============ */
.counter-widget,
.challenge-card-host {
  --hype-level: 0;
  transition: filter 0.4s ease;
}
.counter-widget.is-hype-high,
.challenge-card-host.is-hype-high {
  filter: saturate(calc(1 + var(--hype-level) * 0.6))
          brightness(calc(1 + var(--hype-level) * 0.12))
          drop-shadow(0 0 calc(30px + var(--hype-level) * 30px) var(--accent-glow));
}
.challenge-card-host.is-hype-max {
  animation: hype-pulse 1.2s ease-in-out infinite;
}
.counter-widget.is-hype-max {
  animation: none;
}
@keyframes hype-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.015); }
}

/* ============ Milestone ghost number ============ */
.milestone-ghost {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 220px;
  line-height: 0.9;
  color: #ffffff;
  text-shadow:
    0 0 50px var(--accent-glow, rgba(255,255,255,0.9)),
    0 0 90px var(--accent-soft, rgba(255,255,255,0.5));
  pointer-events: none;
  z-index: 90;
  mix-blend-mode: screen;
  white-space: nowrap;
  letter-spacing: -0.05em;
}
.milestone-ghost.milestone-ghost-death {
  color: #ff4d4d;
  text-shadow:
    0 0 45px rgba(255, 45, 45, 0.95),
    0 0 110px rgba(90, 0, 12, 0.75);
  mix-blend-mode: normal;
}

/* ============ Counter hit number (death smash) ============ */
.counter-hit-num {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 150px;
  line-height: 0.86;
  letter-spacing: -0.04em;
  pointer-events: none;
  z-index: 8;
  white-space: nowrap;
}
.counter-hit-num.counter-hit-num-death {
  color: #ff6a6a;
  text-shadow:
    0 0 30px rgba(255, 51, 68, 0.9),
    0 0 80px rgba(90, 0, 12, 0.65);
}

/* ============ Challenge carousel ============ */
.challenge-stack.is-carousel {
  display: grid;
  grid-template-areas: "slot";
  place-items: center;
  min-height: 240px;
  perspective: 1400px;
  transform-style: preserve-3d;
}
.challenge-stack.is-carousel > .challenge-carousel-slot {
  grid-area: slot;
  width: 100%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}
.challenge-carousel-slot {
  position: relative;
}

/* ============ Combo widget ============ */
.combo-widget {
  position: relative;
  width: 100%;
  max-width: calc(100vw - 48px);
  /* Unified height for both kinds when sitting in a row together.
     Override per overlay with a custom inline style if needed. */
  --combo-height: 220px;
}
.combo-lanes {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 36px;
  flex-wrap: nowrap;
}
.combo-lane-wrap {
  flex: 0 0 auto;
  position: relative;
}
/* Keep fixed slot geometry even when lane content is hidden/disabled. */
.combo-lane.is-empty {
  min-height: var(--combo-height);
}
.combo-lane.lane-counter.is-empty {
  min-width: var(--combo-height);
}
.combo-lane.lane-challenge.is-empty {
  min-width: 540px;
}
.combo-lane.lane-playing.is-empty {
  min-width: 660px;
}
.combo-lane {
  position: relative;
}
.lane-stack {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}

/* Vertical orientation flips the list mode to a column. Carousel mode is
   orientation-agnostic since it stacks via CSS grid. */
.combo-lane.orientation-vertical .lane-stack {
  flex-direction: column;
  align-items: center;
}

/* Single-kind stack used by ?type=counters and ?type=challenges */
.combo-widget.combo-single {
  display: flex;
  align-items: center;
  justify-content: center;
}
.combo-widget.combo-single > .combo-lane-wrap {
  margin: 0;
}
.lane-stack.is-list {
  /* default flex row — already set above */
}
.lane-stack.is-carousel {
  display: grid;
  grid-template-areas: "slot";
  place-items: center;
  perspective: 1600px;
  transform-style: preserve-3d;
}
.lane-stack.is-carousel > .combo-item {
  grid-area: slot;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform, opacity, filter;
}
.combo-item {
  flex: 0 0 auto;
  position: relative;
}
.combo-item.kind-counter {
  width: var(--combo-height);
  height: var(--combo-height);
}
/* Scale the counter's content down to fit the smaller combo size */
.combo-item.kind-counter .counter-card { padding: 14px 16px 16px; inset: 8px; border-radius: 18px; }
.combo-item.kind-counter .counter-icon { font-size: 22px; }
.combo-item.kind-counter .counter-label { font-size: 16px; letter-spacing: 0.18em; }
.combo-item.kind-counter .counter-value { font-size: 84px; }
.combo-item.kind-counter .counter-corner {
  width: 14px; height: 14px;
  border-width: 0;
}
.combo-item.kind-counter .counter-corner.tr { top: 10px; right: 10px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 8px; }
.combo-item.kind-counter .counter-corner.bl { bottom: 10px; left: 10px;  border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 8px; }
.combo-item.kind-counter .counter-corner.br { bottom: 10px; right: 10px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 8px; }
.combo-item.kind-counter .counter-corner.tl { top: 10px; left: 10px;  border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 8px; }

.combo-item.kind-challenge {
  width: 540px;
  /* Inner challenge card-host honors this var for its height */
  --challenge-height: var(--combo-height);
}
.combo-item.kind-social {
  width: 460px;
  --social-height: 122px;
}
.combo-item.kind-playing {
  width: 660px;
  --playing-height: 158px;
}
.combo-item.kind-social .social-card-host {
  width: 100%;
  height: var(--social-height);
  max-width: none;
}
.combo-item.kind-playing .playing-card-host {
  width: 100%;
  height: var(--playing-height);
  max-width: none;
}
/* Slot dimensions reserved so empty/single-item carousels still hold their footprint */
.lane-counter .lane-stack.is-carousel {
  width: var(--combo-height);
  height: var(--combo-height);
}
.lane-challenge .lane-stack.is-carousel {
  width: 540px;
  height: var(--combo-height);
}
.lane-social .lane-stack.is-carousel {
  width: 460px;
  height: 122px;
}
.lane-playing .lane-stack.is-carousel {
  width: 660px;
  height: 158px;
}
.lane-idle {
  text-align: center;
  padding: 30px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.combo-idle {
  text-align: center;
  padding: 60px 20px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
