/**
 * Legends Page Styles - IMMERSIVE EXPERIENCE
 * 3D Cards & Multimedia
 */

:root {
  /* DARK THEME (Default - Void) */
  --void-bg: #050508;
  --card-surface: #0f0f12;
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.5);
  --modal-bg: #111;
  --modal-overlay: rgba(0, 0, 0, 0.9);
  --accent-gold: #ffd700;
}

/* LIGHT THEME (Celestial) */
@media (prefers-color-scheme: light) {
  :root {
    --void-bg: #f8f9fa; /* Platinum White */
    --card-surface: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #5a6b7c;
    --border-color: rgba(0, 0, 0, 0.08);
    --shadow-color: rgba(0, 0, 0, 0.1);
    --modal-bg: #ffffff;
    --modal-overlay: rgba(255, 255, 255, 0.85);
  }
}

body.light-mode {
  --void-bg: #f8f9fa;
  --card-surface: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #5a6b7c;
  --border-color: rgba(0, 0, 0, 0.08);
  --shadow-color: rgba(0, 0, 0, 0.1);
  --modal-bg: #ffffff;
  --modal-overlay: rgba(255, 255, 255, 0.85);
}

/* Light Mode Specific Overrides - Class Based */
/* Light Mode Specific Overrides */
body.light-mode .legends-bg-void {
  background: radial-gradient(circle at center, #ffffff 40%, #e2e8f0 100%);
  opacity: 1;
}

body.light-mode .legends-stardust {
  filter: invert(1) opacity(0.5);
}

body.light-mode .legends-title {
  background: linear-gradient(to bottom, #1a1a1a 30%, #4a5568 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

body.light-mode .legends-title::after {
  color: rgba(0, 0, 0, 0.03);
  text-shadow: none;
}

body.light-mode .legends-subtitle {
  color: var(--text-secondary);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .back-link {
  color: var(--text-secondary);
}
body.light-mode .back-link:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
}

/* Card Light Mode */
body.light-mode .card-front {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08); /* Soft ambient shadow */
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: linear-gradient(to bottom, #ffffff, #fdfdfd);
}

body.light-mode .card-title {
  color: var(--text-secondary);
  font-weight: 600;
}

body.light-mode .card-name {
  color: var(--text-primary);
}

body.light-mode .card-content {
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.95) 80%,
    transparent
  );
}

/* Modal Light Mode */
body.light-mode .legend-modal-overlay {
  backdrop-filter: blur(15px);
  background: rgba(255, 255, 255, 0.6);
}

body.light-mode .modal-content-wrapper {
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  background: #ffffff;
}

body.light-mode .modal-left {
  border-right: 1px solid rgba(0, 0, 0, 0.06);
  background: #fafafa; /* Slight distinct background */
}

body.light-mode .modal-close {
  color: var(--text-secondary);
}
body.light-mode .modal-close:hover {
  color: #e53e3e;
}

body.light-mode .stat-bar-bg {
  background: rgba(0, 0, 0, 0.08);
}

body.light-mode .audio-note {
  background: #f0f2f5;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.light-mode .audio-note:hover {
  background: #e2e8f0;
}

body.light-mode .audio-wave span {
  background: var(--text-primary); /* Use dark waves or theme color */
}

body.light-mode .modal-quote {
  border-left-color: var(--theme); /* Theme color works well */
  color: var(--text-primary);
}

/* Light Mode Specific Overrides - System Preference */
/* Light Mode Specific Overrides - System Preference */
@media (prefers-color-scheme: light) {
  .legends-bg-void {
    background: radial-gradient(circle at center, #ffffff 40%, #e2e8f0 100%);
    opacity: 1;
  }

  .legends-stardust {
    filter: invert(1) opacity(0.5);
  }

  .legends-title {
    background: linear-gradient(to bottom, #1a1a1a 30%, #4a5568 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
  }

  .legends-title::after {
    color: rgba(0, 0, 0, 0.03);
    text-shadow: none;
  }

  .legends-subtitle {
    color: var(--text-secondary);
    border-color: rgba(0, 0, 0, 0.1);
  }

  .back-link {
    color: var(--text-secondary);
  }
  .back-link:hover {
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
  }

  .card-front {
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(to bottom, #ffffff, #fdfdfd);
  }

  .card-title {
    color: var(--text-secondary);
    font-weight: 600;
  }

  .card-name {
    color: var(--text-primary);
  }

  .card-content {
    background: linear-gradient(
      to top,
      rgba(255, 255, 255, 0.95) 80%,
      transparent
    );
  }

  .legend-modal-overlay {
    backdrop-filter: blur(15px);
    background: rgba(255, 255, 255, 0.6);
  }

  .modal-content-wrapper {
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    background: #ffffff;
  }

  .modal-left {
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    background: #fafafa;
  }

  .modal-close {
    color: var(--text-secondary);
  }
  .modal-close:hover {
    color: #e53e3e;
  }

  .stat-bar-bg {
    background: rgba(0, 0, 0, 0.08);
  }

  .audio-note {
    background: #f0f2f5;
    border: 1px solid rgba(0, 0, 0, 0.05);
  }

  .audio-note:hover {
    background: #e2e8f0;
  }

  .audio-wave span {
    background: var(--text-primary);
  }

  .modal-quote {
    border-left-color: var(--theme);
    color: var(--text-primary);
  }
}

body.community_legends {
  background-color: var(--void-bg);
  color: var(--text-primary);
  font-family: "Outfit", sans-serif;
  perspective: 1000px;
  overflow-x: hidden;
}

/* --- BACKGROUNDS --- */
.legends-bg-void {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, #1a1a20 0%, #050508 100%);
  z-index: -2;
}
.legends-stardust {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1h2v2H1V1M50 50h2v2h-2v-2' fill='white' fill-opacity='0.1'/%3E%3C/svg%3E");
  opacity: 0.5;
  z-index: -1;
  mask-image: radial-gradient(circle, black 0%, transparent 80%);
}

.legends-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 4rem 2rem;
}

/* --- HERO --- */
.legends-hero {
  text-align: center;
  margin-bottom: 6rem;
  position: relative;
  padding-top: 4rem;
}

.legends-title {
  font-size: 6rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 10px;
  margin: 0;
  line-height: 1;
  background: linear-gradient(
    to bottom,
    #fff 40%,
    rgba(255, 255, 255, 0.2) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  display: inline-block;
}
.legends-title::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  color: rgba(255, 255, 255, 0.05);
  filter: blur(10px);
  transform: scale(1.1);
}

.legends-subtitle {
  font-size: 1.2rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 4px;
  margin-top: 1rem;
}

.back-link {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--text-secondary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  transition: color 0.3s;
}
.back-link:hover {
  color: #fff;
}

/* --- 3D DECK GRID --- */
.legends-deck {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 3rem;
  justify-content: center;
}

/* Card Wrap (Trigger area) */
.card-wrap {
  height: 450px;
  perspective: 1000px;
  cursor: pointer;
}

.legend-card-3d {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.1s ease-out; /* Smooth tilt */
  border-radius: 20px;
}

/* Card Visuals */
.card-front {
  position: absolute;
  inset: 0;
  background: var(--card-surface);
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.card-glow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 50px var(--theme); /* Theme Color Glow */
  opacity: 0.2;
  z-index: 1;
  pointer-events: none;
}

.card-image {
  height: 100%;
  width: 100%;
  background-size: cover;
  background-position: center;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 2rem;
  z-index: 1;
}

/* Placeholder Avatar if no image - HIDDEN for full image aesthetic unless image fails */
.card-avatar-placeholder {
  display: none;
}

.card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  background: linear-gradient(
    to top,
    var(--card-surface) 10%,
    rgba(0, 0, 0, 0.8) 40%,
    transparent 100%
  );
  padding-bottom: 40px;
}

.role-icon {
  font-size: 2rem;
  color: var(--theme);
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 0 10px var(--theme));
}

.card-name {
  font-size: 2rem;
  margin: 0;
  text-transform: uppercase;
  font-weight: 800;
}

.card-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.card-shine {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  border-radius: 20px;
}

/* --- IMMERSIVE MODAL --- */
.legend-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999; /* Above everything including navbar */
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  padding: 20px;
  overflow-y: auto;
}
.legend-modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content-wrapper {
  width: 95%;
  max-width: 1300px;
  max-height: 90vh; /* Allow taller modals on desktop */
  background: #111;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  transform: scale(0.9) translateY(30px);
  transition: 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
}
.legend-modal-overlay.active .modal-content-wrapper {
  transform: scale(1) translateY(0);
}

