/* =========================================================
   Interactive + organic Duel lobby layer
   ========================================================= */

:root {
  --glow: 0 0 0 1px rgba(76, 111, 255, 0.25), 0 12px 40px rgba(76, 111, 255, 0.22);
  --blob-a: rgba(76, 111, 255, 0.28);
  --blob-b: rgba(168, 85, 247, 0.18);
  --blob-c: rgba(34, 211, 238, 0.12);
}

/* Soft cursor glow */
.cursor-glow {
  pointer-events: none;
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(76, 111, 255, 0.16), transparent 68%);
  transform: translate(-50%, -50%);
  z-index: 5;
  opacity: 0;
  transition: opacity 0.35s ease;
  mix-blend-mode: screen;
}

body.has-pointer .cursor-glow {
  opacity: 1;
}

/* Organic floating blobs behind content */
.organic-bg {
  position: relative;
  isolation: isolate;
  overflow: hidden;
}

.organic-bg::before,
.organic-bg::after {
  content: "";
  position: absolute;
  z-index: 0;
  border-radius: 50%;
  filter: blur(48px);
  pointer-events: none;
  animation: blob-float 14s ease-in-out infinite;
}

.organic-bg::before {
  width: min(52vw, 520px);
  height: min(52vw, 520px);
  background: var(--blob-a);
  top: -12%;
  right: -8%;
}

.organic-bg::after {
  width: min(42vw, 420px);
  height: min(42vw, 420px);
  background: var(--blob-b);
  bottom: -18%;
  left: -10%;
  animation-delay: -6s;
}

.organic-bg > * {
  position: relative;
  z-index: 1;
}

@keyframes blob-float {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(24px, -18px) scale(1.08);
  }
}

/* ---- Hero upgrade ---- */
.duel-app .hero {
  min-height: clamp(380px, 56vw, 620px);
  border-radius: 0 0 28px 28px;
  margin: 0.75rem 0.75rem 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.duel-app .hero-bg {
  transform: scale(1.04);
  transition: transform 0.8s ease;
  will-change: transform;
}

.duel-app .hero.is-ready .hero-bg {
  transform: scale(1);
}

.duel-app .hero-content {
  max-width: 680px;
  padding: 4rem 0 3.2rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.35rem;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  font-size: 0.82rem;
  font-weight: 650;
  color: #e8edff;
}

.hero-chip strong {
  color: #7ea0ff;
  font-weight: 800;
}

.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(126, 160, 255, 0.85);
  box-shadow: 0 0 12px rgba(76, 111, 255, 0.8);
  animation: rise linear infinite;
  opacity: 0.7;
}

@keyframes rise {
  0% {
    transform: translateY(20px) scale(0.6);
    opacity: 0;
  }
  15% {
    opacity: 0.85;
  }
  100% {
    transform: translateY(-420px) scale(1);
    opacity: 0;
  }
}

/* ---- Live wins ticker ---- */
.live-rail {
  margin: 1rem 0.75rem 0;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(90deg, rgba(20, 26, 42, 0.95), rgba(14, 18, 32, 0.92));
  overflow: hidden;
  position: relative;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.live-rail-head {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0 1rem;
  background: linear-gradient(90deg, #121826 70%, transparent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #a8b6d8;
}

.live-rail-head .pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55);
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.55);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

.live-track {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 8.5rem;
  width: max-content;
  animation: marquee 38s linear infinite;
}

.live-rail:hover .live-track {
  animation-play-state: paused;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.live-pill b {
  color: #fff;
}

.live-pill em {
  font-style: normal;
  color: #7ea0ff;
  font-weight: 800;
}

@keyframes marquee {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---- Originals rail ---- */
.rail-section {
  padding: 1.5rem 0 0.5rem !important;
}

.rail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.rail-controls {
  display: flex;
  gap: 0.5rem;
}

.rail-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.rail-btn:hover {
  background: rgba(76, 111, 255, 0.2);
  border-color: rgba(76, 111, 255, 0.45);
  transform: translateY(-1px);
}

.rail-btn:active {
  transform: scale(0.96);
}

.orig-rail {
  display: flex;
  gap: 0.9rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0.35rem 0.15rem 1.1rem;
  scrollbar-width: none;
  cursor: grab;
}

.orig-rail.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.orig-rail::-webkit-scrollbar {
  display: none;
}

.orig-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  position: relative;
  flex: 0 0 clamp(148px, 18vw, 188px);
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  scroll-snap-align: start;
  text-decoration: none !important;
  color: #fff;
  background: #121826;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
  transform: perspective(900px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateZ(0);
  transition: transform 0.18s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  will-change: transform;
}

.orig-card:hover {
  border-color: rgba(76, 111, 255, 0.55);
  box-shadow: var(--glow);
  z-index: 2;
}

.orig-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.orig-card:hover img {
  transform: scale(1.07);
}

.rtp-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 3;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  background: rgba(8, 10, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(8px);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.orig-meta {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 2.4rem 0.85rem 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(6, 8, 14, 0.92) 55%);
}

.orig-meta strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.02rem;
  line-height: 1.15;
}

.orig-meta span {
  display: block;
  margin-top: 0.15rem;
  color: #9aa6c2;
  font-size: 0.75rem;
  font-weight: 600;
}

.play-pulse {
  position: absolute;
  right: 10px;
  bottom: 12px;
  z-index: 3;
  opacity: 0;
  transform: translateY(8px);
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--blue);
  font-size: 0.72rem;
  font-weight: 800;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 8px 20px rgba(76, 111, 255, 0.4);
}

