/* Scanline overlay */
.scanline-bg {
  background-image: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(0, 0, 0, 0.2) 2px,
    rgba(0, 0, 0, 0.2) 4px
  );
}

/* Chromatic aberration text */
.chromatic-aberration {
  text-shadow: 2px 0px 0px #FF007A, -2px 0px 0px #00F0FF;
}

/* VS gradient text */
.vs-text {
  background: linear-gradient(to bottom, #FF007A, #00F0FF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Desktop nav links */
.nav-link {
  color: white;
  opacity: 0.7;
  font-family: 'Space Grotesk';
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 0.5rem 1rem;
  border-bottom: 4px solid transparent;
  transition: all 0.15s;
}
.nav-link:hover {
  transform: skewX(-10deg);
  background: #FF007A;
  color: black;
  opacity: 1;
}
.nav-link-active {
  color: #00F0FF;
  opacity: 1;
  border-bottom-color: #00F0FF;
}

/* Desktop nav dropdown (Bookshelf group) */
.nav-dropdown {
  position: relative;
}
.nav-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: none;
  border: none;
  border-bottom: 4px solid transparent;
  cursor: pointer;
}
.nav-caret {
  font-size: 18px;
  transition: transform 0.15s;
}
.nav-dropdown:hover .nav-caret,
.nav-dropdown:focus-within .nav-caret {
  transform: rotate(180deg);
}
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  background: #0F0F1B;
  border: 3px solid #FF007A;
  box-shadow: 4px 4px 0 0 #00F0FF;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.15s, transform 0.15s;
  z-index: 60;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown:focus-within .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.nav-dropdown-item {
  color: white;
  opacity: 0.75;
  font-family: 'Space Grotesk';
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.65rem 1rem;
  transition: all 0.12s;
}
.nav-dropdown-item:hover {
  background: #FF007A;
  color: black;
  opacity: 1;
  transform: skewX(-10deg);
}
.nav-dropdown-item-active {
  color: #00F0FF;
  opacity: 1;
  border-left: 4px solid #00F0FF;
}

/* Segmented shelf switcher (Bookshelf section sub-nav) */
.shelf-nav {
  display: flex;
  gap: 6px;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 1rem;
}
.shelf-nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  justify-content: center;
  text-align: center;
  color: white;
  opacity: 0.75;
  font-family: 'Space Grotesk';
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.6rem 0.5rem;
  background: #1A1A2E;
  border: 2px solid #3A3A55;
  transform: skewX(-10deg);
  transition: all 0.15s;
}
.shelf-nav-tab > * {
  transform: skewX(10deg);
}
.shelf-nav-tab .material-symbols-outlined {
  font-size: 18px;
}
.shelf-nav-tab:hover {
  opacity: 1;
  border-color: #FF007A;
}
.shelf-nav-active {
  background: #FF007A;
  color: black;
  opacity: 1;
  border-color: #FF007A;
  box-shadow: 3px 3px 0 0 #00F0FF;
}
@media (max-width: 640px) {
  .shelf-nav {
    gap: 4px;
  }
  /* Text-first on mobile: every tab keeps its label so it reads as nav.
     Icons are dropped to make room for the words. */
  .shelf-nav-tab {
    font-size: 11px;
    letter-spacing: 0.02em;
    padding: 0.7rem 0.25rem;
    line-height: 1.1;
  }
  .shelf-nav-tab .material-symbols-outlined {
    display: none;
  }
}

/* Mobile bottom nav */
.btm-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #FF007A;
  padding: 0.5rem;
  transition: all 0.15s;
  flex: 1;
}
.btm-nav-link:hover {
  background: rgba(255, 0, 122, 0.2);
}
.btm-nav-active {
  background: #FF007A;
  color: black;
  transform: skewX(-12deg);
  box-shadow: 0 0 0 2px #00F0FF;
  scale: 1.1;
}
.btm-nav-active > * {
  transform: skewX(12deg);
}

/* Arcade button base */
.arcade-btn {
  border-width: 3px;
  font-family: 'Space Grotesk';
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  transition: all 0.15s;
  position: relative;
  overflow: hidden;
}
.arcade-btn:active {
  transform: translateY(2px);
  box-shadow: none;
}

/* KO flash animation */
@keyframes ko-flash {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}
.ko-flash {
  animation: ko-flash 0.4s ease-out forwards;
}

/* Arena swap: the beaten matchup eases off stage, new challengers slide in
   from their own corners. Classes are toggled on #versus-root by versus.js. */
