/* ====== Base Setup ====== */
body {
  background-color: #05080f;
  color: #f2f2f2;
  overflow-x: visible;
}

.characters-page {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  min-height: auto;
  overflow-x: auto;
  overflow-y: hidden;
  perspective: 1000px;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: #e2b144 #111;
  padding-left: 0;
  padding-top: 5rem;
  padding-bottom: 9rem; /* adds space above scrollbar */
  width: 100%;
}

.list {
  display: flex;
  gap: 1.5rem;
  transform-style: preserve-3d;
  padding: 0 12vw; /* more side padding so edge cards have hover space */
  will-change: transform;
}

.characters-page::-webkit-scrollbar {
  height: 8px;
}
.characters-page::-webkit-scrollbar-thumb {
  background: #e2b144;
  border-radius: 4px;
}
.characters-page::-webkit-scrollbar-track {
  background: #111;
}

.info .content img {
  opacity: 0;
  transform: scale(1.05);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.info.show .content img {
  opacity: 1;
  transform: scale(1);
}


/* ====== Cards ====== */
.list .item {
  position: relative;
  width: 240px;
  height: 360px;
  border-radius: 12px;
  overflow: visible;
  flex-shrink: 0;
  cursor: pointer;
  transition: transform 0.55s ease;
  transform: translateZ(0) rotateY(0deg);
}

.list .item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
  background-image: radial-gradient(circle at center, rgba(0,0,0,0.6), #000);
  box-shadow: 0 0 40px rgba(0, 255, 255, 0.25); /* soft glow effect */
  padding: 8px; /* optional small inner space */
}


/* ====== Center Item ====== */
.list .item:hover {
  transform: translateZ(200px) rotateY(0deg);
  z-index: 10;
}

/* ====== Right Side (6 steps) ====== */
.list .item:hover + * {
  transform: translateZ(170px) rotateY(35deg);
}
.list .item:hover + * + * {
  transform: translateZ(140px) rotateY(28deg);
}
.list .item:hover + * + * + * {
  transform: translateZ(110px) rotateY(22deg);
}
.list .item:hover + * + * + * + * {
  transform: translateZ(80px) rotateY(15deg);
}
.list .item:hover + * + * + * + * + * {
  transform: translateZ(50px) rotateY(8deg);
}
.list .item:hover + * + * + * + * + * + * {
  transform: translateZ(25px) rotateY(4deg);
}

/* ====== Left Side (6 steps, mirrored) ====== */
.list .item:has(+ *:hover) {
  transform: translateZ(170px) rotateY(-35deg);
}
.list .item:has(+ * + *:hover) {
  transform: translateZ(140px) rotateY(-28deg);
}
.list .item:has(+ * + * + *:hover) {
  transform: translateZ(110px) rotateY(-22deg);
}
.list .item:has(+ * + * + * + *:hover) {
  transform: translateZ(80px) rotateY(-15deg);
}
.list .item:has(+ * + * + * + * + *:hover) {
  transform: translateZ(50px) rotateY(-8deg);
}
.list .item:has(+ * + * + * + * + * + *:hover) {
  transform: translateZ(25px) rotateY(-4deg);
}

/* ====== Character Labels ====== */
.list .item h3 {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.8);
  color: #e2b144;
  text-align: center;
  font-size: 1rem;
  padding: 0.6rem 0.4rem;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}
.list .item:hover h3 {
  opacity: 1;
  transform: translateY(0);
}

/* ====== Modal ====== */
.info {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 50;
  opacity: 0;
  visibility: hidden;
  pointer-events: none; /* prevent blocking when hidden */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.info.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto; /* re-enable clicks when open */
}

.info .content {
  background: #111;
  padding: 2rem;
  border: 1px solid #333;
  border-radius: 12px;
  width: 90%;
  max-width: 520px;
  text-align: center;
  color: #ddd;
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #e2b144 #111;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.7);
  transform: scale(0.95);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.info.show .content {
  transform: scale(1);
  opacity: 1;
}

.info .content::-webkit-scrollbar {
  width: 6px;
}
.info .content::-webkit-scrollbar-thumb {
  background: #e2b144;
  border-radius: 3px;
}

#close-info {
  position: absolute;
  top: 24px;
  right: 32px;
  background: none;
  color: #e2b144;
  font-size: 2rem;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}
#close-info:hover { transform: scale(1.1); }

.item-popup {
  position: absolute;
  top: 10px;
  left: 0;
  width: 260px;              /* a little wider */
  max-height: 90vh;          /* allows it to grow but not overflow the screen */
  background: rgba(10,10,10,0.95);
  color: #ddd;
  border: 1px solid #333;
  border-radius: 12px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem;
  overflow-y: auto;          /* enables scrolling when content overflows */
  scrollbar-width: thin;
  scrollbar-color: #e2b144 #111;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.item-popup::-webkit-scrollbar {
  width: 6px;
}
.item-popup::-webkit-scrollbar-thumb {
  background: #e2b144;
  border-radius: 3px;
}



.item-popup.show {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.item-popup img {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 6px;
  margin-bottom: .5rem;
}

.item-popup h2 {
  color: #e2b144;
  margin-bottom: .25rem;
  font-size: 1rem;
}

.item-popup p {
  font-size: .85rem;
  text-align: center;
  line-height: 1.3;
}
