/* ====================================================================
   VITRINE SG3 - STYLES
   ====================================================================
   Structure: 20% | 60% | 20% (gauche, centre, droite)
==================================================================== */

/* ====================================================================
   VARIABLES GLOBALES
==================================================================== */
:root {
  /* Couleurs */
  --bg-space: #0a1628;
  --bg-space-light: #0d1b2a;
  --cyan-primary: #00f3ff;
  --primary-neon: #00f2ff;
  --secondary-neon: #7000ff;
  --cyan-glow: rgba(0, 243, 255, 0.8);
  --cyan-dark: #008899;
  --text-white: #e0f7ff;
  --text-dim: rgba(224, 247, 255, 0.6);
  --text-main: #e0e6ed;
  --glass-bg: rgba(20, 25, 40, 0.65);
  --glass-border: rgba(255, 255, 255, 0.1);

  /* Espacements */
  --panel-padding: 20px;

  /* Carousel 3D */
  --carousel-radius: 450px;
  --card-width: 280px;
  --card-height: 420px;
  --panel-min-width: 250px;

  /* Effets */
  --glow-small: 0 0 8px var(--cyan-glow);
  --glow-medium: 0 0 15px var(--cyan-glow), 0 0 25px var(--cyan-primary);
  --glow-large: 0 0 20px var(--cyan-glow), 0 0 40px var(--cyan-primary), 0 0 60px var(--cyan-glow);

  /* Typographie */
  --font-title: 'Orbitron', sans-serif;
  --font-display: 'Rajdhani', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* ====================================================================
   RESET & BASE
==================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background: #000;
  color: var(--text-white);
  min-height: 100vh;
  overflow: hidden;
}

/* ====================================================================
   FOND PLEIN ECRAN
==================================================================== */
.background-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  background-image: url('../images/fond.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.background-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(0, 0, 0, 0.4) 100%);
}

/* ====================================================================
   LAYOUT PRINCIPAL - 20% | 60% | 20%
==================================================================== */
.main-container {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* ====================================================================
   PANEL GAUCHE - 20% - HUD GENRES
==================================================================== */
.panel-left {
  width: 20%;
  min-width: var(--panel-min-width);
  height: 100vh;
  position: relative;
  overflow: hidden;

  /* Glassmorphism */
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.85) 0%, rgba(13, 27, 42, 0.9) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);

  /* Bordure HUD droite */
  border-right: 2px solid var(--cyan-primary);
  box-shadow:
    inset -2px 0 20px rgba(0, 243, 255, 0.2),
    5px 0 30px rgba(0, 0, 0, 0.5);

  /* Layout vertical */
  display: flex;
  flex-direction: column;
}

/* Section 1 : Carousel Genres */
.carousel-container-left {
  height: 40%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--panel-padding);
}

.carousel-3d {
  width: 100%;
  height: 100%;
  position: relative;
  perspective: 1000px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.carousel-item {
  position: absolute;
  width: 85%;
  padding: 18px 25px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-white);
  background: rgba(13, 27, 42, 0.4);
  border: none;
  box-shadow: inset 0 0 0 1px var(--cyan-dark);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  cursor: pointer;
}

.carousel-item::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--cyan-primary);
  z-index: -1;
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.carousel-item[data-position="0"] {
  transform: translateY(0) scale(1.2) translateZ(0);
  opacity: 1;
  z-index: 5;
  font-size: 1.2rem;
  box-shadow: inset 0 0 5px var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-glow);
  background: rgba(0, 243, 255, 0.15);
}

.carousel-item[data-position="0"]::before {
  box-shadow: var(--glow-medium);
}

.carousel-item[data-position="1"] {
  transform: translateY(80px) scale(0.85) translateZ(-100px);
  opacity: 0.5;
  z-index: 4;
}

.carousel-item[data-position="2"] {
  transform: translateY(140px) scale(0.7) translateZ(-200px);
  opacity: 0.3;
  z-index: 3;
}