.modal-close {
  position: absolute;
  top: 2rem;
  right: 2rem;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  z-index: 20;
  transition: 0.3s;
}
.modal-close:hover {
  transform: rotate(90deg);
  color: #ff5555;
}

.modal-layout {
  display: flex;
  height: 100%;
  overflow: hidden;
}

/* Left Column */
.modal-left {
  width: 32%;
  min-width: 250px;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.modal-hero-image {
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-img-placeholder {
  width: 100%;
  height: 280px; /* Reduced for compact layout */
  border-radius: 16px;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  background-color: #000;
  overflow: hidden;
  transition: 0.3s;
  flex-shrink: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.modal-img-placeholder.has-image {
  background-color: transparent; /* Show image */
}

/* Portrait images (vertical) - use contain to avoid cropping faces */
.modal-img-placeholder.portrait {
  background-size: contain;
  background-position: center center;
  position: relative;
}

/* Blurred background effect for portrait images */
.modal-img-placeholder.portrait::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: inherit;
  background-size: cover;
  background-position: center;
  filter: blur(20px) brightness(0.5);
  transform: scale(1.2);
  z-index: -1;
  border-radius: inherit;
}

.modal-img-placeholder.portrait.has-image {
  background-color: transparent; /* Show image */
}

.modal-stats {
  margin-top: 2rem;
}
.modal-stat-row {
  margin-bottom: 1rem;
}
.stat-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  text-transform: uppercase;
  margin-bottom: 5px;
  color: var(--text-secondary);
}
.stat-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}
.stat-bar-fill {
  height: 100%;
}

/* Right Column */
.modal-right {
  flex: 1;
  padding: 1.5rem 2rem;
  overflow-y: auto;
  max-height: 100%;
}

