* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  cursor: none !important;
  /* Hide system cursor globally */
}

html {
  color-scheme: dark;
}

/* Custom Text Selection (Premium Gold) */
::selection {
  background: #d4af37;
  color: #000;
}

::-moz-selection {
  background: #d4af37;
  color: #000;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at bottom right, #6a0f0f, #000 60%);
  color: #fff;
  overflow-x: hidden;
  /* cursor rule removed */
}

canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 0, 0, .9);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 50px;
  z-index: 3002;
  box-shadow: 0 2px 8px rgba(255, 255, 255, .05)
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px
}

.logo img {
  width: 40px;
  height: 40px;
  border-radius: 50%
}

.logo span {
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  align-items: center
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: rgba(0, 0, 0, .95);
  padding: 10px 0;
  border-radius: 8px;
  min-width: 200px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .5);
  z-index: 25
}

nav ul li {
  position: relative
}

.submenu li {
  padding: 5px 20px
}

.submenu li a {
  display: block;
  color: #fff;
  padding: 8px 10px;
  transition: all .3s ease;
  white-space: nowrap;
}

.submenu li a:hover {
  background: rgba(65, 11, 11, 0.8);
  color: #fff;
  border-radius: 5px;
  transform: translateX(3px);
}

nav ul li a {
  color: #fff;
  text-decoration: none;
  font-weight: 500;
  position: relative;
  padding: 5px;
  transition: .3s
}

nav ul li a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: #ff3c3c;
  transition: width .3s
}

/* Hover effects only for mouse devices */
@media (hover: hover) {
  nav ul li a:hover {
    color: #ff3c3c
  }

  nav ul li a:hover::after {
    width: 100%
  }
}

/* Keep parent red AND underlined when submenu is open on touch */
nav ul li.touch-open>a {
  color: #ff3c3c;
}

nav ul li.touch-open>a::after {
  width: 100%;
}

/* Only use CSS hover on devices that support it to prevent "sticky" hover on touch */
@media (hover: hover) {
  nav ul li:hover .submenu {
    display: block;
  }
}

/* Class-based toggle for touch/click */
nav ul li.touch-open .submenu {
  display: block;
}

/* Active Page Style */
nav ul li a.active-page {
  color: #d4af37 !important;
  font-weight: 700;
}

nav ul li a.active-page::after {
  width: 100%;
  background: #ff3c3c;
}

main {
  flex: 1;
  padding: 130px 40px 80px;
  max-width: 1200px;
  margin: auto;
  position: relative;
  z-index: 5
}

h2 {
  color: #d4af37;
  text-align: center;
  margin-bottom: 10px;
  font-size: 2rem
}

h3 {
  color: #ff3c3c;
  text-align: center;
  margin-bottom: 30px
}

.casting-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  margin-bottom: 80px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 0 20px rgba(212, 175, 55, .2)
}

.casting-block iframe {
  width: 100%;
  height: 450px;
  border: none;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(212, 175, 55, .2)
}

.casting-info {
  line-height: 1.8;
  font-size: 1rem;
  color: #ccc
}

.casting-info strong {
  color: #ff3c3c
}

.casting-info a {
  color: #d4af37;
  text-decoration: none;
  font-weight: 700
}

.casting-info a:hover {
  color: #fff;
  text-decoration: underline
}

.social-links {
  position: fixed;
  bottom: 30px;
  left: 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  z-index: 100
}

.social-links a {
  width: 45px;
  height: 45px;
  background: rgba(255, 255, 255, .15);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 22px;
  transition: all .3s;
  backdrop-filter: blur(5px)
}

