/* =========================================================================
   BOOYAH! TCG — CONCEPT 2 CARD WALL (CLEAN, NO SCROLL LOCKS, NO LOOPING)
   ========================================================================= */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --by-yellow: #FFE500;
  --by-blue: #00A3FF;
  --by-purple: #8B5CF6;
  --by-text: #FFFFFF;
  --by-muted: #8E95A5;
  --by-border: rgba(255, 255, 255, 0.12);
  --by-sidebar-bg: #0e101c;
  --by-sidebar-w: 290px;       /* desktop sidebar width, referenced below */
  --by-layout-max: 1700px;     /* keep in sync with .booyah-layout max-width */
  --by-topbar-h: 4rem;         /* mobile top bar height, referenced below */
}

/* Base protection & transparent background - Smooth, non-blocking scroll */
html {
  background: transparent !important;
  scroll-behavior: smooth;
}

body {
  background: transparent !important;
  color: var(--by-text);
  font-family: 'Urbanist', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.4;
  -webkit-user-select: none;
  user-select: none;
}

/* Card inspector open: lock the page so only the zoomed card can be
   interacted with (no background scroll/click leaking through). Toggled
   by JS via document.documentElement/body.classList. */
html.booyah-modal-open,
body.booyah-modal-open {
  overflow: hidden !important;
  height: 100%;
}

.booyah-cardwall-root {
  background: transparent;
  width: 100%;
  position: relative;
}

.booyah-cardwall-root img {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -webkit-user-drag: none !important;
  user-drag: none !important;
  pointer-events: none !important;
}

/* App Layout */
.booyah-layout {
  display: flex;
  max-width: var(--by-layout-max);
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

/* -------------------------------------------------------------
   LEFT SIDEBAR: ARTIST LIST (DESKTOP)
   ------------------------------------------------------------- */
.booyah-sidebar {
  width: var(--by-sidebar-w);
  flex-shrink: 0;
  /* FIX: Carrd wraps embedded sections in containers that can break
     `position: sticky` (ancestor overflow/transform), which made the
     sidebar scroll away with the page. `position: fixed` pins it to the
     viewport regardless of what Carrd does around it. The left offset
     re-centers it under the same max-width the layout uses, so it still
     lines up with the content on wide screens instead of hugging the
     browser edge. */
  position: fixed;
  top: 0;
  left: max(0px, calc((100vw - var(--by-layout-max)) / 2));
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: rgba(14, 16, 28, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--by-border);
  z-index: 100;
  padding: 1.5rem 0.85rem;
}

.sidebar-close-btn {
  display: none;
}

.booyah-artist-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-right: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 163, 255, 0.4) transparent;
}

.booyah-artist-list::-webkit-scrollbar {
  width: 5px;
}
.booyah-artist-list::-webkit-scrollbar-thumb {
  background: rgba(0, 163, 255, 0.4);
  border-radius: 4px;
}

/* Artist Item Nav Button */
.artist-nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  border-radius: 12px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--by-muted);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, transform 0.2s ease;
  font-family: 'Urbanist', -apple-system, sans-serif;
}

.artist-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--by-text);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(4px);
}

.artist-nav-item.active {
  background: linear-gradient(90deg, rgba(0, 163, 255, 0.28), rgba(255, 229, 0, 0.12));
  border-color: var(--by-blue);
  color: #FFFFFF;
}

/* CLEAN BLACK BORDER (NO GLOW / NO BOX-SHADOW) */
.artist-nav-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #000000;
  box-shadow: none !important;
  flex-shrink: 0;
}

.artist-nav-item.active .artist-nav-avatar {
  transform: scale(1.06);
}

.artist-nav-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

/* BIGGER ARTIST NAME IN SIDEBAR */
.artist-nav-name {
  font-weight: 800;
  font-size: 1.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--by-text);
}

.artist-nav-count {
  font-size: 0.8rem;
  color: var(--by-muted);
  font-weight: 600;
  margin-top: 1px;
}

.artist-nav-item.active .artist-nav-count {
  color: var(--by-yellow);
}

/* -------------------------------------------------------------
   MOBILE TOP BAR & BACKDROP
   ------------------------------------------------------------- */
.mobile-top-bar {
  display: none;
}

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 3, 8, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 99998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

/* -------------------------------------------------------------
   MAIN CONTENT: THE CARD WALL (5 CARDS PER ROW ON DESKTOP)
   ------------------------------------------------------------- */
.booyah-main-wall {
  flex: 1;
  /* FIX: the sidebar is now `position: fixed`, so it no longer takes up
     space as a flex sibling. This margin reserves that space back so
     the cards start to the right of the sidebar instead of under it. */
  margin-left: var(--by-sidebar-w);
  padding: 1.5rem 2rem 5rem;
  min-width: 0;
}

/* Artist Section */
.booyah-artist-section {
  margin-bottom: 4rem;
  scroll-margin-top: 5.5rem;
}

.section-artist-banner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 1.25rem;
}

/* CLEAN BLACK BORDER */
.section-artist-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #000000;
  box-shadow: none !important;
}

/* BIGGER ARTIST NAME (RUSSO ONE) */
.section-artist-details h3 {
  font-family: 'Russo One', sans-serif;
  font-size: 2rem;
  color: var(--by-text);
  letter-spacing: 0.5px;
}

.section-artist-details a {
  color: var(--by-yellow);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 2px;
  transition: opacity 0.2s ease;
}

