/* ==========================================================================
   LIVE-STREAMS WIDGET  (game-hub "Live on Twitch" module)
   All rules scoped under .live-feed so nothing leaks into the rest of the site.
   Uses the design tokens defined in style.css :root (loaded first).
   Docs: docs/CONTENT-PLAYBOOK.md §I
   ========================================================================== */
.live-feed { position: relative; margin: 3rem 0; }
.live-feed::before {
    content: ''; position: absolute; top: -1.25rem; left: 50%; transform: translateX(-50%);
    width: 60%; height: 1px; background: linear-gradient(90deg, transparent, var(--c-neon-cyan), transparent);
}
.live-feed .lsw-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.live-feed .lsw-title h2 { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.25rem); letter-spacing: -0.02em; line-height: 1.15; margin: 0.4rem 0 0; }
.live-feed .lsw-title h2 .accent { color: var(--c-accent); }
.live-feed .lsw-title p { color: var(--c-text-secondary); font-size: 1rem; margin: 0.3rem 0 0; max-width: 52ch; }
.live-feed .lsw-event-line { font-family: var(--font-mono); font-size: 0.78rem; color: var(--c-neon-gold); margin-top: 0.5rem; display: none; }
.live-feed .lsw-event-line.show { display: block; }

.live-feed .lsw-sort {
    font-family: var(--font-head); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em;
    padding: 0.45rem 0.85rem; border-radius: 50px; border: 1px solid var(--c-border); background: var(--c-bg-card);
    color: var(--c-text-secondary); cursor: pointer; transition: all 0.2s ease;
}
.live-feed .lsw-sort:hover { border-color: var(--c-accent); color: var(--c-accent); }

/* notices (fallback states) */
.live-feed .lsw-notice { display: flex; align-items: center; gap: 0.65rem; padding: 0.75rem 1rem; border-radius: var(--border-radius-sm); font-size: 0.88rem; margin-bottom: 1.4rem; }
.live-feed .lsw-notice[hidden] { display: none; }
.live-feed .lsw-notice.info { background: rgba(145,70,255,0.08); border: 1px solid rgba(145,70,255,0.3); color: var(--c-text-secondary); }
.live-feed .lsw-notice.warn { background: rgba(255,107,0,0.1); border: 1px solid rgba(255,107,0,0.35); color: var(--c-neon-orange); }
.live-feed .lsw-notice b { color: var(--c-text-primary); }

/* grid + cards */
.live-feed .lsw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.live-feed .lsw-card {
    background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--border-radius);
    overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
.live-feed .lsw-card:hover { transform: translateY(-4px); border-color: var(--c-accent); box-shadow: var(--glow-cyan); }
.live-feed .lsw-card.is-event { border-color: rgba(255,215,0,0.4); }
.live-feed .lsw-card.is-event:hover { border-color: var(--c-neon-gold); box-shadow: 0 0 20px rgba(255,215,0,0.35); }

.live-feed .lsw-thumb {
    position: relative; aspect-ratio: 16 / 9; overflow: hidden;
    background: linear-gradient(160deg, #14141d 0%, #0b0b10 100%);
}
.live-feed .lsw-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(40%) brightness(0.92) contrast(1.04); transition: filter 0.4s ease, transform 0.4s ease; }
.live-feed .lsw-card:hover .lsw-thumb img { filter: grayscale(0%) brightness(1) contrast(1.08); transform: scale(1.03); }