.modal-subtitle {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.5rem;
  display: block;
}
.modal-name {
  font-size: 2.5rem;
  font-weight: 900;
  margin: 0 0 0.5rem;
  line-height: 0.95;
}
.modal-quote {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-secondary);
  border-left: 3px solid #fff;
  padding-left: 1rem;
  margin-bottom: 1.5rem;
}

.modal-desc {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
}
.no-media {
  grid-column: 1 / -1;
  color: var(--text-secondary);
  font-style: italic;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-align: center;
}
.media-item {
  cursor: pointer;
}
.media-thumb {
  aspect-ratio: 16/9;
  background: #222;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin-bottom: 0.5rem;
  transition: 0.3s;
}
.media-item:hover .media-thumb {
  background: #333;
  transform: scale(1.05);
}

.audio-note {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50px;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 3rem;
  width: fit-content;
  cursor: pointer;
  transition: 0.3s;
}
.audio-note:hover {
  background: rgba(255, 255, 255, 0.1);
}
.play-btn {
  width: 50px;
  height: 50px;
  background: var(--theme, #fff); /* Use theme color */
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Add shadow for contrast */
  font-size: 1.5rem; /* Larger icon */
}
.audio-wave {
  display: flex;
  gap: 3px;
  align-items: center;
  height: 20px;
}
.audio-wave span {
  width: 3px;
  background: var(--theme, #fff); /* Use theme color */
  height: 5px; /* Default static height (low) */
  border-radius: 2px;
  transition: height 0.2s ease;
}
.audio-wave.playing span {
  animation: wave 1s infinite;
}
@keyframes wave {
  0%,
  100% {
    height: 10px;
  }
  50% {
    height: 20px;
  }
}

/* ============================================
   RESPONSIVE BREAKPOINTS FOR MODAL
   ============================================ */

/* LAPTOPS PEQUEÑAS (1366x768 y similares) - Altura limitada */
@media (max-height: 800px) and (min-width: 901px) {
  .legend-modal-overlay {
    padding: 10px;
  }

  .modal-content-wrapper {
    max-height: min(90vh, 600px);
  }

  .modal-left {
    width: 28%;
    min-width: 220px;
    padding: 1rem;
  }

  .modal-right {
    padding: 1rem 1.5rem;
  }

  .modal-img-placeholder {
    height: 200px;
  }

  .modal-name {
    font-size: 2rem;
  }

  .modal-quote {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .modal-desc {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .modal-stats {
    margin-top: 0.75rem;
  }

  .modal-stat-row {
    margin-bottom: 0.5rem;
  }

  .stat-info {
    font-size: 0.7rem;
  }

  .stat-bar-bg {
    height: 4px;
  }

  .modal-close {
    top: 0.75rem;
    right: 0.75rem;
    font-size: 1.3rem;
  }

  .audio-note {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
  }

  .play-btn {
    width: 35px;
    height: 35px;
  }

  .modal-media-section h3 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
  }

  .media-grid {
    gap: 0.75rem;
  }

  .media-thumb {
    font-size: 1.5rem;
  }

  #modal-favorites-section {
    margin-top: 0.75rem !important;
    margin-bottom: 1rem !important;
  }

  #modal-favorites-section h4 {
    font-size: 0.75rem !important;
    margin-bottom: 0.5rem !important;
  }

  .favorites-grid img {
    width: 40px !important;
    height: 40px !important;
  }
}

/* LAPTOPS MUY PEQUEÑAS (altura < 700px) */
@media (max-height: 700px) and (min-width: 901px) {
  .modal-content-wrapper {
    height: 98vh;
    max-height: calc(100vh - 20px);
    border-radius: 20px;
  }

  .modal-left {
    width: 28%;
    padding: 1rem;
  }

  .modal-right {
    padding: 1.5rem 2rem;
  }

  .modal-img-placeholder {
    height: 220px;
  }

  .modal-name {
    font-size: 2.2rem;
  }

  .modal-quote {
    font-size: 1rem;
    margin-bottom: 1rem;
  }

  .modal-desc {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }

  .modal-subtitle {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }

  .modal-stats {
    margin-top: 0.75rem;
  }

  #modal-favorites-section {
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
  }

  .audio-note {
    margin-top: 1rem;
    padding: 0.6rem 1.2rem;
  }

  .play-btn {
    width: 40px;
    height: 40px;
  }
}

/* TABLETS Y PANTALLAS MEDIANAS (ancho <= 1200px con altura limitada) */
@media (max-width: 1200px) and (max-height: 800px) {
  .modal-content-wrapper {
    width: 95%;
    max-width: 95vw;
  }

  .modal-left {
    padding: 1.25rem;
  }

  .modal-right {
    padding: 1.5rem 2rem;
  }
}

