/* ============================================================
   MARU Overlay: Meta de Taps v3 — DELGADO, discreto y hermoso
   Estilo Tikfinity: barra slim, ocupa minimo espacio vertical.
   ============================================================ */

:root {
  --color-primary: #1DB954;
  --color-glow: rgba(29, 185, 84, 0.55);
  --bg: rgba(10, 14, 22, 0.78);
  --bg-track: rgba(255, 255, 255, 0.10);
  --text: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.62);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

html, body {
  width: 100%; height: 100%;
  background: transparent !important;
  font-family: var(--font);
  overflow: hidden; user-select: none;
}

.overlay-root {
  width: 100vw; height: 100vh;
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 6vh; position: relative;
}

/* ============ WIDGET DELGADO ============ */
.widget {
  width: clamp(380px, 60vw, 720px);
  background: var(--bg);
  backdrop-filter: blur(22px) saturate(180%);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  /* Padding REDUCIDO: era 28px arriba/abajo, ahora 14px */
  padding: 14px 24px 16px;
  box-shadow:
    0 16px 50px rgba(0, 0, 0, 0.5),
    0 0 40px var(--color-glow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: widgetEntry 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes widgetEntry {
  from { transform: translateY(60px) scale(0.94); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* ============ FILA SUPERIOR — gap más cerrado, menos margin ============ */
.row-top {
  display: flex; align-items: center; gap: 12px; margin-bottom: 8px;
}

/* Corazón más chico */
.heart {
  width: 32px; height: 32px; flex-shrink: 0;
  color: var(--color-primary);
  filter: drop-shadow(0 0 10px var(--color-glow));
  animation: pulse 1.4s ease-in-out infinite;
}
.heart svg { width: 100%; height: 100%; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

.counter {
  display: flex; align-items: baseline; gap: 8px;
  flex: 1; min-width: 0;
}

/* Counter SIGUE legible pero más compacto */
.counter-num {
  font-size: 38px; font-weight: 800; color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.5px;
  transition: color 0.25s ease;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.counter-num.bumped {
  animation: bump 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bump {
  0%   { transform: scale(1); color: var(--text); }
  40%  { transform: scale(1.18); color: var(--color-primary); }
  100% { transform: scale(1); color: var(--text); }
}

.counter-goal {
  font-size: 18px; font-weight: 700; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.percent {
  font-size: 18px; font-weight: 800; color: var(--color-primary);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px var(--color-glow);
}

/* ============ BARRA — más delgada (era 12px → ahora 6px) ============ */
.bar {
  height: 6px; background: var(--bg-track);
  border-radius: 999px; overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
}

.bar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(
    90deg,
    var(--color-primary),
    color-mix(in srgb, var(--color-primary) 60%, white)
  );
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px var(--color-glow);
  position: relative;
}

.bar-shine {
  position: absolute; top: 0; left: -50%;
  width: 50%; height: 100%;
  background: linear-gradient(
    90deg, transparent, rgba(255, 255, 255, 0.55), transparent
  );
  pointer-events: none; opacity: 0;
}

.bar-shine.shining { animation: shine 1s ease-out; }

@keyframes shine {
  from { left: -50%; opacity: 1; }
  to   { left: 100%; opacity: 0; }
}

/* ============ TOAST META ALCANZADA ============ */
.toast {
  position: absolute; bottom: 24%; left: 50%;
  transform: translateX(-50%) scale(0.5);
  opacity: 0; pointer-events: none;
  background: var(--color-primary);
  color: white;
  font-size: 36px; font-weight: 900;
  padding: 18px 38px;
  border-radius: 999px;
  letter-spacing: -1px;
  white-space: nowrap;
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 60px var(--color-glow);
  z-index: 100;
}

.toast.show { animation: toastShow 3.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }

@keyframes toastShow {
  0%   { transform: translateX(-50%) scale(0.5); opacity: 0; }
  18%  { transform: translateX(-50%) scale(1.08); opacity: 1; }
  30%  { transform: translateX(-50%) scale(1); opacity: 1; }
  82%  { transform: translateX(-50%) scale(1); opacity: 1; }
  100% { transform: translateX(-50%) scale(0.92); opacity: 0; }
}

/* ============ CONFETI ============ */
.confetti-layer {
  position: absolute; inset: 0;
  pointer-events: none; overflow: hidden; z-index: 50;
}

.confetti {
  position: absolute; width: 12px; height: 12px; top: -16px;
  border-radius: 2px;
  animation: confettiFall 2.8s linear forwards;
  will-change: transform, opacity;
}

@keyframes confettiFall {
  0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* ============ VERTICAL TIKTOK LIVE (1080x1920): proporcional pero SIGUE delgado ============ */
@media (max-aspect-ratio: 9/16) {
  .widget {
    width: clamp(560px, 75vw, 820px);
    padding: 18px 28px 20px;
    border-radius: 26px;
  }
  .heart { width: 38px; height: 38px; }
  .counter-num { font-size: 48px; }
  .counter-goal { font-size: 22px; }
  .percent { font-size: 22px; }
  .bar { height: 7px; }
  .toast { font-size: 44px; padding: 22px 44px; }
}
