/* ============================================================
   NEONBET · Homepage — hero video · live-wins ticker · game rails ·
   providers marquee.  (frontend-redesign-v2 · designer port)
   ------------------------------------------------------------
   Faithful port of the designer package (pages/home.css +
   components.css), re-expressed on tokens.css. js/home.js injects
   the markup and drives every rail / ticker / provider from the LIVE
   data layer (admin /api/categories + /api/games/lobby), preserving
   game launch. No backend / API changes.
   ============================================================ */

/* ---- Retire production-only chrome + legacy lobby (kept in DOM, hidden) ---- */
#bg-canvas, #confetti-canvas,
#main-screen > main > .hero,
#main-screen > main > .jackpot-ticker,
#main-screen > main > .games-section { display: none !important; }
body::after { display: none !important; }   /* CRT scanline overlay */

/* ---- Designer navy field behind the homepage ---- */
#main-screen {
  background:
    radial-gradient(1400px 700px at 75% -10%, rgba(27,40,106,0.55), transparent 65%),
    radial-gradient(1100px 600px at -10% 35%, rgba(22,33,90,0.55), transparent 65%),
    radial-gradient(900px 500px at 50% 115%, rgba(0,229,255,0.06), transparent 65%),
    var(--bg-base);
  background-attachment: fixed;
}
#nb-home { position: relative; z-index: 1; }

