/* Characters page — button-toggle showcase (swap in <img> inside [data-image-slot] later) */

.characters-page {
  padding: 2rem 1.25rem 6rem;
  max-width: 1200px;
  margin: 0 auto;
}

.characters-page__head {
  text-align: center;
  margin-bottom: 2.5rem;
  padding: 0 0.5rem;
}

.characters-page__kicker {
  font-family: "Space Mono", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.characters-page__title {
  font-family: "Boogaloo", cursive;
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.1;
  color: var(--text-primary);
  margin: 0;
}

.characters-page__lead {
  font-family: "Caveat", cursive;
  font-size: 1.25rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
  max-width: 32rem;
  margin-left: auto;
  margin-right: auto;
}

/* ----- Card grid ----- */
.bun-card-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.75rem 1.25rem;
}

.bun-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 280px;
  flex: 0 0 auto;
}

/* ----- Card viewport (280×340) ----- */
.bun-card__reveal {
  position: relative;
  width: 280px;
  max-width: 100%;
  height: 340px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--bg) 50%, #000 50%);
  overflow: hidden;
}

/* Labels */
.bun-card__reveal::before {
  content: "BUNiverse";
  position: absolute;
  z-index: 4;
  top: 0.4rem;
  left: 0.45rem;
  right: auto;
  font-family: "Space Mono", monospace;
  font-size: 0.45rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 0 4px #000, 0 0 6px #000;
  pointer-events: none;
}

/* Two stacked faces; default is BUNiverse */
.bun-card__face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  transition: opacity 0.22s ease;
}

.bun-card__face--universe {
  z-index: 1;
  opacity: 1;
}

.bun-card__face--real {
  z-index: 0;
  opacity: 0;
}

.bun-card.is-real .bun-card__face--universe {
  opacity: 0;
}

.bun-card.is-real .bun-card__face--real {
  opacity: 1;
}

.bun-card.is-real .bun-card__reveal::before {
  content: "Real Life";
}

/* Placeholder blocks — replace only these with real <img> in the same slot (same parent) */
.bun-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 100%;
  display: block;
}

.bun-card--coming-soon {
  opacity: 0.65;
  cursor: default;
  pointer-events: none;
}

.bun-card--coming-soon .bun-card__placeholder {
  width: 100%;
  height: 100%;
  min-height: 100%;
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.bun-card__placeholder-img {
  height: 80px;
  width: auto;
  opacity: 0.4;
  user-select: none;
  pointer-events: none;
}

.bun-card--coming-soon .bun-card__name::after {
  content: " Coming Soon";
  font-family: "Space Mono", monospace;
  font-size: 0.65rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: 0.45rem;
}

/* Real images: match placeholder footprint */
.bun-card__face .bun-card__img {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

/* Old drag slider handle hidden (kept in markup for compatibility) */
.bun-card__handle {
  display: none;
}

.bun-card__toggle {
  margin-top: 0.65rem;
  padding: 0.42rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--card-bg) 88%, var(--bg));
  color: var(--text-primary);
  font-family: "Space Mono", monospace;
  font-size: 0.56rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.bun-card__toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.easter-egg-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
  animation: fadeIn 0.3s ease;
}

.easter-egg-gif {
  border-radius: 50%;
  width: 300px;
  height: 300px;
  object-fit: cover;
  animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.easter-egg-caption {
  color: #fff;
  font-family: "Boogaloo", cursive;
  font-size: 1.6rem;
  margin-top: 1rem;
  text-align: center;
  letter-spacing: 0.02em;
  animation: fadeIn 0.5s ease 0.2s both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Text below */
.bun-card__meta {
  text-align: center;
  margin-top: 0.9rem;
  max-width: 280px;
  width: 100%;
}

.bun-card__name {
  font-family: "Boogaloo", cursive;
  font-size: 1.4rem;
  line-height: 1.2;
  color: var(--text-primary);
  margin: 0;
}

.bun-card__role {
  font-family: "Caveat", cursive;
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

/* Single column on mobile */
@media (max-width: 640px) {
  .bun-card-grid {
    flex-direction: column;
    align-items: center;
  }

  .bun-card {
    max-width: 100%;
  }
}

/* Narrow phones: full-width card keeps aspect */
@media (max-width: 400px) {
  .bun-card__reveal {
    width: 100%;
    height: auto;
    aspect-ratio: 280 / 340;
  }
}