/* MOBILE Y TABLETS PEQUEÑAS (ancho <= 900px) */
@media (max-width: 900px) {
  .modal-layout {
    flex-direction: column;
  }
  .modal-left,
  .modal-right {
    width: 100%;
    padding: 1.5rem;
    overflow-y: visible !important;
    height: auto !important;
  }
  .modal-left {
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }
  .modal-content-wrapper {
    height: 95dvh;
    max-height: calc(100dvh - 20px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 95%;
  }

  .modal-layout {
    overflow-y: auto;
    height: 100%;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  .modal-close {
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    backdrop-filter: blur(5px);
  }

  .modal-img-placeholder {
    height: 250px;
  }

  .modal-name {
    font-size: 2.5rem;
  }

  .modal-quote {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
  }

  .modal-desc {
    font-size: 1rem;
  }

  .legends-title {
    font-size: 3.5rem;
  }
}

/* MOBILE PEQUEÑO */
@media (max-width: 480px) {
  .modal-content-wrapper {
    width: 100%;
    max-width: 100vw;
    border-radius: 15px 15px 0 0;
    height: 100dvh;
    max-height: 100dvh;
  }

  .modal-left,
  .modal-right {
    padding: 1rem;
  }

  .modal-img-placeholder {
    height: 200px;
  }

  .modal-name {
    font-size: 2rem;
  }

  .modal-quote {
    font-size: 1rem;
    padding-left: 0.75rem;
  }

  .modal-desc {
    font-size: 0.9rem;
  }

  .audio-note {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    justify-content: center;
    text-align: center;
  }

  .audio-label {
    width: 100%;
    margin-top: 0.5rem;
    font-size: 0.85rem;
  }

  .modal-close {
    top: 0.5rem;
    right: 0.5rem;
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .legends-title {
    font-size: 2.5rem;
    letter-spacing: 3px;
  }

  .legends-subtitle {
    font-size: 0.9rem;
  }

  .media-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}
/* Conflict Resolution: Removed conflicting body override for community_legends that was forcing dark mode. */
/* body.community_legends {
  background-color: var(--toon-dark);
  color: #fff;
  font-family: "Outfit", sans-serif;
  overflow-x: hidden;
} */

/* --- VIBRANT BACKGROUND --- */
.legends-bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(
      circle at 50% 120%,
      rgba(157, 78, 221, 0.4),
      transparent 70%
    ),
    radial-gradient(circle at 10% 10%, rgba(255, 0, 127, 0.2), transparent 40%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 20l2-2 2 2-2 2-2-2zm-10 0l2-2 2 2-2 2-2-2zm20 0l2-2 2 2-2 2-2-2z' fill='%23ffffff' fill-opacity='0.05'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* --- HERO SECTION: TOON STYLE --- */
.legends-hero {
  text-align: center;
  padding: 8rem 0 4rem;
  position: relative;
  z-index: 2;
}

.back-link {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 50px;
  padding: 0.8rem 1.5rem;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: 0.2s;
  box-shadow: 0 5px 0 rgba(0, 0, 0, 0.2);
}
.back-link:hover {
  transform: translateY(-2px);
  background: #fff;
  color: var(--toon-purple);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.2);
}

.crown-wrapper {
  display: inline-block;
  filter: drop-shadow(0 0 0 var(--toon-gold))
    drop-shadow(0 10px 0 rgba(0, 0, 0, 0.3));
  margin-bottom: 2rem;
  animation: bounce-float 3s infinite ease-in-out;
}
.crown-icon {
  font-size: 7rem;
  color: var(--toon-gold);
  /* Efecto borde caricatura */
  -webkit-text-stroke: 4px black;
  paint-order: stroke fill;
}

.crown-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.4), transparent 70%);
  mix-blend-mode: screen;
  z-index: -1;
  animation: rotate-glow 10s linear infinite;
}