.carousel-item[data-position="-1"] {
  transform: translateY(-80px) scale(0.85) translateZ(-100px);
  opacity: 0.5;
  z-index: 4;
}

.carousel-item[data-position="-2"] {
  transform: translateY(-140px) scale(0.7) translateZ(-200px);
  opacity: 0.3;
  z-index: 3;
}

.carousel-item[data-position]:not([data-position="0"]):not([data-position="1"]):not([data-position="2"]):not([data-position="-1"]):not([data-position="-2"]) {
  opacity: 0;
  pointer-events: none;
}

.carousel-item:not([data-position="0"]):hover {
  opacity: 0.9;
  box-shadow: inset 0 0 5px var(--cyan-dark);
}

/* Fleches Navigation Genres */
.carousel-arrow {
  position: absolute;
  width: 40px;
  height: 40px;
  background: rgba(0, 243, 255, 0.1);
  border: 1px solid var(--cyan-primary);
  color: var(--cyan-primary);
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.arrow-up { top: 10px; left: 50%; transform: translateX(-50%); }
.arrow-down { bottom: 10px; left: 50%; transform: translateX(-50%); }

.carousel-arrow:hover {
  background: rgba(0, 243, 255, 0.3);
  box-shadow: var(--glow-medium);
}

/* Section 2 : Titre Genre */
.genre-title-container {
  height: 25%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  padding: var(--panel-padding);
  border-top: 1px solid rgba(0, 243, 255, 0.3);
  border-bottom: 1px solid rgba(0, 243, 255, 0.3);
}

.genre-title {
  width: 100%;
  padding: 20px;
  background: rgba(0, 243, 255, 0.05);
  position: relative;
  clip-path: polygon(5% 0, 95% 0, 100% 15%, 100% 85%, 95% 100%, 5% 100%, 0 85%, 0 15%);
  border: 2px solid var(--cyan-primary);
  box-shadow: var(--glow-medium);
  text-align: center;
}

.genre-title h2 {
  font-family: var(--font-title);
  font-size: clamp(1rem, 1.6vw, 1.8rem);
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--cyan-primary);
  text-shadow: var(--glow-large);
  text-transform: uppercase;
  margin: 0;
  animation: titleGlow 1.5s ease-in-out infinite alternate;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Section 2b : Compteur de livres */
.genre-book-count-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 70px;
  height: 70px;
}

.genre-book-count {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: #d26b2a;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
  user-select: none;
  transition: opacity 0.3s ease;
}

.electric-border-count {
  width: 60px;
  height: 60px;
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0.95;
  filter:
    drop-shadow(0 0 6px rgba(0, 243, 255, 0.55))
    drop-shadow(0 0 16px rgba(0, 243, 255, 0.35));
}

.electric-border-count svg {
  width: 60px;
  height: 60px;
  overflow: visible;
}

.stroke-main {
  fill: none;
  stroke: var(--cyan-primary);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.9;
}

.stroke-glow {
  fill: none;
  stroke: var(--cyan-primary);
  stroke-width: 2;
  stroke-linecap: round;
  opacity: 0.55;
  filter: blur(0.7px);
}

.stroke-sparks {
  fill: none;
  stroke: var(--cyan-primary);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 7 10;
  opacity: 0.6;
  animation: dash 700ms linear infinite;
}

@keyframes dash {
  to { stroke-dashoffset: -34; }
}

@keyframes titleGlow {
  0% { text-shadow: 0 0 10px var(--cyan-glow); }
  100% { text-shadow: 0 0 30px var(--cyan-glow), 0 0 40px var(--cyan-primary); }
}

/* Section 3 : Sous-genres */
.subgenres-container {
  height: 35%;
  padding: var(--panel-padding);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-primary) transparent;
}

.subgenres-container::-webkit-scrollbar { width: 6px; }
.subgenres-container::-webkit-scrollbar-track { background: transparent; }
.subgenres-container::-webkit-scrollbar-thumb {
  background: var(--cyan-primary);
  border-radius: 3px;
  box-shadow: var(--glow-small);
}