/* ---- Layout primitives ---- */
#nb-home .container { width: 100%; max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-5); }
@media (min-width: 768px) { #nb-home .container { padding: 0 var(--space-8); } }
#nb-home .section { padding: var(--space-4) 0; }
@media (min-width: 768px)  { #nb-home .section { padding: var(--space-5) 0; } }
@media (min-width: 1280px) { #nb-home .section { padding: var(--space-6) 0; } }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.section-head h2 { margin: 0; font-family: var(--font-sans); font-weight: 700; font-size: clamp(1.4rem, 2vw + 0.7rem, 2rem); letter-spacing: 0.03em; line-height: 1; text-transform: uppercase; color: var(--text-primary); }
.section-head .link-all { color: var(--text-secondary); font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; display: inline-flex; align-items: center; gap: var(--space-1); text-decoration: none; transition: color var(--dur-fast) var(--ease-out); }
.section-head .link-all:hover { color: var(--casino-gold); }
.rail-title-group { display: flex; align-items: center; gap: var(--space-3); }
.rail-icon { flex-shrink: 0; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--neon-cyan); }
.rail-icon svg { width: 24px; height: 24px; }
.rail-icon.is-magenta { color: var(--neon-magenta); }
.rail-icon.is-violet  { color: #b49bff; }
.rail-icon.is-gold    { color: var(--gold-premium); }

/* ---- Hero — welcome video ---- */
.hero-v2 { padding: var(--space-5) 0 var(--space-3); }
.hero-card { position: relative; border-radius: 20px; overflow: hidden; border: 1px solid var(--border-subtle); isolation: isolate; }
.hero-card.hero-welcome { height: auto; display: block; max-width: 640px; margin: 0 auto; box-shadow: 0 12px 40px rgba(0,0,0,0.35); }
@media (max-width: 700px) { .hero-card { border-radius: 14px; } }
@media (min-width: 1280px) { .hero-card.hero-welcome { max-width: 720px; } }
.hero-welcome-video { display: block; width: 100%; height: auto; object-fit: contain; pointer-events: none; background: #0A1233; }
.hero-welcome-video::-webkit-media-controls { display: none !important; }

/* ---- Search ---- */
.home-search { max-width: 560px; margin: 0 auto; }
.home-search input {
  width: 100%; height: 48px; padding: 0 var(--space-5);
  background: var(--bg-surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-pill); color: var(--text-primary);
  font-family: var(--font-sans); font-size: var(--text-base);
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.home-search input::placeholder { color: var(--text-muted); }
.home-search input:focus { outline: none; border-color: var(--neon-cyan); box-shadow: 0 0 0 3px rgba(0,229,255,0.10); }

/* ============================================================
   Live-wins ticker
   ============================================================ */
.ticker { padding: var(--space-3) 0; }
.wins-marquee { display: flex; flex-direction: column; gap: var(--space-3); }
.wins-head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--space-1); }
.wins-tag { display: inline-flex; align-items: center; gap: 8px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--text-secondary); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 0 rgba(61,220,151,0.65); animation: live-pulse 1.6s ease-out infinite; flex-shrink: 0; }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(61,220,151,0.65); } 70% { box-shadow: 0 0 0 6px rgba(61,220,151,0); } 100% { box-shadow: 0 0 0 0 rgba(61,220,151,0); } }
.wins-marquee-viewport { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0%, #000 5%, #000 95%, transparent 100%); }
.wins-track { display: flex; gap: var(--space-3); width: max-content; animation: wins-scroll 60s linear infinite; }
.wins-marquee-viewport:hover .wins-track { animation-play-state: paused; }
@keyframes wins-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.win-card { flex: 0 0 auto; width: 280px; position: relative; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); text-decoration: none; color: inherit; overflow: hidden; isolation: isolate; transition: border-color 220ms var(--ease-out), transform 220ms var(--ease-out); }
.win-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.win-thumb { flex-shrink: 0; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-subtle); background: var(--bg-elevated); }
.win-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.win-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.win-row1 { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); }
.win-row1-left { display: inline-flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; }
.win-row2 { display: flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-secondary); }
.win-user { font-family: var(--font-display); font-weight: 400; font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-game { font-family: var(--font-display); font-weight: 400; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.win-amt { font-family: var(--font-display); font-variant-numeric: tabular-nums; font-weight: 700; font-size: var(--text-sm); letter-spacing: -0.015em; color: var(--text-primary); white-space: nowrap; }
.win-card.is-gold .win-amt, .win-card.is-big .win-amt, .win-card.is-mega .win-amt { background: var(--grad-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.win-card.is-big { border-color: rgba(232,194,106,0.55); box-shadow: 0 0 0 1px rgba(232,194,106,0.20) inset, 0 4px 16px rgba(232,194,106,0.10); }
.win-card.is-mega { border-color: rgba(255,46,147,0.7); }
.win-badge { display: inline-flex; align-items: center; font-family: var(--font-display); font-weight: 400; font-size: 0.58rem; letter-spacing: 0.14em; padding: 2px 7px; border-radius: var(--radius-pill); text-transform: uppercase; flex-shrink: 0; line-height: 1.5; }
.win-badge-big { background: linear-gradient(135deg, rgba(232,194,106,0.18), rgba(232,194,106,0.30)); color: var(--gold-premium); border: 1px solid rgba(232,194,106,0.5); }
.win-badge-mega { background: var(--grad-primary); color: #fff; border: 1px solid rgba(255,255,255,0.18); }
@media (prefers-reduced-motion: reduce) { .live-dot, .wins-track { animation: none; } }

/* ============================================================
   Game rails + cards
   ============================================================ */
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: 140px; gap: var(--space-3); overflow-x: auto; padding-bottom: var(--space-3); scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 640px)  { .rail { grid-auto-columns: 160px; } }
@media (min-width: 1024px) { .rail { grid-auto-columns: 180px; } }

.game-card { position: relative; display: block; border-radius: var(--radius-md); overflow: hidden; background: var(--bg-surface); border: 1px solid var(--border-subtle); aspect-ratio: 5/6; isolation: isolate; text-decoration: none; transition: transform 260ms var(--ease-out), border-color 260ms var(--ease-out), box-shadow 260ms var(--ease-out); }
.game-card:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 18px 40px rgba(0,0,0,0.55); }
.game-card-bg { position: absolute; inset: 0; background-size: cover; background-position: center; background-repeat: no-repeat; filter: blur(14px) saturate(1.1) brightness(0.65); transform: scale(1.10); z-index: 0; }
.game-card:hover .game-card-bg { transform: scale(1.15); filter: blur(16px) saturate(1.2) brightness(0.55); }
.game-card-thumb, .game-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 35%; z-index: 1; transition: transform 520ms var(--ease-out), filter 260ms var(--ease-out); }
.game-card:hover .game-card-thumb, .game-card:hover img { transform: scale(1.06); }
.game-icon-fallback { position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
.game-card-foot { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: var(--space-5) var(--space-3) var(--space-2); background: linear-gradient(180deg, transparent 0%, rgba(7,7,12,0.55) 55%, rgba(7,7,12,0.92) 100%); pointer-events: none; display: flex; flex-direction: column; text-align: left; }
.game-card-name-text { font-family: var(--font-display); font-size: 0.76rem; font-weight: 400; letter-spacing: 0.025em; text-transform: uppercase; line-height: 1.05; color: #fff; text-shadow: 0 1px 0 rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.85); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; overflow: hidden; overflow-wrap: anywhere; word-break: break-word; }
.game-card-provider { display: block; font-family: var(--font-sans); font-size: 0.72rem; font-weight: 500; letter-spacing: 0.01em; color: rgba(255,255,255,0.78); text-shadow: 0 1px 0 rgba(0,0,0,0.55), 0 2px 6px rgba(0,0,0,0.80); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; opacity: 0; transform: translateY(4px); transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out); }
.game-card:hover .game-card-provider, .game-card:focus-visible .game-card-provider { opacity: 1; transform: translateY(0); }
.game-card-fav { position: absolute; top: var(--space-2); right: var(--space-2); z-index: 5; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 50%; background: rgba(7,7,12,0.45); color: rgba(255,255,255,0.85); cursor: pointer; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out); }
.game-card-fav:hover { background: rgba(7,7,12,0.65); color: #fff; transform: scale(1.08); }
.game-card-fav svg { width: 18px; height: 18px; }
.game-card-fav.is-active { color: #ff2e93; background: rgba(255,46,147,0.18); }
.game-card-fav.is-active svg { fill: currentColor; }
.game-card-badges { position: absolute; top: var(--space-2); left: var(--space-2); z-index: 4; display: flex; gap: 4px; }
.game-card-cta { position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; opacity: 0; transform: translateY(4px); transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out); background: rgba(7,7,12,0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.game-card:hover .game-card-cta, .game-card:focus-visible .game-card-cta { opacity: 1; transform: translateY(0); }
.game-card-cta .btn { box-shadow: 0 0 24px rgba(255,46,147,0.35); min-width: 96px; }

/* Badges (designer) */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px var(--space-2); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; border-radius: var(--radius-xs); color: var(--text-inverse); }
.badge-new { background: var(--neon-cyan); }
.badge-hot { background: var(--neon-magenta); color: #fff; }
.badge-jackpot { background: var(--grad-gold); color: var(--text-inverse); }

/* Skeletons */
.game-card-skel { aspect-ratio: 5/6; border-radius: var(--radius-md); background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 100%); background-size: 200% 100%; animation: skel-shimmer 1.4s linear infinite; }
@keyframes skel-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .game-card-skel { animation: none; } }

/* ============================================================
   Providers marquee
   ============================================================ */
.providers-marquee { position: relative; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%); mask-image: linear-gradient(90deg, transparent 0%, #000 6%, #000 94%, transparent 100%); }
.providers-track { display: flex; gap: var(--space-3); width: max-content; animation: providers-scroll 36s linear infinite; }
.providers-marquee:hover .providers-track { animation-play-state: paused; }
.providers-track .provider-chip { flex: 0 0 auto; width: 200px; height: 96px; }
@media (min-width: 768px) { .providers-track .provider-chip { width: 220px; } }
@keyframes providers-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .providers-track { animation: none; } }
.provider-chip { position: relative; display: inline-flex; align-items: center; justify-content: center; height: 96px; padding: var(--space-5) var(--space-6); border-radius: var(--radius-lg); border: 1px solid var(--border-subtle); overflow: hidden; isolation: isolate; color: var(--text-primary); text-decoration: none; transition: transform var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out); }
.provider-chip::before { content: ""; position: absolute; inset: 0; z-index: -2; background: var(--bg-surface); }
.provider-chip::after { content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.55; background: radial-gradient(circle at 80% 80%, rgba(255,46,147,0.30), transparent 60%), radial-gradient(circle at 10% 10%, rgba(0,229,255,0.18), transparent 60%); transition: opacity var(--dur-base) var(--ease-out); }
.provider-chip:hover { transform: translateY(-3px); border-color: var(--neon-cyan); }
.provider-chip:hover::after { opacity: 0.85; }
.provider-fallback { font-family: var(--font-display); font-weight: 700; font-size: var(--text-sm); color: var(--text-primary); letter-spacing: 0.04em; opacity: 0.65; transition: opacity 240ms var(--ease-out); text-align: center; }
.provider-chip:hover .provider-fallback { opacity: 1; }

/* Empty state */
.nb-empty { padding: var(--space-10) var(--space-5); text-align: center; color: var(--text-muted); font-size: var(--text-sm); }

/* ============================================================
   Live strips — TOP SLOTS / LIVE BLACKJACK feature sections (FIX-1)
   ============================================================ */
.live-strip { position: relative; display: grid; grid-template-columns: 1fr; gap: 0; background: var(--bg-surface); border: 1px solid var(--border-subtle); border-radius: var(--radius-xl); overflow: hidden; isolation: isolate; }
@media (min-width: 900px) { .live-strip { grid-template-columns: 1.05fr 1fr; } .live-strip.live-strip-reverse { grid-template-columns: 1fr 1.05fr; } }
.live-strip-media { position: relative; width: 100%; aspect-ratio: 16/9; background: #0a0f24; overflow: hidden; }
@media (min-width: 900px) { .live-strip-media { aspect-ratio: auto; height: 100%; min-height: 300px; } }
.live-strip-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; filter: contrast(1.06) saturate(1.1) brightness(1.02); pointer-events: none; }
.live-strip-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(10,18,51,0.65) 100%); pointer-events: none; }
@media (min-width: 900px) { .live-strip-media::after { background: linear-gradient(90deg, transparent 60%, rgba(10,18,51,0.55) 100%); } .live-strip-reverse .live-strip-media::after { background: linear-gradient(270deg, transparent 60%, rgba(10,18,51,0.55) 100%); } }
.live-strip-copy { padding: var(--space-6); display: flex; flex-direction: column; justify-content: center; gap: var(--space-3); }
@media (min-width: 900px) { .live-strip-copy { padding: var(--space-8); } }
.live-strip-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-display); font-weight: 400; font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.18em; color: var(--danger); align-self: flex-start; padding: 6px 12px; background: rgba(255,84,112,0.10); border: 1px solid rgba(255,84,112,0.30); border-radius: var(--radius-pill); }
.live-strip-eyebrow-gold { color: var(--casino-gold); background: rgba(255,196,40,0.12); border-color: rgba(255,196,40,0.35); }
.live-strip-eyebrow .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 0 rgba(255,84,112,0.5); animation: live-pulse-strip 1.8s ease-out infinite; }
.live-strip-eyebrow .live-dot-gold { background: var(--casino-gold); }
@keyframes live-pulse-strip { 0% { box-shadow: 0 0 0 0 rgba(255,84,112,0.55); } 60% { box-shadow: 0 0 0 10px rgba(255,84,112,0); } 100% { box-shadow: 0 0 0 0 rgba(255,84,112,0); } }
.live-strip-title { margin: 0; font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.02em; font-size: clamp(1.6rem, 2.4vw, 2.2rem); line-height: 1.05; max-width: 20ch; color: var(--text-primary); }
.live-strip-sub { margin: 0; color: var(--text-secondary); font-size: var(--text-base); line-height: 1.5; max-width: 42ch; }
.live-strip-actions { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-3); flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .live-strip-eyebrow .live-dot { animation: none; } }