.title-container {
  position: relative;
  display: inline-block;
}
.legends-title {
  font-size: clamp(4rem, 10vw, 7rem);
  font-weight: 900;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  line-height: 1;

  /* Efecto Título Videojuego */
  text-shadow:
    0 8px 0 var(--toon-purple-dark),
    0 15px 10px rgba(0, 0, 0, 0.5);
  background: linear-gradient(to bottom, #fff 0%, #f0f0f0 50%, #e0e0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  -webkit-text-stroke: 3px var(--toon-purple-dark);
  letter-spacing: 2px;
  transform: skewY(-2deg); /* Un poco de inclinación divertida */
}

.legends-subtitle {
  margin-top: 2rem;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--toon-gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 0 black;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  display: inline-block;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.section-hint {
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1.5rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.section-hint i {
  font-size: 1.2rem;
  color: var(--toon-gold);
  animation: pulse-hint 2s infinite;
}

@keyframes pulse-hint {
  0% {
    opacity: 0.7;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
  100% {
    opacity: 0.7;
    transform: scale(1);
  }
}

/* --- GRID CARTOON --- */
.legends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 4rem;
  padding: 4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* --- CARD: THE HERO CARD --- */
.legend-card {
  position: relative;
  background: var(--toon-surface);
  border-radius: 40px; /* Muy redondeado */
  padding: 0;
  text-align: center;
  transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: 4px solid var(--toon-purple);
  box-shadow:
    0 10px 0 var(--toon-purple-dark),
    /* Sombra 3D sólida */ 0 20px 20px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  height: 520px;
  display: flex;
  flex-direction: column;
}

.legend-card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow:
    0 15px 0 var(--toon-purple-dark),
    0 30px 40px rgba(157, 78, 221, 0.4);
  border-color: var(--toon-pink);
}

/* Imagen estilo "Sticker" */
.legend-image-wrapper {
  height: 240px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}

.legend-avatar {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: #000;
  border: 6px solid #fff;
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 900;
  color: var(--toon-gold);
  z-index: 10;
}

.legend-info {
  padding: 0 2rem 2rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: #25162e;
}

/* Nombre estilo Comic */
.legend-name {
  font-size: 2.5rem;
  font-weight: 900;
  color: #fff;
  margin: -1.5rem 0 0.5rem; /* Subir para superponer */
  position: relative;
  z-index: 20;
  text-shadow: 0 4px 0 #000;
  -webkit-text-stroke: 2px black;
  transform: rotate(-2deg);
}

.legend-title {
  display: inline-block;
  background: var(--toon-pink);
  color: #fff;
  padding: 0.5rem 1.2rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  border: 2px solid rgba(255, 255, 255, 0.5);
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 0 rgba(163, 0, 82, 1);
}

.legend-quote {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 15px;
  margin-bottom: auto;
  border: 1px dashed rgba(255, 255, 255, 0.2);
}

/* Stats "Capsules" */
.legend-stats {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 1.5rem;
}
.stat-item {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  padding: 0.8rem 0.5rem;
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.stat-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--toon-gold);
}
.stat-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.7;
}

/* Footer Button */
.legends-footer {
  text-align: center;
  margin-top: 6rem;
  padding-bottom: 6rem;
}

.btn-majestic {
  display: inline-block;
  background: var(--toon-gold);
  color: #000;
  font-size: 1.5rem;
  font-weight: 900;
  padding: 1.5rem 4rem;
  border-radius: 100px;
  text-decoration: none;
  text-transform: uppercase;
  border: 4px solid #fff;
  box-shadow:
    0 10px 0 var(--toon-gold-shadow),
    0 20px 40px rgba(255, 215, 0, 0.4);
  transition: 0.2s;
  animation: pulse-btn 2s infinite;
}
.btn-majestic:hover {
  transform: translateY(4px);
  box-shadow:
    0 6px 0 var(--toon-gold-shadow),
    0 15px 30px rgba(255, 215, 0, 0.4);
}
.btn-majestic:active {
  transform: translateY(10px);
  box-shadow: 0 0 0 var(--toon-gold-shadow);
}

/* Animations */
@keyframes bounce-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}
@keyframes rotate-glow {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
@keyframes pulse-btn {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .legends-title {
    font-size: 3.5rem;
  }
  .legend-card {
    height: auto;
    padding-bottom: 2rem;
  }
}
body.community_legends {
  background-color: var(--void-black);
  color: #fff;
  font-family: "Outfit", sans-serif;
  overflow-x: hidden;
}

/* --- ATMOSPHERE & BACKGROUNDS --- */
.legends-bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background:
    radial-gradient(
      circle at 50% -20%,
      rgba(255, 215, 0, 0.15),
      transparent 70%
    ),
    radial-gradient(
      circle at 0% 100%,
      rgba(138, 43, 226, 0.1),
      transparent 50%
    ),
    radial-gradient(
      circle at 100% 100%,
      rgba(255, 0, 100, 0.05),
      transparent 50%
    ),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffd700' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zz'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

.legends-particles {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(white, rgba(255, 255, 255, 0.2) 2px, transparent 3px),
    radial-gradient(white, rgba(255, 255, 255, 0.15) 1px, transparent 2px),
    radial-gradient(white, rgba(255, 255, 255, 0.1) 2px, transparent 3px);
  background-size:
    550px 550px,
    350px 350px,
    250px 250px;
  background-position:
    0 0,
    40px 60px,
    130px 270px;
  animation: star-rise 60s linear infinite;
  opacity: 0.4;
  z-index: 0;
}

/* --- HERO SECTION MAJESTIC --- */
.legends-hero {
  text-align: center;
  padding: 8rem 0 5rem;
  position: relative;
  z-index: 2;
}

.back-link {
  position: absolute;
  top: 2rem;
  left: 2rem;
  color: rgba(255, 255, 255, 0.4);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 600;
  letter-spacing: 1px;
  transition: 0.4s;
  text-transform: uppercase;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border: 1px solid transparent;
  border-radius: 50px;
}
.back-link:hover {
  color: var(--gold-primary);
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 215, 0, 0.05);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.1);
}

.crown-wrapper {
  position: relative;
  display: inline-block;
}
.crown-icon {
  font-size: 6rem;
  background: linear-gradient(
    135deg,
    #fff 0%,
    var(--gold-primary) 40%,
    var(--gold-dark) 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 2rem;
  filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.6));
  animation: royal-float 4s ease-in-out infinite;
}
.crown-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(255, 215, 0, 0.2) 0%,
    transparent 70%
  );
  filter: blur(20px);
  z-index: -1;
  animation: pulse-glow 3s infinite alternate;
}

.legends-title {
  font-family:
    "Cinzel Decorative", "Outfit", serif; /* Si no carga cinzel, usa outfit */
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.9;
  letter-spacing: 5px;
  margin-bottom: 1rem;
  position: relative;
  display: inline-block;

  /* Efecto Metálico Dorado */
  background: linear-gradient(
    to bottom,
    #cfc09f 22%,
    #634f2c 24%,
    #cfc09f 26%,
    #cfc09f 27%,
    #ffecb3 40%,
    #3a2c0f 78%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent; /* Fallback */
  -webkit-text-stroke: 1px rgba(255, 215, 0, 0.4);
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.3));
}