.subgenres-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px;
  background: rgba(13, 27, 42, 0.4);
  border: 2px solid var(--cyan-primary);
  box-shadow: var(--glow-small);
  clip-path: polygon(5% 0, 100% 0, 95% 100%, 0 100%);
}

.subgenre-item {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--text-white);
  padding: 5px 0;
  background: transparent;
  transition: color 0.3s ease, text-shadow 0.3s ease;
  cursor: pointer;
}

.subgenre-name {
  justify-self: start;
}

.subgenre-name::before {
  content: ">";
  color: var(--cyan-primary);
  margin-right: 10px;
  font-weight: 700;
}

.subgenre-count {
  color: #d26b2a;
  font-weight: 600;
  font-size: 0.9rem;
  justify-self: center;
}

.subgenre-item:hover {
  color: var(--cyan-primary);
  text-shadow: 0 0 5px var(--cyan-glow);
}

/* ====================================================================
   ZONE CENTRALE - 60% - CAROUSEL 3D LIVRES
==================================================================== */
.main-content {
  width: 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  perspective: 1200px;
}

/* SVG Filters */
.svg-container {
  position: absolute;
  width: 0;
  height: 0;
}

/* Subgenre item actif */
.subgenre-item.active .subgenre-name {
  color: var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.subgenre-item.active .subgenre-count {
  color: var(--cyan-primary);
  text-shadow: 0 0 8px var(--cyan-glow);
}

/* Message carousel vide */
.empty-carousel-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  backdrop-filter: blur(5px);
}

/* Metadata livre (dos de carte) */
.book-genre {
  font-size: 0.85rem;
  color: var(--cyan-primary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.book-meta {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 15px;
  font-style: italic;
}

/* Carousel Structure */
.carousel-container-main {
  position: relative;
  width: var(--card-width);
  height: var(--card-height);
  transform-style: preserve-3d;
  margin-top: 20px;
}

.carousel {
  position: absolute;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.4s ease;
}

.carousel.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) rotateY(0deg) !important;
}

/* Card Styling */
.card {
  position: absolute;
  width: var(--card-width);
  height: var(--card-height);
  border-radius: 16px;
  cursor: pointer;
  backface-visibility: visible;
  -webkit-box-reflect: below 10px linear-gradient(transparent, transparent 60%, rgba(0,0,0,0.4));
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.card.flipped .card-inner {
  transform: rotateY(180deg);
}

.card-front, .card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.card-front {
  z-index: 2;
  background: #000;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card.front:hover .card-image {
  transform: scale(1.05);
}

.card-back {
  transform: rotateY(180deg);
  background: var(--glass-bg);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 40px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.5);
}

.card-back h3 {
  font-family: var(--font-display);
  color: var(--primary-neon);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  text-shadow: 0 0 15px rgba(0, 242, 255, 0.6);
  position: relative;
  padding-bottom: 15px;
}

.card-back h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--secondary-neon);
  box-shadow: 0 0 10px var(--secondary-neon);
}

.card-back p {
  color: #cbd5e1;
  font-size: 0.72rem;
  line-height: 1.35;
  margin-bottom: 6px;
  text-align: center;
  font-weight: 300;
}

.card-back .synopsis-hook {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--primary-neon);
  font-style: italic;
  margin-bottom: 8px;
}

