/* ================================
   Fankado Pack Page Styles (Responsive)
   ================================ */

/* Layout shell (uses site's global body) */
.container {
  display: grid;
  grid-template-columns: minmax(420px, 1fr) 450px;
  gap: 32px;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* Pack display (left column) */
.pack-display {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  padding: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pack-display {
  background: #f5f5f5;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.pack-display img {
  width: 390px;
  max-width: 100%;
  height: auto;
}

/* Pack info (right column) */
.pack-info {
  width: 100%;
}
.pack-info h1 {
  font-size: 1.8rem;
  margin: 0 0 12px;
}

/* Purchase box */
.purchase-box {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
}
.purchase-box .price {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0;
}
.points {
  font-size: 0.8rem;
  background: #fff7ed;
  color: #b45309;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  padding: 3px 6px;
  display: inline-block;
  margin-left: 8px;
}
.price-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  grid-column: 1 / 2;
}
.qty {
  grid-column: 2 / 3;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 8px 12px;
}
.qty button {
  border: 0;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 4px;
}
.qty .val {
  min-width: 18px;
  text-align: center;
  font-weight: 700;
  font-size: 1rem;
}
/* =========================
   Odds
   ========================= */
details.odds summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.odds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.odd {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  padding: 10px;
  border: 1px solid #eef0f2;
  border-radius: 10px;
  background: #fafafa;
}
.odd .name {
  grid-column: 1 / 2;
  font-weight: 600;
}
.odd .pct {
  grid-column: 2 / 3;
  font-weight: 700;
}
.odd .rem {
  grid-column: 1 / 3;
  color: #6b7280;
  font-size: 0.85rem;
}

.odd.soldout {
  background: #f5f6f7;
  border-color: #e5e7eb;
  color: #9ca3af;
  filter: grayscale(100%);
}
.odd.soldout .name,
.odd.soldout .pct,
.odd.soldout .rem {
  color: #9ca3af;
}

/* =========================
   Recently Pulled (slider)
   ========================= */
.recent-pulls {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0 32px;
}
.recent-pulls h2 {
  margin: 24px 0 12px;
}

.pull-slider {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 0px;
}
.pull-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 0; /* no side padding -> left edges line up */
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}
.pull-track::-webkit-scrollbar {
  height: 0;
}

/* Card shell used only inside .recent-pulls */
.recent-pulls .pull-card {
  flex: 0 0 auto;
  width: clamp(150px, 45vw, 200px); /* responsive width */
  scroll-snap-align: start;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  padding: 14px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.recent-pulls .pull-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}
.recent-pulls .pull-card img {
  width: 100%;
  height: auto;
  border-radius: 0;
}
.recent-pulls .card-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 8px 0 6px;
}
.recent-pulls .user {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #555;
}
.recent-pulls .user .avatar {
  width: 18px;
  height: 18px;
  border-radius: 50%;
}

/* Slider arrows */
.pull-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  width: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 20px;
  line-height: 40px;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.2s ease, background 0.2s ease;
}
.pull-nav.prev {
  left: 8px;
}
.pull-nav.next {
  right: 8px;
}
.pull-nav:hover {
  background: rgba(0, 0, 0, 0.75);
}
.pull-nav.hidden {
  opacity: 0;
  pointer-events: none;
}

/* =========================
   Responsive
   ========================= */

/* Tablet adjustments */
@media (max-width: 900px) {
  .container {
    grid-template-columns: 1fr;
    padding: 20px;
  }
  .pack-display img {
    width: 72vw;
    max-width: 420px;
  }

  .cards-in-pack {
    padding: 0 24px;
  }
  .pull-slider {
    padding: 0 24px;
  }
}

/* Phone */
@media (max-width: 600px) {
  .cards-in-pack {
    padding: 0 16px;
  }
  .pull-slider {
    padding: 0 16px;
  }

  .recent-pulls .pull-card {
    width: clamp(140px, 48vw, 200px);
  } /* ~2 cards per view */

  /* Collapse purchase box rows */
  .container {
    gap: 20px;
    padding: 16px;
  }
  .panel {
    padding: 16px;
  }
  .purchase-box {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .price-wrap,
  .qty,
  .buy-btn {
    grid-column: 1 / -1;
  }

  /* Hide arrows on small screens; touch scroll is enough */
  .pull-nav {
    display: none;
  }
}

/* Very small devices */
@media (max-width: 380px) {
  .recent-pulls .pull-card {
    width: clamp(130px, 50vw, 180px);
  }
}

/* Odds single-column fallback */
@media (max-width: 700px) {
  .odds-grid {
    grid-template-columns: 1fr;
  }
}

/* Prevent padding-induced overflow across components */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --- mobile: force Recently Pulled into a grid so it can't overflow --- */
@media (max-width: 600px) {
  .recent-pulls {
    padding: 0 16px 24px 16px !important;
    margin: 0 auto;
    width: 100% !important;
    max-width: 100vw !important;
  }

  .recent-pulls .pull-slider {
    padding: 0 !important;
    margin: 0;
    width: 100% !important;
    max-width: 100vw !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }

  /* this is the key change: no flex scroll on mobile */
  .recent-pulls .pull-track {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 14px;
    overflow: visible !important;
    width: 100% !important;
    max-width: 100vw !important;
    min-width: 0 !important;
  }

  .recent-pulls .pull-card {
    width: 100% !important;
  }

  /* arrows not needed on mobile grid */
  .pull-nav {
    display: none !important;
  }
}

/** **/
.creator-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
}

.creator-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  background: #e5e7eb;
  flex: 0 0 44px;
  display: block;
}

.creator-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.creator-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.2;
}

.creator-topline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.creator-name {
  font-weight: 800;
  color: #111827;
  text-decoration: none;
}

.creator-name:hover {
  text-decoration: underline;
}

.creator-series {
  font-size: 13px;
  font-weight: 700;
  color: #6b7280;
}

.creator-link {
  font-size: 13px;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.creator-link:hover {
  text-decoration: underline;
}

.creator-sep {
  color: #9ca3af;
  font-weight: 700;
}

.creator-tagline {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
}

/** pack modal stuff - maybe drop into a different file?? **/
.pack-modal.hidden {
  display: none;
}

.pack-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.pack-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
}

.pack-modal-content {
  position: relative;
  max-width: 420px;
  margin: 10vh auto;
  background: #111;
  color: #fff;
  border-radius: 12px;
  padding: 24px;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.pack-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 22px;
  cursor: pointer;
}

.pack-modal-close:hover {
  color: #fff;
}

#packDetails {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

#packDetails li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pack-buy-btn {
  width: 100%;
  padding: 12px;
  margin-top: 16px;
  background: #f5c518;
  color: #000;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
}

.pack-buy-btn:hover {
  background: #ffd84d;
}

@media (max-width: 600px) {
  .pack-display {
    padding: 12px;
  }
}