.legends-subtitle {
  font-size: 1.5rem;
  color: #e0e0e0;
  max-width: 800px;
  margin: 0 auto;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(0, 0, 0, 0.5),
    transparent
  );
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- GRID MAJESTIC --- */
.legends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 4rem;
  padding: 4rem 2rem;
  max-width: 1600px;
  margin: 0 auto;
}

/* --- CARD: THE MONOLITH --- */
.legend-card {
  position: relative;
  height: 600px;
  background: rgba(10, 10, 12, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.1);
  border-radius: 4px; /* Bordes mas rectos, más serios */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
  backdrop-filter: blur(10px);

  /* Marco Doble */
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 1),
    0 0 0 3px rgba(255, 215, 0, 0.05),
    0 20px 50px rgba(0, 0, 0, 0.8);
}

/* Imagen Full Background con Gradiente */
.legend-image-wrapper {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.6;
  transition: 0.6s;
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}
.legend-card:hover .legend-image-wrapper {
  opacity: 0.8;
  transform: scale(1.05);
}

/* Contenido Inferior */
.legend-info {
  margin-top: auto;
  padding: 3rem 2rem;
  z-index: 2;
  position: relative;
  background: linear-gradient(
    to top,
    #000 0%,
    rgba(0, 0, 0, 0.8) 50%,
    transparent 100%
  );
  border-top: 1px solid rgba(255, 215, 0, 0.1);
}

/* Decoraciones de Esquina */
.legend-card::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  border: 1px solid rgba(255, 215, 0, 0.15);
  z-index: 3;
  pointer-events: none;
  transition: 0.4s;
}
.legend-card:hover::after {
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: inset 0 0 30px rgba(255, 215, 0, 0.1);
}

.legend-card:hover {
  transform: translateY(-15px);
  box-shadow:
    0 0 0 1px rgba(255, 215, 0, 0.5),
    0 0 50px rgba(255, 215, 0, 0.2),
    0 30px 60px rgba(0, 0, 0, 1);
}

/* Tipografía de Tarjeta */
.legend-name {
  font-family: "Cinzel Decorative", serif;
  font-size: 3rem;
  color: var(--gold-primary);
  margin: 0;
  text-transform: uppercase;
  text-shadow: 0 5px 15px rgba(0, 0, 0, 0.8);
  letter-spacing: 2px;
}

.legend-title {
  display: inline-block;
  font-size: 0.9rem;
  color: #fff;
  background: var(--gold-dark);
  padding: 5px 15px;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 2px;
  margin-bottom: 2rem;
  clip-path: polygon(10% 0, 100% 0, 90% 100%, 0% 100%);
}

.legend-quote {
  font-family: "Playfair Display", serif;
  font-size: 1.3rem;
  font-style: italic;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2rem;
  position: relative;
  padding-left: 20px;
  border-left: 3px solid var(--gold-primary);
}

/* Stats Grid Majestic */
.legend-stats {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
}
.stat-item {
  text-align: center;
}
.stat-value {
  display: block;
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}
.stat-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold-primary);
}

/* Animations */
@keyframes star-rise {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(-1000px);
  }
}

@keyframes royal-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-15px) rotate(2deg);
  }
}

@keyframes pulse-glow {
  from {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(0.8);
  }
  to {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

/* Footer Majestic */
.legends-footer {
  text-align: center;
  margin-top: 8rem;
  padding-bottom: 8rem;
  position: relative;
}
.legends-footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--gold-primary),
    transparent
  );
}

.btn-majestic {
  background: transparent;
  border: 2px solid var(--gold-primary);
  color: var(--gold-primary);
  padding: 1.5rem 4rem;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 800;
  position: relative;
  overflow: hidden;
  transition: 0.4s;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-majestic:hover {
  background: var(--gold-primary);
  color: black;
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
  .class-legends-title {
    font-size: 3rem;
  }
  .legend-card {
    height: auto;
  }
}
body.community_legends {
  background-color: var(--dark-base);
  color: #fff;
  font-family: "Outfit", sans-serif;
}

/* Ambient Background */
.legends-bg-ambient {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 215, 0, 0.08), transparent 60%),
    radial-gradient(
      circle at 80% 80%,
      rgba(157, 78, 221, 0.05),
      transparent 50%
    );
  pointer-events: none;
  z-index: 0;
}

/* Header */
.legends-hero {
  text-align: center;
  padding: 6rem 0 4rem;
  position: relative;
}

.back-link {
  position: absolute;
  top: 2rem;
  left: 0;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: 0.3s;
}
.back-link:hover {
  color: var(--gold-primary);
}

.crown-icon {
  font-size: 4rem;
  color: var(--gold-primary);
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
  animation: float 6s ease-in-out infinite;
}

.legends-title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 900;
  letter-spacing: -2px;
  margin: 0;
  line-height: 1;
}