.card-back .synopsis-setup {
  font-size: 0.68rem;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.card-back .synopsis-stakes {
  font-size: 0.72rem;
  font-weight: 600;
  color: #fef3c7;
  margin-bottom: 0;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

.card-back::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  bottom: 12px;
  border: 1px solid rgba(0, 242, 255, 0.1);
  border-radius: 12px;
  pointer-events: none;
}

/* Electric Border Effect */
.electric-border {
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
  border: 2px solid var(--primary-neon);
  border-radius: 20px;
  filter: url(#turbulent-displace);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 10;
  mix-blend-mode: screen;
  pointer-events: none;
}

.card.front .electric-border { opacity: 0.8; }

.glow-layer {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 16px;
  box-shadow: 0 0 20px var(--primary-neon), inset 0 0 20px var(--primary-neon);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: overlay;
}

.card.front .glow-layer { opacity: 0.6; }

.background-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120%;
  height: 120%;
  background: radial-gradient(circle, rgba(0, 242, 255, 0.2) 0%, transparent 60%);
  filter: blur(40px);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: -1;
}

.card.front .background-glow { opacity: 1; }

/* Card Positions - 7 cards */
.carousel .card:nth-child(1) { transform: rotateY(0deg) translateZ(var(--carousel-radius)); }
.carousel .card:nth-child(2) { transform: rotateY(51.43deg) translateZ(var(--carousel-radius)); }
.carousel .card:nth-child(3) { transform: rotateY(102.86deg) translateZ(var(--carousel-radius)); }
.carousel .card:nth-child(4) { transform: rotateY(154.29deg) translateZ(var(--carousel-radius)); }
.carousel .card:nth-child(5) { transform: rotateY(205.71deg) translateZ(var(--carousel-radius)); }
.carousel .card:nth-child(6) { transform: rotateY(257.14deg) translateZ(var(--carousel-radius)); }
.carousel .card:nth-child(7) { transform: rotateY(308.57deg) translateZ(var(--carousel-radius)); }

/* Virtual Carousel - Entry/Exit Animations */
.card {
  transition: opacity 0.4s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.card-exit {
  opacity: 0 !important;
  transform: rotateY(var(--exit-angle, 0deg)) translateZ(350px) scale(0.5) !important;
  pointer-events: none !important;
  transition: opacity 0.4s ease, transform 0.4s ease !important;
}

.card-enter {
  opacity: 0;
  transform: rotateY(var(--enter-angle, 0deg)) translateZ(350px) scale(0.5);
}

/* Controls */
.controls {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 30px;
  z-index: 100;
  align-items: center;
}

.btn {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--glass-border);
  color: var(--primary-neon);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(5px);
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.btn:hover {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--primary-neon);
  color: #fff;
  box-shadow: 0 0 25px rgba(0, 242, 255, 0.4);
  transform: scale(1.1);
}

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

/* Floor Effect */
.floor {
  position: absolute;
  bottom: -150px;
  width: 1000px;
  height: 1000px;
  background: radial-gradient(ellipse at center, rgba(0, 242, 255, 0.08) 0%, transparent 60%);
  transform: rotateX(90deg);
  pointer-events: none;
  z-index: -2;
}

/* Tap Hint */
.tap-hint {
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: rgba(255,255,255,0.4);
  pointer-events: none;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.7; }
}

/* ====================================================================
   PANEL DROIT - 20% - DETAILS LIVRE
==================================================================== */
.panel-right {
  width: 20%;
  min-width: var(--panel-min-width);
  height: 100vh;
  position: relative;
  overflow: hidden;

  /* Glassmorphism */
  background: linear-gradient(180deg, rgba(10, 22, 40, 0.85) 0%, rgba(13, 27, 42, 0.9) 100%);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);

  /* Bordure HUD gauche */
  border-left: 2px solid var(--cyan-primary);
  box-shadow:
    inset 2px 0 20px rgba(0, 243, 255, 0.2),
    -5px 0 30px rgba(0, 0, 0, 0.5);

  /* Layout vertical */
  display: flex;
  flex-direction: column;
  padding: var(--panel-padding);
}

/* Etat vide (quand aucun livre selectionne) */
.panel-right-empty {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  transition: opacity 0.4s ease;
}

.panel-right-empty .empty-icon {
  font-size: 4rem;
  opacity: 0.4;
  margin-bottom: 20px;
  filter: drop-shadow(0 0 10px rgba(0, 243, 255, 0.3));
}

.panel-right-empty p {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.6;
}

.panel-right.has-book .panel-right-empty {
  opacity: 0;
  pointer-events: none;
}