.section-artist-details a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.volume-heading {
  margin: 1.5rem 0 0.85rem;
  display: flex;
  align-items: center;
}

/* Russo One font on Volume labels */
.volume-pill {
  font-family: 'Russo One', sans-serif;
  font-size: 0.95rem;
  color: var(--by-yellow);
  background: rgba(255, 229, 0, 0.12);
  border: 1px solid rgba(255, 229, 0, 0.3);
  padding: 0.3rem 0.85rem;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.75px;
}

/* -------------------------------------------------------------
   CARD WALL GRID (5 CARDS PER ROW ON DESKTOP, SCALED RESPONSIVE)
   ------------------------------------------------------------- */
.card-wall-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.85rem;
}

.booyah-card {
  position: relative;
  aspect-ratio: 2.5 / 3.5;
  cursor: pointer;
  transform-style: preserve-3d;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.25s ease;
  overflow: visible;
}

.booyah-card:hover {
  transform: translateY(-6px) scale(1.03);
  filter: drop-shadow(0 12px 24px rgba(0, 163, 255, 0.55));
  z-index: 10;
}

.booyah-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Protection transparent shield */
.card-shield-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
}

/* -------------------------------------------------------------
   ZOOMED 3D CARD INSPECTOR WITH PREV / NEXT ARROWS
   ------------------------------------------------------------- */
.booyah-inspector-modal {
  position: fixed;
  inset: 0;
  background: rgba(3, 4, 10, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.booyah-inspector-modal.open {
  opacity: 1;
  pointer-events: auto;
}

.inspector-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  max-width: 95vw;
  position: relative;
}

.inspector-card-container {
  width: min(85vw, 440px);
  aspect-ratio: 2.5 / 3.5;
  perspective: 1000px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inspector-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  filter: drop-shadow(0 25px 65px rgba(0, 163, 255, 0.6));
  transition: transform 0.15s ease-out;
}

.inspector-card-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Modal Navigation Arrows */
.inspector-nav-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--by-border);
  color: #FFFFFF;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.6rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
  user-select: none;
}

.inspector-nav-btn:hover {
  background: rgba(0, 163, 255, 0.35);
  border-color: var(--by-blue);
  color: var(--by-yellow);
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(0, 163, 255, 0.6);
}

.inspector-nav-btn:active {
  transform: scale(0.95);
}

.inspector-close-btn {
  position: absolute;
  top: 25px;
  right: 25px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--by-border);
  color: white;
  font-size: 1.8rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.inspector-close-btn:hover {
  background: rgba(255, 255, 255, 0.28);
  transform: scale(1.1);
}

/* -------------------------------------------------------------
   RESPONSIVE: TABLET & MOBILE HAMBURGER DRAWER
   ------------------------------------------------------------- */
@media (max-width: 1200px) {
  .card-wall-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .booyah-layout {
    flex-direction: column;
    /* FIX: reserve space for the now `fixed` mobile top bar so it
       doesn't cover the first row of cards. */
    margin-top: var(--by-topbar-h);
  }

  /* Show Mobile Top Bar with Hamburger */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* FIX: same sticky -> fixed swap as the desktop sidebar, for the
       same reason (Carrd's wrapper can break `position: sticky`). */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--by-topbar-h);
    z-index: 99990;
    padding: 0.85rem 1.25rem;
    background: #0e101c;
    border-bottom: 1px solid var(--by-border);
  }

  .mobile-hamburger-btn {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: rgba(0, 163, 255, 0.15);
    border: 1.5px solid var(--by-blue);
    color: #FFFFFF;
    padding: 0.55rem 1.1rem;
    border-radius: 9px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
  }

  /* Active artist badge on top bar with round icon & Russo One font */
  .mobile-active-artist-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .mobile-active-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #000000;
    box-shadow: none !important;
    flex-shrink: 0;
  }

  .mobile-active-artist-label {
    font-family: 'Russo One', sans-serif;
    color: var(--by-yellow);
    font-size: 1.2rem;
    letter-spacing: 0.5px;
  }

  /* Slide-out Drawer Sidebar for Mobile (overrides the desktop
     fixed-with-offset rule above with plain top:0/left:0) */
  .booyah-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(85vw, 320px);
    height: 100vh;
    background: #0e101c !important;
    border-right: 2px solid rgba(0, 163, 255, 0.3);
    box-shadow: none !important;
    transform: translateX(-100%);
    z-index: 999999 !important;
    display: flex !important;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0.3s;
  }

  .booyah-sidebar.open {
    transform: translateX(0) !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.95) !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .sidebar-backdrop {
    display: block;
  }

  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.1rem;
    margin-bottom: 0.85rem;
    border-bottom: 1px solid var(--by-border);
    font-family: 'Russo One', sans-serif;
    color: var(--by-yellow);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
  }

  .sidebar-close-x {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid var(--by-border);
    color: #FFFFFF;
    font-size: 1.4rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .booyah-main-wall {
    /* FIX: reset the desktop fixed-sidebar offset — the mobile sidebar
       is an overlay drawer, not a flow sibling, so it needs no gutter. */
    margin-left: 0;
    padding: 1rem 0.75rem 4rem;
  }

  /* Scaled down cards for tablet / mobile */
  .card-wall-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .inspector-stage {
    gap: 0.6rem;
  }

  .inspector-card-container {
    width: min(76vw, 360px);
  }

  .inspector-nav-btn {
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
  }
}

@media (max-width: 540px) {
  .card-wall-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
  }
}