.text-gold {
  background: linear-gradient(180deg, #fff 0%, var(--gold-primary) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.legends-subtitle {
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 1.5rem;
  letter-spacing: 1px;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Grid */
.legends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 3rem;
  padding: 2rem 0;
}

/* Card */
.legend-card {
  background: linear-gradient(
    145deg,
    rgba(20, 20, 20, 0.9) 0%,
    rgba(5, 5, 5, 0.95) 100%
  );
  border: 1px solid rgba(255, 215, 0, 0.15);
  border-radius: 20px;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.legend-card:hover {
  transform: translateY(-10px);
  border-color: var(--gold-primary);
  box-shadow: 0 10px 40px rgba(255, 215, 0, 0.1);
}

.legend-image-wrapper {
  width: 120px;
  height: 120px;
  margin: 0 auto 2rem;
  position: relative;
}

.legend-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #111;
  border: 2px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold-primary);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.legend-name {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
  color: #fff;
}

.legend-title {
  display: inline-block;
  margin-top: 0.5rem;
  padding: 0.3rem 1rem;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 50px;
  color: var(--gold-primary);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.legend-quote {
  margin: 2rem 0;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.8);
  font-style: italic;
  font-family: serif; /* Toque clásico */
}

/* Stats */
.legend-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 1.5rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
}

.stat-label {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Colors variants */
.glow-cyan .legend-avatar,
.glow-cyan .legend-title {
  color: #00f3ff;
  border-color: #00f3ff;
  background: rgba(0, 243, 255, 0.05);
}
.glow-cyan:hover {
  border-color: #00f3ff;
  box-shadow: 0 10px 40px rgba(0, 243, 255, 0.1);
}

.glow-purple .legend-avatar,
.glow-purple .legend-title {
  color: #d400ff;
  border-color: #d400ff;
  background: rgba(212, 0, 255, 0.05);
}
.glow-purple:hover {
  border-color: #d400ff;
  box-shadow: 0 10px 40px rgba(212, 0, 255, 0.1);
}

/* Footer */
.legends-footer {
  text-align: center;
  margin-top: 5rem;
  padding-bottom: 5rem;
}

.legends-footer p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: rgba(255, 255, 255, 0.6);
}

.btn-gold-outline {
  display: inline-block;
  padding: 1rem 3rem;
  border: 1px solid var(--gold-primary);
  color: var(--gold-primary);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  transition: 0.3s;
}

.btn-gold-outline:hover {
  background: var(--gold-primary);
  color: #000;
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.4);
}

/* ==========================================================================
   MASTER LIGHT MODE OVERRIDES - CELESTIAL THEME
   (Placed at the end to override all previous legacy styles)
   ========================================================================== */
@media (prefers-color-scheme: light), screen {
  body.light-mode,
  [data-theme="light"] body {
    /* Force Light Background */
    background-color: #f8f9fa !important;
    --void-bg: #f8f9fa;
    --card-surface: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #5a6b7c;
    color: #1a1a1a !important;
  }

  /* Override Backgrounds */
  body.light-mode .legends-bg-void,
  [data-theme="light"] .legends-bg-void,
  body.light-mode .legends-bg-ambient,
  [data-theme="light"] .legends-bg-ambient {
    background: radial-gradient(
      circle at center,
      #ffffff 40%,
      #e2e8f0 100%
    ) !important;
    opacity: 1 !important;
  }

  /* Stardust / Particles */
  body.light-mode .legends-stardust,
  [data-theme="light"] .legends-stardust,
  body.light-mode .legends-particles,
  [data-theme="light"] .legends-particles {
    filter: invert(1) opacity(0.5);
  }

  /* Hero Title */
  body.light-mode .legends-title,
  [data-theme="light"] .legends-title {
    background: linear-gradient(
      to bottom,
      #1a1a1a 30%,
      #4a5568 100%
    ) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent;
    text-shadow: none !important;
    -webkit-text-stroke: 0px transparent !important;
    filter: none !important;
  }

  body.light-mode .legends-title::after,
  [data-theme="light"] .legends-title::after {
    display: none !important;
  }

  /* Subtitles */
  body.light-mode .legends-subtitle,
  [data-theme="light"] .legends-subtitle {
    color: #5a6b7c !important;
    background: rgba(0, 0, 0, 0.05) !important;
    border-color: rgba(0, 0, 0, 0.1) !important;
    text-shadow: none !important;
  }

  /* Cards - 3D and Flat */
  body.light-mode .legend-card-3d,
  [data-theme="light"] .legend-card-3d,
  body.light-mode .legend-card,
  [data-theme="light"] .legend-card {
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08) !important;
    color: #1a1a1a !important;
    overflow: hidden; /* Ensure image doesn't overflow */
  }

  body.light-mode .card-front,
  [data-theme="light"] .card-front {
    background: #ffffff !important;
    box-shadow: none !important; /* Managed by parent */
  }

  /* Adjust gradient for light mode overlay */
  body.light-mode .card-content,
  [data-theme="light"] .card-content {
    background: linear-gradient(
      to top,
      rgba(255, 255, 255, 0.95) 20%,
      rgba(255, 255, 255, 0.6) 50%,
      transparent 100%
    ) !important;
  }

  body.light-mode .card-name,
  [data-theme="light"] .card-name,
  body.light-mode .legend-name,
  [data-theme="light"] .legend-name {
    color: #1a1a1a !important;
    text-shadow: none !important;
    -webkit-text-stroke: 0px transparent !important;
  }

  body.light-mode .card-title,
  [data-theme="light"] .card-title,
  body.light-mode .legend-title,
  [data-theme="light"] .legend-title {
    color: #5a6b7c !important;
    background: transparent !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: none !important;
  }

  /* Stats */
  body.light-mode .stat-label,
  [data-theme="light"] .stat-label {
    color: #5a6b7c !important;
  }

  body.light-mode .stat-value,
  [data-theme="light"] .stat-value {
    color: #1a1a1a !important;
    text-shadow: none !important;
  }

  /* Back Link */
  body.light-mode .back-link,
  [data-theme="light"] .back-link {
    color: #5a6b7c !important;
    background: rgba(0, 0, 0, 0.05) !important;
  }
  body.light-mode .back-link:hover,
  [data-theme="light"] .back-link:hover {
    background: #1a1a1a !important;
    color: #fff !important;
  }

  /* Modal */
  body.light-mode .modal-content-wrapper,
  [data-theme="light"] .modal-content-wrapper {
    background: #ffffff !important;
    color: #1a1a1a !important;
  }

  body.light-mode .modal-name,
  body.light-mode .modal-desc,
  body.light-mode .modal-quote,
  [data-theme="light"] .modal-name,
  [data-theme="light"] .modal-desc,
  [data-theme="light"] .modal-quote {
    color: #1a1a1a !important;
  }
}