/* Section 1: 4eme de couverture */
.book-backcover-section {
  flex: 3 1 0;
  padding: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-primary) transparent;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease 0.1s, transform 0.5s ease 0.1s;
  border-bottom: 1px solid rgba(0, 243, 255, 0.3);
}

.panel-right.has-book .book-backcover-section {
  opacity: 1;
  transform: translateY(0);
}

.book-backcover-section::-webkit-scrollbar { width: 4px; }
.book-backcover-section::-webkit-scrollbar-track { background: transparent; }
.book-backcover-section::-webkit-scrollbar-thumb {
  background: var(--cyan-primary);
  border-radius: 2px;
}

.backcover-title {
  font-family: var(--font-title);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cyan-primary);
  text-align: center;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 10px;
  text-shadow: 0 0 10px var(--cyan-glow);
}

/* Ligne electrique */
.electric-line-wrapper {
  width: 100%;
  height: 20px;
  margin-bottom: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.electric-line-effect {
  width: 85%;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--cyan-primary) 20%,
    var(--cyan-primary) 80%,
    transparent 100%);
  position: relative;
  border-radius: 2px;
  box-shadow:
    0 0 5px var(--cyan-primary),
    0 0 10px var(--cyan-primary),
    0 0 20px var(--cyan-primary);
}

.electric-line-effect::before {
  content: '';
  position: absolute;
  top: -3px;
  left: 0;
  width: 30px;
  height: 8px;
  background: radial-gradient(ellipse at center, #fff 0%, var(--cyan-primary) 40%, transparent 70%);
  border-radius: 50%;
  box-shadow:
    0 0 10px #fff,
    0 0 20px var(--cyan-primary),
    0 0 30px var(--cyan-primary);
  animation: electricSweep 1.5s ease-in-out infinite;
}

@keyframes electricSweep {
  0% {
    left: 0%;
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  50% {
    left: calc(100% - 30px);
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    left: 0%;
    opacity: 0;
  }
}

.backcover-hook {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cyan-primary);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.4;
  text-shadow: 0 0 10px var(--cyan-glow);
  font-style: italic;
}

.backcover-setup {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-white);
  line-height: 1.5;
  margin-bottom: 10px;
  text-align: justify;
}

.backcover-stakes {
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dim);
  line-height: 1.5;
  text-align: center;
  font-style: italic;
}

/* Section 2: Informations livre */
.book-info-section {
  flex: 3.5 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border-top: 1px solid rgba(0, 243, 255, 0.3);
  border-bottom: 1px solid rgba(0, 243, 255, 0.3);
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}

.panel-right.has-book .book-info-section {
  opacity: 1;
  transform: translateY(0);
}

.book-title-container {
  width: 100%;
  text-align: center;
  margin-bottom: 25px;
}

.book-detail-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cyan-primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 15px var(--cyan-glow);
  margin: 0;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* Stats grid */
.book-stats-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 25px;
  justify-content: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 14px;
  background: rgba(0, 243, 255, 0.05);
  border: 1px solid rgba(0, 243, 255, 0.2);
  clip-path: polygon(10% 0, 90% 0, 100% 20%, 100% 80%, 90% 100%, 10% 100%, 0 80%, 0 20%);
}

/* Price badge - Molten Reign style */
.price-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #FFB84D 0%, #CC7722 50%, #8B4513 100%);
  border: 2px solid #FFF8DC;
  clip-path: polygon(10% 0, 90% 0, 100% 20%, 100% 80%, 90% 100%, 10% 100%, 0 80%, 0 20%);
  box-shadow: 0 0 20px rgba(255, 184, 77, 0.4);
}

.price-badge .stat-value {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: #0d0d0d;
  text-shadow: none;
}

.price-badge .stat-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #1a1a1a;
  margin-top: 2px;
}

.stat-icon {
  font-size: 1.2rem;
  margin-bottom: 5px;
  filter: drop-shadow(0 0 5px var(--cyan-glow));
}

