/* ============================================================
   FarmBrawl — Live FOMO ticker (EN VIVO)
   Full-width strip ABOVE the resource topbar.
   Wood plank + gold edge language (matches topbar-farm).
   ============================================================ */

#live-feed-bar {
  --lf-h: 42px;
  --lf-gold: rgba(196, 154, 32, 0.45);
  --lf-wood-hi: #2e2418;
  --lf-wood-mid: #1c1610;
  --lf-wood-lo: #100c08;
  position: relative;
  flex-shrink: 0;
  width: 100%;
  height: var(--lf-h);
  display: flex;
  align-items: stretch;
  box-sizing: border-box;
  background:
    /* soft center glow so the strip doesn't feel empty */
    radial-gradient(ellipse 70% 120% at 50% 50%, rgba(196, 154, 32, 0.07) 0%, transparent 70%),
    repeating-linear-gradient(
      90deg,
      rgba(255, 220, 150, 0.035) 0 2px,
      transparent 2px 14px
    ),
    linear-gradient(180deg, var(--lf-wood-hi) 0%, var(--lf-wood-mid) 55%, var(--lf-wood-lo) 100%);
  border-bottom: 2px solid #0a0806;
  box-shadow:
    0 0 0 1px var(--lf-gold),
    inset 0 1px 0 rgba(255, 220, 150, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  z-index: 101;
  overflow: hidden;
}

/* Gold studs on the left & right rails */
#live-feed-bar::before,
#live-feed-bar::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-radius: 1px;
  background: linear-gradient(180deg, #f0d060, #c49a20);
  border: 1px solid #0a0806;
  box-shadow: 0 0 6px rgba(240, 208, 96, 0.35);
  pointer-events: none;
  z-index: 2;
}
#live-feed-bar::before { left: 8px; }
#live-feed-bar::after { right: 8px; }

/* Slow sheen across the plank */
#live-feed-bar > .live-feed-sheen {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    105deg,
    transparent 35%,
    rgba(255, 236, 180, 0.06) 48%,
    rgba(255, 236, 180, 0.1) 50%,
    rgba(255, 236, 180, 0.06) 52%,
    transparent 65%
  );
  background-size: 220% 100%;
  animation: liveFeedSheen 7.5s ease-in-out infinite;
  z-index: 0;
}

@keyframes liveFeedSheen {
  0%, 100% { background-position: 120% 0; opacity: 0.35; }
  40% { opacity: 0.7; }
  55% { background-position: -40% 0; opacity: 0.55; }
}

/* Full-width tray */
#live-feed-container,
.live-feed-pill {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 22px 0 20px;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  pointer-events: auto;
}

/* Left LIVE badge — single hard edge (no double ring) */
.live-feed-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 12px;
  font-family: var(--font-game, "Press Start 2P", monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: #052e1c;
  text-transform: uppercase;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.25);
  background: linear-gradient(180deg, #86efac 0%, #34d399 48%, #059669 100%);
  border: 2px solid #0a0806;
  border-radius: 0;
  box-shadow:
    0 2px 0 #0a0806,
    0 0 12px rgba(52, 211, 153, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.live-feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #052e1c;
  box-shadow:
    0 0 0 1px rgba(5, 46, 28, 0.2),
    0 0 8px rgba(5, 46, 28, 0.55);
  animation: liveFeedPulse 1.35s ease-in-out infinite;
}

@keyframes liveFeedPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.78); }
}

/* Divider between badge and message track */
.live-feed-sep {
  flex-shrink: 0;
  width: 2px;
  height: 20px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(196, 154, 32, 0.55) 20%,
    rgba(240, 208, 96, 0.75) 50%,
    rgba(196, 154, 32, 0.55) 80%,
    transparent
  );
  box-shadow: 1px 0 0 rgba(0, 0, 0, 0.35);
}