.live-feed .lsw-badges { position: absolute; top: 0.55rem; left: 0.55rem; display: flex; flex-direction: column; gap: 0.3rem; align-items: flex-start; z-index: 1; }
.live-feed .lsw-badge { display: inline-flex; align-items: center; gap: 0.35rem; font-family: var(--font-head); font-weight: 700; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: #fff; padding: 0.2rem 0.45rem; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.live-feed .lsw-badge.live { background: var(--c-neon-red); }
.live-feed .lsw-badge.clip { background: var(--c-twitch); }
.live-feed .lsw-badge.event { background: linear-gradient(135deg, var(--c-neon-gold), var(--c-neon-orange)); color: #0d0d0f; }
.live-feed .lsw-badge .dot { width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: lsw-pulse 1.5s ease-in-out infinite; }
@keyframes lsw-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

.live-feed .lsw-metric { position: absolute; top: 0.55rem; right: 0.55rem; display: inline-flex; align-items: center; gap: 0.3rem; font-family: var(--font-mono); font-weight: 700; font-size: 0.7rem; font-variant-numeric: tabular-nums; color: #fff; background: rgba(0,0,0,0.6); padding: 0.2rem 0.45rem; border-radius: 4px; z-index: 1; }
.live-feed .lsw-metric::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c-neon-red); }
.live-feed .lsw-metric.views::before { background: var(--c-twitch); }
.live-feed .lsw-corner { position: absolute; bottom: 0.55rem; right: 0.55rem; font-family: var(--font-mono); font-size: 0.66rem; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.85); background: rgba(0,0,0,0.55); padding: 0.12rem 0.35rem; border-radius: 3px; z-index: 1; }

.live-feed .lsw-body { display: flex; gap: 0.7rem; padding: 0.85rem 0.9rem 1rem; }
.live-feed .lsw-avatar { flex-shrink: 0; width: 38px; height: 38px; border-radius: 50%; object-fit: cover; display: grid; place-items: center; font-family: var(--font-head); font-weight: 700; font-size: 0.85rem; color: #0d0d0f; outline: 2px solid var(--c-accent); }
.live-feed .lsw-meta { min-width: 0; }
.live-feed .lsw-name { font-family: var(--font-head); font-weight: 600; font-size: 0.92rem; line-height: 1.3; color: var(--c-text-primary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 0.2rem; }
.live-feed .lsw-chan { font-size: 0.8rem; color: var(--c-text-secondary); font-weight: 500; }
.live-feed .lsw-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; }
.live-feed .lsw-tag { font-family: var(--font-mono); font-size: 0.63rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--c-text-muted); background: var(--c-bg-elevated); border: 1px solid var(--c-border); padding: 0.15rem 0.45rem; border-radius: 50px; }
.live-feed .lsw-tag.first { color: var(--c-neon-lime); border-color: rgba(0,255,136,0.3); background: rgba(0,255,136,0.07); }
.live-feed .lsw-tag.clip { color: var(--c-twitch); border-color: rgba(145,70,255,0.3); background: rgba(145,70,255,0.08); }

/* divider labels between event cluster and normal streams */
.live-feed .lsw-rowlabel { grid-column: 1 / -1; display: flex; align-items: center; gap: 0.6rem; font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--c-text-muted); margin: 0.1rem 0 -0.4rem; }
.live-feed .lsw-rowlabel::after { content: ''; flex: 1; height: 1px; background: var(--c-border); }
.live-feed .lsw-rowlabel.event { color: var(--c-neon-gold); }

/* skeleton (initial load) */
.live-feed .lsw-skel { background: var(--c-bg-card); border: 1px solid var(--c-border); border-radius: var(--border-radius); aspect-ratio: 16 / 9; position: relative; overflow: hidden; }
.live-feed .lsw-skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.05) 50%, transparent 80%); background-size: 200% 100%; animation: lsw-shimmer 1.2s linear infinite; }
@keyframes lsw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* footer */
.live-feed .lsw-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 1.8rem; }
.live-feed .lsw-all { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-head); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: #fff; background: var(--c-twitch); padding: 0.75rem 1.4rem; border-radius: var(--border-radius-sm); text-decoration: none; transition: all 0.2s ease; }
.live-feed .lsw-all:hover { transform: translateY(-2px); box-shadow: 0 0 24px rgba(145,70,255,0.5); }
.live-feed .lsw-all svg { width: 15px; height: 15px; fill: currentColor; }
.live-feed .lsw-note { font-size: 0.75rem; color: var(--c-text-muted); max-width: 52ch; line-height: 1.5; margin: 0; }

/* ---- betting-events module (#49): live table under "Bet on Your Favorite Esports" ---- */
.live-feed.betting-feed .lsw-title h3.lsw-h { font-family: var(--font-head); font-weight: 700; font-size: clamp(1.15rem, 2vw, 1.5rem); letter-spacing: -0.01em; margin: 0.3rem 0 0; }
.live-feed.betting-feed .lsw-grid { display: block; }   /* betting module holds a table, not the card grid — scoped so the per-game hub widget keeps its 3-up grid */