.stat-value {
  font-family: var(--font-title);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--cyan-primary);
  text-shadow: 0 0 10px var(--cyan-glow);
}

.stat-label {
  font-family: var(--font-display);
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 3px;
}

/* Genre badge */
.book-genre-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(112, 0, 255, 0.15);
  border: 2px solid rgba(112, 0, 255, 0.4);
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 0.9vw, 1rem);
  clip-path: polygon(5% 0, 95% 0, 100% 15%, 100% 85%, 95% 100%, 5% 100%, 0 85%, 0 15%);
  margin-bottom: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.genre-main {
  color: var(--secondary-neon);
  font-weight: 600;
  text-shadow: 0 0 10px rgba(112, 0, 255, 0.5);
}

.genre-separator {
  color: rgba(255, 255, 255, 0.5);
}

.genre-sub {
  color: var(--text-white);
}

/* Bandeau défilant critères */
.criteria-marquee-container {
  width: 100%;
  overflow: hidden;
  margin-top: 20px;
  padding: 8px 0;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(0, 243, 255, 0.15);
  border-bottom: 1px solid rgba(0, 243, 255, 0.15);
  position: relative;
}

.criteria-marquee-container::before,
.criteria-marquee-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 20px;
  z-index: 2;
  pointer-events: none;
}

.criteria-marquee-container::before {
  left: 0;
  background: linear-gradient(90deg, rgba(10, 22, 40, 1) 0%, transparent 100%);
}

.criteria-marquee-container::after {
  right: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(10, 22, 40, 1) 100%);
}

.criteria-marquee {
  display: flex;
  width: max-content;
  animation: marqueeScroll 20s linear infinite;
}

.criteria-marquee:hover {
  animation-play-state: paused;
}

.criteria-content {
  display: flex;
  gap: 8px;
  padding-right: 30px;
  white-space: nowrap;
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--text-dim);
  letter-spacing: 0.5px;
}

.criteria-content span {
  display: inline-flex;
  align-items: center;
}

.criteria-content span::after {
  content: '•';
  margin-left: 8px;
  color: var(--cyan-primary);
  opacity: 0.5;
}

.criteria-content span:last-child::after {
  content: none;
}

@keyframes marqueeScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Section: Compteur total livres */
.total-books-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5px 0;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease 0.2s, transform 0.5s ease 0.2s;
}

.panel-right.has-book .total-books-section {
  opacity: 1;
  transform: translateY(0);
}

.total-books-count-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  width: 70px;
  height: 70px;
}

.total-books-count {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  color: #d26b2a;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.25);
  user-select: none;
  transition: opacity 0.3s ease;
}

.electric-border-total {
  width: 60px;
  height: 60px;
  position: absolute;
  inset: 0;
  margin: auto;
  pointer-events: none;
  display: grid;
  place-items: center;
  opacity: 0.95;
  filter:
    drop-shadow(0 0 6px rgba(0, 243, 255, 0.55))
    drop-shadow(0 0 16px rgba(0, 243, 255, 0.35));
}

.electric-border-total svg {
  width: 60px;
  height: 60px;
  overflow: visible;
}

.total-books-label {
  font-family: var(--font-title);
  font-size: clamp(0.65rem, 0.8vw, 0.9rem);
  font-weight: 700;
  color: var(--cyan-primary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 5px;
  text-align: center;
  text-shadow: 0 0 10px var(--cyan-glow);
  word-break: break-word;
}

/* Section 3: Actions */
.book-actions-section {
  flex: 3.5 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 15px;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}

.panel-right.has-book .book-actions-section {
  opacity: 1;
  transform: translateY(0);
}

.action-btn {
  width: 85%;
  padding: 14px 16px;
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 0.95vw, 1rem);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  background: rgba(13, 27, 42, 0.4);
  border: none;
  box-shadow: inset 0 0 0 1px var(--cyan-dark);
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
}