/* Message stage — inset wood tray so text has a “home” */
.live-feed-track {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  background: rgba(0, 0, 0, 0.38);
  border: 2px solid #0a0806;
  box-shadow:
    0 0 0 1px rgba(196, 154, 32, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 0 12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* Soft gold edge pulse on the track */
.live-feed-track::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f0d060, #c49a20 50%, #8a6a14);
  opacity: 0.85;
  pointer-events: none;
}

/* ── Toast messages inside the track ── */
#live-feed-container .fb-toast,
.live-feed-pill .fb-toast,
.live-feed-track .fb-toast {
  position: relative;
  left: auto;
  right: auto;
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  white-space: nowrap;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.2;
  color: #f5ecdc;
  text-shadow: 1px 1px 0 #000;
  pointer-events: auto;
  animation: fbLiveIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  transition: opacity 0.28s ease, transform 0.28s ease;
  padding-left: 4px;
}

#live-feed-container .fb-toast--out,
.live-feed-pill .fb-toast--out,
.live-feed-track .fb-toast--out {
  opacity: 0 !important;
  transform: translateY(-8px) !important;
}

#live-feed-container .fb-body,
.live-feed-pill .fb-body,
.live-feed-track .fb-body {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
  letter-spacing: -0.01em;
}

#live-feed-container .fb-body b,
.live-feed-pill .fb-body b,
.live-feed-track .fb-body b {
  font-weight: 800;
  color: #fff8e8;
}

#live-feed-container .fb-ico,
.live-feed-pill .fb-ico,
.live-feed-track .fb-ico {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid #0a0806;
  box-shadow:
    0 0 0 1px rgba(196, 154, 32, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Type-tinted icons */
.live-feed-track .fb-toast--harvest .fb-ico,
#live-feed-container .fb-toast--harvest .fb-ico {
  background: rgba(245, 158, 11, 0.28);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.live-feed-track .fb-toast--exchange .fb-ico,
.live-feed-track .fb-toast--withdraw .fb-ico,
#live-feed-container .fb-toast--exchange .fb-ico,
#live-feed-container .fb-toast--withdraw .fb-ico {
  background: rgba(16, 185, 129, 0.26);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.live-feed-track .fb-toast--raid .fb-ico,
#live-feed-container .fb-toast--raid .fb-ico {
  background: rgba(239, 68, 68, 0.26);
  box-shadow: 0 0 0 1px rgba(239, 68, 68, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.live-feed-track .fb-toast--stake .fb-ico,
#live-feed-container .fb-toast--stake .fb-ico {
  background: rgba(139, 92, 246, 0.26);
  box-shadow: 0 0 0 1px rgba(139, 92, 246, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.live-feed-track .fb-toast--shop .fb-ico,
.live-feed-track .fb-toast--market .fb-ico,
.live-feed-track .fb-toast--plant .fb-ico,
#live-feed-container .fb-toast--shop .fb-ico,
#live-feed-container .fb-toast--market .fb-ico,
#live-feed-container .fb-toast--plant .fb-ico {
  background: rgba(148, 163, 184, 0.2);
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.live-feed-track .fb-toast--roulette .fb-ico,
#live-feed-container .fb-toast--roulette .fb-ico {
  background: rgba(251, 191, 36, 0.28);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

/* Colored left accent on toast type (extra of the track gold bar) */
.live-feed-track .fb-toast--harvest { --fb-accent: #f59e0b; }
.live-feed-track .fb-toast--exchange,
.live-feed-track .fb-toast--withdraw { --fb-accent: #34d399; }
.live-feed-track .fb-toast--raid { --fb-accent: #f87171; }
.live-feed-track .fb-toast--stake { --fb-accent: #a78bfa; }
.live-feed-track .fb-toast--shop,
.live-feed-track .fb-toast--market,
.live-feed-track .fb-toast--plant { --fb-accent: #94a3b8; }
.live-feed-track .fb-toast--roulette { --fb-accent: #fcd34d; }

.live-feed-track:has(.fb-toast--harvest)::before { background: linear-gradient(180deg, #fcd34d, #f59e0b 50%, #b45309); }
.live-feed-track:has(.fb-toast--exchange)::before,
.live-feed-track:has(.fb-toast--withdraw)::before { background: linear-gradient(180deg, #6ee7b7, #10b981 50%, #047857); }
.live-feed-track:has(.fb-toast--raid)::before { background: linear-gradient(180deg, #fca5a5, #ef4444 50%, #991b1b); }
.live-feed-track:has(.fb-toast--stake)::before { background: linear-gradient(180deg, #c4b5fd, #8b5cf6 50%, #5b21b6); }
.live-feed-track:has(.fb-toast--shop)::before,
.live-feed-track:has(.fb-toast--market)::before,
.live-feed-track:has(.fb-toast--plant)::before { background: linear-gradient(180deg, #cbd5e1, #94a3b8 50%, #475569); }
.live-feed-track:has(.fb-toast--roulette)::before { background: linear-gradient(180deg, #fde68a, #fbbf24 50%, #b45309); }

#live-feed-container .fb-wallet,
.live-feed-track .fb-wallet {
  color: #c4b49a;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88em;
}

#live-feed-container .fb-usdc,
.live-feed-track .fb-usdc {
  color: #6ee7b7;
  font-weight: 800;
}
#live-feed-container .fb-bc,
.live-feed-track .fb-bc {
  color: #7dd3fc;
  font-weight: 800;
}
#live-feed-container .fb-dna,
.live-feed-track .fb-dna {
  color: #c4b5fd;
  font-weight: 800;
}
#live-feed-container .fb-gold,
.live-feed-track .fb-gold {
  color: #f0d060;
  font-weight: 800;
}
#live-feed-container .fb-item,
.live-feed-track .fb-item {
  color: #fbbf24;
  font-weight: 700;
}
#live-feed-container .fb-muted,
.live-feed-track .fb-muted {
  color: #a89880;
  font-weight: 600;
  font-size: 0.9em;
}

#live-feed-container .fb-time,
.live-feed-track .fb-time {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 10px;
  color: #7a6a52;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(196, 154, 32, 0.18);
}

@keyframes fbLiveIn {
  0% {
    opacity: 0;
    transform: translateX(12px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Empty state hint when no toast yet */
.live-feed-track:empty::after,
.live-feed-track:not(:has(.fb-toast))::after {
  content: "Actividad de la granja…";
  color: #6b5d4a;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding-left: 6px;
  text-shadow: 1px 1px 0 #000;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  #live-feed-bar {
    --lf-h: 38px;
  }

  #live-feed-container,
  .live-feed-pill {
    padding: 0 16px 0 14px;
    gap: 8px;
  }

  .live-feed-badge {
    height: 24px;
    font-size: 8px;
    padding: 0 9px;
  }

  .live-feed-track {
    height: 26px;
    padding: 0 8px;
  }

  #live-feed-container .fb-toast,
  .live-feed-track .fb-toast {
    font-size: 12px;
    gap: 8px;
  }

  #live-feed-container .fb-ico,
  .live-feed-track .fb-ico {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
}

@media (max-width: 560px) {
  #live-feed-bar {
    --lf-h: 34px;
  }

  #live-feed-bar::before,
  #live-feed-bar::after {
    display: none;
  }

  #live-feed-container,
  .live-feed-pill {
    padding: 0 8px;
    gap: 6px;
  }

  .live-feed-sep {
    display: none;
  }

  .live-feed-badge {
    font-size: 0;
    gap: 0;
    padding: 0 7px;
    width: 28px;
    height: 22px;
    justify-content: center;
  }

  .live-feed-dot {
    width: 8px;
    height: 8px;
  }

  .live-feed-track {
    height: 24px;
  }

  #live-feed-container .fb-toast,
  .live-feed-track .fb-toast {
    font-size: 11px;
  }

  #live-feed-container .fb-time,
  .live-feed-track .fb-time {
    display: none;
  }

  #live-feed-container .fb-ico,
  .live-feed-track .fb-ico {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }

  .live-feed-track:empty::after,
  .live-feed-track:not(:has(.fb-toast))::after {
    font-size: 10px;
  }
}