.social-links a:hover {
  background: linear-gradient(135deg, #d4af37, #ffecb3);
  color: #000;
  transform: scale(1.1);
  box-shadow: 0 0 15px #d4af37, 0 0 30px #ffecb3
}

footer {
  text-align: center;
  padding: 25px 10px;
  color: #d4af37;
  font-size: .95rem;
  width: 100%;
  margin-top: auto;
  z-index: 5;
}

@media (max-width:900px) {
  .casting-block {
    grid-template-columns: 1fr;
    text-align: center
  }

  .casting-block iframe {
    height: 350px
  }
}

/* EFECTO DE SELECCIÓN MÁGICA */
::selection {
  background: rgba(106, 15, 15, 0.8);
  color: #ffffff;
  text-shadow: 0 0 5px #d4af37, 0 0 10px #d4af37, 0 0 20px #ffecb3;
}

::-moz-selection {
  background: rgba(106, 15, 15, 0.8);
  color: #ffffff;
  text-shadow: 0 0 5px #d4af37, 0 0 10px #d4af37;
}

/* Estilo de la partícula mágica */
.magic-star {
  position: fixed;
  pointer-events: none;
  background: #d4af37;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  box-shadow: 0 0 10px #ffecb3;
  animation: fadeOut 1s linear forwards;
  z-index: 9999;
}

@keyframes fadeOut {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  100% {
    opacity: 0;
    transform: scale(0) translateY(20px);
  }
}


/* Important: Override nav display for mobile and Tablet Portrait */
@media (max-width: 900px),
(max-width: 1025px) and (orientation: portrait) {
  nav {
    display: none;
    /* Hide default nav */
  }

  

  .logo img {
    width: 35px;
    height: 35px
  }

  .logo span {
    font-size: 1.1rem
  }

  header {
    padding: 15px 20px;
    z-index: 3002;
    /* Ensure header is above menu */
  }
}


/* Submenu item active style */


/* --- Landscape Mode Optimization (Phones) --- */
@media (max-width: 900px) and (orientation: landscape) {
  

  

  .logo img {
    width: 30px;
    height: 30px;
  }

  header {
    padding: 5px 20px;
    /* Header más delgado */
  }
}

/* --- Tablet/Desktop Landscape Optimization (iPad and similar) --- */
@media (min-width: 901px) and (max-width: 1366px) and (orientation: landscape) {
  main {
    padding-top: 90px;
    /* Reduce top padding from 130px */
    padding-bottom: 40px;
    max-width: 95%;
  }

  h2 {
    font-size: 1.6rem;
    margin-bottom: 15px;
  }

  h3 {
    font-size: 1.1rem;
    margin-bottom: 20px;
  }

  .casting-block {
    gap: 20px;
    padding: 20px;
    margin-bottom: 40px;
  }

  .casting-block iframe {
    height: 350px;
    /* Reduce iframe height */
  }

  .casting-info {
    font-size: 0.95rem;
    line-height: 1.6;
  }

  /* Adjust social links to not float awkwardly mid-screen */
  .social-links {
    left: 15px;
    bottom: 15px;
    /* Tucked closer to corner */
    gap: 10px;
  }

  .social-links a {
    width: 35px;
    height: 35px;
    font-size: 18px;
  }

  /* Fix Menu Wrapping on Tablet Landscape */
  header {
    padding: 5px 10px;
    /* Minimal side padding */
  }

  .logo {
    white-space: nowrap;
    /* Prevent "Starmark Producciones" from breaking */
    margin-right: auto;
    /* Push menu to right but allow shrink */
  }

  .logo span {
    font-size: 1rem;
    /* Smaller logo text (was 1.1rem) */
  }

  nav ul {
    gap: 8px;
    /* Very tight gap (was 15px) */
  }

  nav ul li a {
    white-space: nowrap;
    /* Prevent "Cartelera ▾" from breaking */
    font-size: 0.8rem;
    /* Smaller menu text (was 0.9rem) */
    padding: 5px 5px;
    /* Minimal padding */
  }
}

/* Custom Animated Cursor */
.custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.1s linear;
}

.custom-cursor svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 5px rgba(212, 175, 55, 0.8));
}

/* Estilo de la partícula mágica */
.magic-star {
  position: fixed;
  pointer-events: none;
  background: #d4af37;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  box-shadow: 0 0 10px #ffecb3;
  animation: fadeOutMagic 1s linear forwards;
  z-index: 9999;
}

@keyframes fadeOutMagic {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }

  100% {
    opacity: 0;
    transform: scale(0) translateY(20px);
  }
}

/* Ocultar el cursor personalizado VIRTUAL enteramente en móviles */
@media (pointer: coarse) {
  .custom-cursor {
    display: none !important;
  }
}


/* FORMULARIO CERRADO OVERLAY PREMIUM */
.iframe-wrapper.closed {
  position: relative;
  width: 100%;
  height: 450px;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 0 1px rgba(212, 175, 55, 0.2);
}

.iframe-wrapper.closed::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), rgba(106, 15, 15, 0.1));
  z-index: 1;
  pointer-events: none;
}

.iframe-wrapper.closed iframe {
  width: 100%;
  height: 100%;
  border: none;
  filter: blur(12px) grayscale(50%) brightness(0.4);
  pointer-events: none;
  user-select: none;
  transform: scale(1.05); /* hide blurred edges */
}

.overlay-glass {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5;
  background: rgba(0, 0, 0, 0.3);
}

.glass-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  background: rgba(15, 5, 5, 0.7);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 30px 50px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.3);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(212, 175, 55, 0.1);
  animation: floatBadge 4s ease-in-out infinite;
}

.glass-badge i {
  font-size: 2.5rem;
  color: #ff3c3c;
  filter: drop-shadow(0 0 10px rgba(255, 60, 60, 0.6));
}

.glass-badge span {
  font-family: 'Cinzel', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: #d4af37;
  text-transform: uppercase;
  letter-spacing: 4px;
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
  text-align: center;
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@media (max-width: 900px) {
  .iframe-wrapper.closed {
    height: 350px;
  }
  .glass-badge {
    padding: 20px 30px;
    gap: 10px;
  }
  .glass-badge i {
    font-size: 2rem;
  }
  .glass-badge span {
    font-size: 1.2rem;
    letter-spacing: 2px;
  }
}