.action-btn::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border: 2px solid var(--cyan-primary);
  z-index: -1;
  clip-path: polygon(10% 0, 90% 0, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0 90%, 0 10%);
  transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.action-icon {
  font-size: 1.1rem;
}

.action-read {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.2) 0%, rgba(0, 243, 255, 0.1) 100%);
  border: 2px solid var(--cyan-primary);
  color: var(--cyan-primary);
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.2);
}

.action-read:hover {
  background: linear-gradient(135deg, rgba(0, 243, 255, 0.4) 0%, rgba(0, 243, 255, 0.2) 100%);
  box-shadow: var(--glow-medium);
  transform: translateY(-2px);
}

.action-info {
  background: rgba(112, 0, 255, 0.1);
  border: 1px solid rgba(112, 0, 255, 0.4);
  color: var(--text-white);
}

.action-info:hover {
  background: rgba(112, 0, 255, 0.25);
  border-color: var(--secondary-neon);
  box-shadow: 0 0 20px rgba(112, 0, 255, 0.3);
  transform: translateY(-2px);
}

/* Bouton Commander - Style orange */
.action-order {
  background: rgba(255, 140, 0, 0.15);
  color: #ff8c00;
  text-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
  box-shadow: inset 0 0 5px rgba(255, 140, 0, 0.4);
}

.action-order::before {
  border-color: #ff8c00;
  box-shadow: 0 0 15px rgba(255, 140, 0, 0.4);
}

.action-order:hover {
  background: rgba(255, 140, 0, 0.25);
  box-shadow: inset 0 0 10px rgba(255, 140, 0, 0.5);
  color: #ffa033;
}

/* Bouton Creer Histoire - Texte orange */
a.action-create {
  background: rgba(13, 27, 42, 0.4);
  color: #ff8c00;
  text-shadow: 0 0 10px rgba(255, 140, 0, 0.5);
  text-decoration: none;
}

a.action-create::before {
  border-color: var(--cyan-dark);
}

a.action-create:hover {
  background: rgba(0, 243, 255, 0.1);
  color: var(--cyan-primary);
  text-shadow: 0 0 5px var(--cyan-glow);
}

a.action-create:hover::before {
  border-color: var(--cyan-primary);
  box-shadow: var(--glow-small);
}

/* Bouton Desactive */
.action-disabled {
  background: rgba(50, 50, 50, 0.3);
  color: rgba(150, 150, 150, 0.5);
  cursor: not-allowed;
}

.action-disabled::before {
  border-color: rgba(100, 100, 100, 0.3);
}

.action-disabled:hover {
  background: rgba(50, 50, 50, 0.3);
  color: rgba(150, 150, 150, 0.5);
}

/* ====================================================================
   LIEN VERSION SWITCH
==================================================================== */
.version-switch {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 243, 255, 0.3);
  border-radius: 20px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-size: 0.8rem;
  text-decoration: none;
  z-index: 1000;
  transition: all 0.3s ease;
}

.version-switch:hover {
  background: rgba(0, 243, 255, 0.1);
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
}

/* ====================================================================
   RESPONSIVE - PETITS ECRANS DESKTOP / LAPTOPS
==================================================================== */

/* Breakpoint 1: Laptops moyens (max 1366px) */
@media (max-width: 1366px) {
  :root {
    --carousel-radius: 350px;
    --card-width: 250px;
    --card-height: 375px;
    --panel-min-width: 230px;
    --panel-padding: 15px;
  }

  .genre-title h2 {
    font-size: clamp(0.9rem, 1.4vw, 1.5rem);
    letter-spacing: 0.08em;
  }

  .carousel-item {
    padding: 14px 18px;
    font-size: 0.9rem;
  }

  .carousel-item[data-position="0"] {
    font-size: 1.05rem;
    transform: translateY(0) scale(1.1) translateZ(0);
  }

  .stat-value {
    font-size: 1.2rem;
  }

  .price-badge .stat-value {
    font-size: 1.2rem;
  }

  .book-detail-title {
    font-size: 1rem;
  }

  .floor {
    width: 700px;
    height: 700px;
  }

  .btn {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
  }
}