.live-feed .bc-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--c-border); border-radius: var(--border-radius); background: var(--c-bg-card); }
.live-feed .bc-table { width: 100%; min-width: 720px; border-collapse: collapse; font-size: 0.9rem; }
.live-feed .bc-table thead th { text-align: left; font-family: var(--font-mono); font-size: 0.66rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--c-text-muted); font-weight: 600; padding: 0.8rem 1rem; border-bottom: 1px solid var(--c-border); white-space: nowrap; }
.live-feed .bc-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--c-border); vertical-align: middle; }
.live-feed .bc-table tbody tr:last-child td { border-bottom: none; }
.live-feed .bc-row { transition: background 0.2s ease; }
.live-feed .bc-row:hover { background: var(--c-bg-elevated); }
.live-feed .bc-row.is-event { box-shadow: inset 3px 0 0 var(--c-neon-gold); }

.live-feed .lsw-badge.game { position: static; box-shadow: none; background: rgba(255,255,255,0.06); color: var(--c-text-secondary); border: 1px solid var(--c-border); white-space: nowrap; }
.live-feed .bc-c-what .lsw-badge { position: static; box-shadow: none; margin-bottom: 0.4rem; }
.live-feed .bc-what { font-family: var(--font-head); font-weight: 600; font-size: 0.98rem; line-height: 1.3; color: var(--c-text-primary); max-width: 34ch; }
.live-feed .bc-chan { font-size: 0.78rem; color: var(--c-text-muted); margin-top: 0.15rem; }
.live-feed .bc-chan b { color: var(--c-text-secondary); font-weight: 600; }
.live-feed .bc-c-why { color: var(--c-text-secondary); max-width: 34ch; line-height: 1.45; }
.live-feed .bc-c-view { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--c-text-primary); white-space: nowrap; }
.live-feed .bc-c-act { white-space: nowrap; text-align: right; }
.live-feed .bc-watch { font-family: var(--font-head); font-weight: 600; font-size: 0.8rem; color: var(--c-text-secondary); text-decoration: none; margin-right: 0.75rem; transition: color 0.2s ease; }
.live-feed .bc-watch:hover { color: var(--c-accent); }
.live-feed .lsw-cta {
    display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 0.9rem;
    border-radius: var(--border-radius-sm); font-family: var(--font-head); font-weight: 700;
    font-size: 0.8rem; text-decoration: none; color: #0d0d0f; background: var(--c-accent);
    transition: filter 0.2s ease, box-shadow 0.2s ease;
}
.live-feed .lsw-cta span { transition: transform 0.2s ease; }
.live-feed .lsw-cta:hover { filter: brightness(1.05); box-shadow: var(--glow-cyan); }
.live-feed .lsw-cta:hover span { transform: translateX(3px); }
.live-feed .bc-row.is-event .lsw-cta { background: linear-gradient(135deg, var(--c-neon-gold), var(--c-neon-orange)); }

.live-feed .bc-skel { height: 52px; border-bottom: 1px solid var(--c-border); position: relative; overflow: hidden; background: var(--c-bg-card); }
.live-feed .bc-skel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.05) 50%, transparent 80%); background-size: 200% 100%; animation: lsw-shimmer 1.2s linear infinite; }
.live-feed .lsw-all--bet { background: var(--c-accent); color: #0d0d0f; }
.live-feed .lsw-all--bet:hover { box-shadow: var(--glow-cyan); }
@media (max-width: 640px) {
    .live-feed .bc-h-why, .live-feed .bc-c-why { display: none; }
    .live-feed .bc-table { min-width: 520px; }
}
/* per-game hub widget: exactly 3 across on desktop (scoped so the homepage betting table is untouched) */
@media (min-width: 992px) {
    .live-feed[data-game] .lsw-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.live-feed[hidden] { display: none; }
@media (max-width: 560px) {
    .live-feed .lsw-head { flex-direction: column; align-items: flex-start; }
    .live-feed .lsw-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .live-feed *, .live-feed *::before, .live-feed *::after { animation: none !important; transition: none !important; } }