.orig-card:hover .play-pulse {
  opacity: 1;
  transform: translateY(0);
}

/* ---- Quick filters ---- */
.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.25rem 0 1.25rem;
}

.qf {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.qf:hover {
  color: #fff;
  border-color: rgba(76, 111, 255, 0.4);
  transform: translateY(-1px);
}

.qf.is-active {
  color: #fff;
  background: rgba(76, 111, 255, 0.22);
  border-color: rgba(76, 111, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(76, 111, 255, 0.12);
}

/* ---- Organic bento ---- */
.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 0.9rem;
}

.bento-card {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(600px 220px at 90% 0%, rgba(76, 111, 255, 0.18), transparent 55%),
    linear-gradient(160deg, rgba(22, 28, 44, 0.95), rgba(12, 16, 28, 0.92));
  padding: 1.25rem 1.3rem 1.35rem;
  min-height: 170px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.bento-card:hover {
  transform: translateY(-3px);
  border-color: rgba(76, 111, 255, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.bento-card.span-7 {
  grid-column: span 7;
}
.bento-card.span-5 {
  grid-column: span 5;
}
.bento-card.span-4 {
  grid-column: span 4;
}
.bento-card.span-8 {
  grid-column: span 8;
}
.bento-card.span-6 {
  grid-column: span 6;
}
.bento-card.span-12 {
  grid-column: span 12;
}

.bento-kicker {
  display: inline-flex;
  margin-bottom: 0.55rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: rgba(76, 111, 255, 0.14);
  color: #b7c6ff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bento-card h3 {
  margin: 0 0 0.45rem;
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.bento-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.55;
}

.bento-media {
  position: absolute;
  right: -8px;
  bottom: -10px;
  width: min(46%, 220px);
  opacity: 0.9;
  pointer-events: none;
  transform: rotate(-6deg);
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.45));
  transition: transform 0.35s ease;
}

.bento-card:hover .bento-media {
  transform: rotate(-2deg) translateY(-6px) scale(1.04);
}

.bento-media img {
  width: 100%;
  height: auto;
  display: block;
}

/* Soften old rigid cards */
.duel-app .viz-card,
.duel-app .promo-card,
.duel-app .wallet-demo,
.duel-app .promo-hero,
.duel-app .cta-banner {
  border-radius: 22px !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  background:
    radial-gradient(700px 240px at 100% 0%, rgba(76, 111, 255, 0.12), transparent 50%),
    rgba(18, 24, 38, 0.9) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.duel-app .viz-card:hover,
.duel-app .promo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(76, 111, 255, 0.28) !important;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

/* Magnetic / pressable buttons */
.duel-app .btn {
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.15s ease;
}

.duel-app .btn-primary {
  position: relative;
}

.duel-app .btn-primary::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.duel-app .btn-primary:hover::after {
  opacity: 1;
}

/* Slots mini rail */
.slots-rail .orig-card {
  flex-basis: clamp(120px, 14vw, 156px);
}

.slots-rail .rtp-badge {
  display: none;
}

/* Focus rings for a11y */
.qf:focus-visible,
.rail-btn:focus-visible,
.orig-card:focus-visible,
.btn:focus-visible {
  outline: 2px solid #7ea0ff;
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .bento-card.span-7,
  .bento-card.span-5,
  .bento-card.span-4,
  .bento-card.span-8,
  .bento-card.span-6 {
    grid-column: span 12;
  }

  .bento-media {
    width: 140px;
    opacity: 0.7;
  }

  .duel-app .hero {
    margin: 0.5rem;
    border-radius: 0 0 20px 20px;
  }

  .cursor-glow {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-track,
  .hero-particle,
  .organic-bg::before,
  .organic-bg::after {
    animation: none !important;
  }

  .orig-card,
  .bento-card,
  .btn {
    transition: none !important;
  }
}