/* Breakpoint 2: Petits laptops (max 1200px) */
@media (max-width: 1200px) {
  :root {
    --carousel-radius: 280px;
    --card-width: 220px;
    --card-height: 330px;
    --panel-min-width: 200px;
    --panel-padding: 12px;
  }

  .genre-title h2 {
    font-size: clamp(0.8rem, 1.2vw, 1.2rem);
    letter-spacing: 0.05em;
  }

  .genre-title {
    padding: 12px;
  }

  .carousel-item {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .carousel-item[data-position="0"] {
    font-size: 0.95rem;
    transform: translateY(0) scale(1.05) translateZ(0);
  }

  .subgenre-item {
    font-size: 0.85rem;
  }

  .backcover-hook {
    font-size: 0.9rem;
  }

  .backcover-setup,
  .backcover-stakes {
    font-size: 0.8rem;
  }

  .book-detail-title {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
  }

  .stat-value {
    font-size: 1rem;
  }

  .price-badge .stat-value {
    font-size: 1rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .action-btn {
    padding: 10px 12px;
    font-size: 0.85rem;
  }

  .book-genre-badge {
    padding: 8px 10px;
    font-size: 0.8rem;
  }

  .floor {
    width: 500px;
    height: 500px;
  }

  .btn {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .controls {
    bottom: 35px;
    gap: 20px;
  }
}

/* Breakpoint 3: Seuil critique (max 1024px) */
@media (max-width: 1024px) {
  :root {
    --carousel-radius: 230px;
    --card-width: 190px;
    --card-height: 285px;
    --panel-min-width: 180px;
    --panel-padding: 10px;
  }

  .main-content {
    perspective: 900px;
  }

  .genre-title h2 {
    font-size: 0.85rem;
    letter-spacing: 0.03em;
  }

  .genre-title {
    padding: 10px;
  }

  .carousel-item {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .carousel-item[data-position="0"] {
    font-size: 0.88rem;
    transform: translateY(0) scale(1) translateZ(0);
  }

  .subgenre-item {
    font-size: 0.78rem;
    gap: 6px;
  }

  .subgenres-list {
    padding: 12px;
    gap: 6px;
  }

  .backcover-title {
    font-size: 0.75rem;
    letter-spacing: 0.1em;
  }

  .backcover-hook {
    font-size: 0.82rem;
    margin-bottom: 8px;
  }

  .backcover-setup,
  .backcover-stakes {
    font-size: 0.75rem;
  }

  .book-detail-title {
    font-size: 0.8rem;
    letter-spacing: 0.03em;
  }

  .book-title-container {
    margin-bottom: 12px;
  }

  .stat-value {
    font-size: 0.9rem;
  }

  .price-badge .stat-value {
    font-size: 0.9rem;
  }

  .stat-label {
    font-size: 0.55rem;
    letter-spacing: 0.5px;
  }

  .stat-item,
  .price-badge {
    padding: 8px 10px;
  }

  .action-btn {
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  .book-genre-badge {
    padding: 6px 8px;
    font-size: 0.75rem;
  }

  .total-books-label {
    font-size: 0.6rem;
    letter-spacing: 0.05em;
  }

  .total-books-count-container {
    width: 55px;
    height: 55px;
  }

  .total-books-count {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .electric-border-total,
  .electric-border-total svg {
    width: 50px;
    height: 50px;
  }

  .floor {
    width: 400px;
    height: 400px;
  }

  .btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .controls {
    bottom: 25px;
    gap: 15px;
  }

  .card-back {
    padding: 25px 18px;
  }

  .card-back h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
  }

  .card-back p {
    font-size: 0.6rem;
  }

  .card-back .synopsis-hook {
    font-size: 0.65rem;
  }

  .card-back .synopsis-setup,
  .card-back .synopsis-stakes {
    font-size: 0.58rem;
  }
}