@keyframes arena-exit {
  to { opacity: 0; transform: scale(0.98) translateY(10px); }
}
.arena-exit {
  animation: arena-exit 300ms ease-in forwards;
  pointer-events: none;
}
@keyframes arena-in-left {
  from { opacity: 0; transform: translateX(-32px); }
}
@keyframes arena-in-right {
  from { opacity: 0; transform: translateX(32px); }
}
.arena-enter #player1 {
  animation: arena-in-left 350ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.arena-enter #player2 {
  animation: arena-in-right 350ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* Cards re-appearing as a search filter loosens */
@keyframes card-appear {
  from { opacity: 0; transform: scale(0.96); }
}
.card-appear {
  animation: card-appear 200ms ease-out;
}

/* Score pop — a quick punch when a vote lands on the Future Books shelf */
@keyframes score-pop {
  50% { transform: scale(1.35); }
}
.score-pop {
  animation: score-pop 250ms ease-out;
}

/* Soften <details> disclosures: revealed content fades and settles instead
   of snapping open (publisher descriptions, the "Not for us" form, etc.). */
@keyframes details-reveal {
  from { opacity: 0; transform: translateY(-4px); }
}
details[open] > *:not(summary) {
  animation: details-reveal 200ms ease-out;
}

/* Loading spinner (e.g. while generating AI suggestions) */
@keyframes arcade-spin {
  to { transform: rotate(360deg); }
}
.arcade-spinner {
  width: 64px;
  height: 64px;
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-top-color: #FF007A;
  border-right-color: #00F0FF;
  border-radius: 50%;
  animation: arcade-spin 0.8s linear infinite;
}

/* Points overlay — comic-book starburst */
.points-overlay {
  /* starts hidden; JS adds .points-animate to reveal */
}

.points-burst {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
}

/* Starburst shape via clip-path */
.points-burst::before {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(
    50% 0%, 63% 15%, 80% 2%, 78% 22%, 98% 20%,
    87% 37%, 100% 50%, 87% 63%, 98% 80%, 78% 78%,
    80% 98%, 63% 85%, 50% 100%, 37% 85%, 20% 98%,
    22% 78%, 2% 80%, 15% 63%, 0% 50%, 15% 37%,
    2% 20%, 22% 22%, 20% 2%, 37% 15%
  );
}

.points-win .points-burst::before {
  background: #FF007A;
}
.points-lose .points-burst::before {
  background: #1a1a2e;
}

/* Border ring for loser burst — a slightly larger starburst behind */
.points-lose .points-burst::after {
  content: '';
  position: absolute;
  inset: -4px;
  clip-path: polygon(
    50% 0%, 63% 15%, 80% 2%, 78% 22%, 98% 20%,
    87% 37%, 100% 50%, 87% 63%, 98% 80%, 78% 78%,
    80% 98%, 63% 85%, 50% 100%, 37% 85%, 20% 98%,
    22% 78%, 2% 80%, 15% 63%, 0% 50%, 15% 37%,
    2% 20%, 22% 22%, 20% 2%, 37% 15%
  );
  background: #ff4444;
  z-index: -1;
}

.points-value {
  position: relative;
  z-index: 1;
}

.points-win .points-value {
  color: #fff;
  text-shadow:
    3px 3px 0px #000,
    -1px -1px 0px #000,
    1px -1px 0px #000,
    -1px 1px 0px #000,
    0 0 30px #FF007A;
}

.points-lose .points-value {
  color: #ff4444;
  text-shadow:
    3px 3px 0px #000,
    -1px -1px 0px #000,
    1px -1px 0px #000,
    -1px 1px 0px #000;
}

/* Pop-in with springy bounce */
@keyframes points-pop {
  0% {
    transform: scale(0) rotate(-15deg);
  }
  50% {
    transform: scale(1.3) rotate(5deg);
  }
  70% {
    transform: scale(0.9) rotate(-3deg);
  }
  85% {
    transform: scale(1.05) rotate(1deg);
  }
  100% {
    transform: scale(1) rotate(-2deg);
  }
}

.points-animate {
  opacity: 1 !important;
}

.points-animate .points-burst {
  animation: points-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Star rating picker */
.star-picker .star-btn {
  cursor: pointer;
  transition: transform 0.1s, color 0.1s;
}
.star-picker .star-btn:hover {
  transform: scale(1.3);
}

/* Book cover placeholder */
.cover-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1A1A2E;
  border: 1px solid #343341;
  font-family: 'Space Grotesk';
  font-weight: 700;
  text-transform: uppercase;
  color: #FF007A;
  text-align: center;
  padding: 1rem;
  font-size: 14px;
  line-height: 1.2;
}