/* Favorite Champions Section */
.favorites-grid {
  display: flex;
  gap: 15px;
  margin-top: 10px;
}

.champ-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
  background: #000;
}

.champ-circle:hover {
  transform: scale(1.1);
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

/* Scroll Indicator */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  animation: bounce 2s infinite;
  pointer-events: none;
  z-index: 10;
  display: none; /* Hidden by default */
  transition: opacity 0.3s;
}

.scroll-indicator.hidden {
  opacity: 0;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

@media (max-width: 900px) {
  .scroll-indicator {
    display: block;
  }
}
/* --- VIDEO MODAL & CUSTOM PLAYER --- */
.video-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(8px);
  z-index: 20000 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.video-modal-content {
  position: relative;
  /* Width constraints: 
     1. 90% of width
     2. Max 1200px
     3. Max 140vh (approx 80vh height * 1.77 aspect ratio) to ensure it fits vertically */
  width: min(90%, 1200px, 140vh);
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 16px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: auto; /* Ensure centering */
}

/* Close Button - Outside Top Right */
.video-modal-close {
  position: absolute;
  top: -50px;
  right: -20px;
  background: rgba(255, 255, 255, 0.1);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 20001;
}
.video-modal-close:hover {
  background: var(--gold-primary, #ffd700);
  color: #000;
  transform: rotate(90deg);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

/* Wrapper */
/* Wrapper */
.video-wrapper.custom-player {
  position: relative;
  width: 100%;
  height: 100%;
  background: #000;
  isolation: isolate;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 1;
}

/* Controls Overlay */
.video-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 40%);
  opacity: 0;
  transition: opacity 0.3s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none; /* Pass clicks to video */
  z-index: 20; /* Higher than video (1) */
}

/* Show controls on hover or when paused */
.video-wrapper:hover .video-overlay,
.video-wrapper.paused .video-overlay {
  opacity: 1;
}

/* Big Center Play Button */
.big-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 90px;
  height: 90px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  border: 3px solid var(--gold-primary, #ffd700);
  border-radius: 50%;
  color: var(--gold-primary, #ffd700);
  font-size: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto; /* Buttons need clicks */
  z-index: 25;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.2);
}

.big-play-btn:hover {
  background: var(--gold-primary, #ffd700);
  color: #000;
  transform: translate(-50%, -50%) scale(1.1);
  box-shadow: 0 0 50px rgba(255, 215, 0, 0.5);
}

/* Control Bar */
.video-controls {
  padding: 20px 30px;
  pointer-events: auto;
  z-index: 30; /* Ensure controls are on top */
  position: relative;
  box-sizing: border-box;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  margin-bottom: 15px;
  position: relative;
  height: 12px; /* Thicker for easier interaction */
}
.progress-container:hover {
  height: 12px;
}
.progress-fill {
  height: 100%;
  background: var(--gold-primary, #ffd700);
  width: 0%;
  border-radius: 4px;
  position: relative;
  box-shadow: 0 0 15px var(--gold-primary, #ffd700);
}
.progress-handle {
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%) scale(0);
  width: 18px; /* Slightly larger */
  height: 18px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}
.progress-container:hover .progress-handle,
.progress-container:active .progress-handle {
  /* Keep visible while dragging */
  transform: translateY(-50%) scale(1);
}

/* Buttons Row */
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.control-btn {
  background: none;
  border: none;
  color: #eee;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}
.control-btn:hover {
  color: var(--gold-primary, #ffd700);
  transform: scale(1.1);
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.time-display {
  font-family: "Outfit", monospace;
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  min-width: 100px;
}

/* Volume Slider */
.volume-container {
  display: flex;
  align-items: center;
  gap: 10px;
}
.volume-slider-container {
  width: 0;
  overflow: hidden;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
}
.volume-container:hover .volume-slider-container {
  width: 100px;
}
#volume-slider {
  width: 100%;
  height: 5px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  accent-color: var(--gold-primary, #ffd700);
}
