:root {
  --ocean-deep: #0f0f10;
  --ocean-blue: #1e3a8a;
  --parchment-base: #f0e6d2;
  --stain-yellow: rgba(214, 180, 56, 0.3);
  --stain-brown: rgba(101, 67, 33, 0.4);
  --burn-edge: rgba(60, 30, 10, 0.8);
  --wood-dark: #2c1810;
  --gold-pirate: #fbbf24;
}

body {
  background-color: var(--ocean-deep);
  font-family: "Roboto Slab", serif;
  overflow-x: hidden;
  color: var(--wood-dark);
  margin: 0;
  padding: 0;
  cursor: default;
  /* Evitar rebote en iOS al hacer swipe */
  overscroll-behavior: none;
}

h1,
h2,
h3,
.pirate-font {
  font-family: "Pirata One", cursive;
  letter-spacing: 1px;
}
.wanted-font {
  font-family: "Rye", serif;
  letter-spacing: 4px;
}

/* --- ESTILOS PARA LIGHTBOX Y ROTACIÓN INTELIGENTE --- */
.rotate-mobile {
  transform: rotate(90deg);
  width: 100vh !important;
  height: 100vw !important;
  max-width: 100vh !important;
  max-height: 100vw !important;
  object-fit: contain;
}

.pointer-events-auto {
  pointer-events: auto;
}

#lightbox-modal {
  transition:
    opacity 0.3s ease-in-out,
    visibility 0.3s;
}

/* Ocultar flechas SOLO en móvil para priorizar Swipe */
@media (max-width: 768px) {
  #btn-prev,
  #btn-next {
    display: none !important;
  }
}

/* --- GHOST DOT ANIMATION --- */
.ghost-dot {
  width: 20px;
  height: 20px;
  background: radial-gradient(
    circle,
    rgba(251, 191, 36, 1) 0%,
    rgba(251, 191, 36, 0) 70%
  );
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(251, 191, 36, 0.8);
  animation: swipeGesture 2.5s infinite ease-in-out;
  opacity: 0.8;
}

@keyframes swipeGesture {
  0% {
    transform: translate(0, 0);
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  40% {
    transform: translate(40px, 0);
    opacity: 0;
  } /* Swipe Horizontal */
  50% {
    transform: translate(0, 0);
    opacity: 0;
  }
  65% {
    opacity: 1;
  }
  90% {
    transform: translate(0, -40px);
    opacity: 0;
  } /* Swipe Vertical */
  100% {
    opacity: 0;
  }
}

/* --- INTRO SCREEN (TIMÓN) --- */
#intro-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: radial-gradient(circle at center, #1a237e 0%, #000000 100%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition:
    opacity 1.5s ease-in-out,
    visibility 1.5s;
}
.helm-container {
  position: relative;
  width: 280px;
  height: 280px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}
.helm-container:hover {
  transform: scale(1.05);
}
.helm-container:hover .helm-wrapper {
  transform: rotate(15deg);
}
.helm-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 1;
}
.helm-outer-ring {
  position: absolute;
  width: 200px;
  height: 200px;
  border: 18px solid #92400e;
  border-radius: 50%;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
  background: radial-gradient(circle, #5c2b05 20%, transparent 60%);
  z-index: 2;
}
.helm-spoke {
  position: absolute;
  width: 18px;
  height: 280px;
  background: #92400e;
  border-radius: 4px;
  z-index: 1;
}
.spoke-1 {
  transform: rotate(0deg);
}
.spoke-2 {
  transform: rotate(45deg);
}
.spoke-3 {
  transform: rotate(90deg);
}
.spoke-4 {
  transform: rotate(135deg);
}

#helm-image {
  position: relative;
  z-index: 20;
  width: 140px;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.6));
}
.intro-text {
  margin-top: 3rem;
  color: #fbbf24;
  font-size: 1.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 2px 2px 0px #000;
  animation: bounceText 2s infinite;
}
@keyframes bounceText {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}
.ship-depart-wheel {
  animation: spinAndScale 1.5s forwards cubic-bezier(0.4, 0, 0.2, 1);
}
.ship-depart-image {
  animation: scaleOnly 1.5s forwards cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes spinAndScale {
  0% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: scale(8) rotate(720deg);
    opacity: 0;
  }
}
@keyframes scaleOnly {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  100% {
    transform: scale(8);
    opacity: 0;
  }
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content-hidden {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease-in;
}
.reveal-content {
  opacity: 1;
  pointer-events: auto;
}
.background-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -5;
  background-color: #1a1a2e;
  background-image: url("https://www.transparenttextures.com/patterns/nautical-leather.png");
  opacity: 0.8;
}

/* --- PARTÍCULAS --- */
.particle-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
  overflow: hidden;
}

.berry-coin {
  position: absolute;
  width: 30px;
  height: 30px;
  background: radial-gradient(circle at 30% 30%, #ffd700, #b8860b);
  border: 2px solid #8b4513;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Rye", serif;
  font-size: 16px;
  font-weight: bold;
  color: #5c3a10;
}
.berry-coin::after {
  content: "B";
}

.devil-fruit-particle {
  position: absolute;
  width: 45px;
  height: 45px;
  background-image: url("img/gomu.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 5px rgba(128, 0, 128, 0.4));
}

@keyframes fallAndSpin {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    transform: translateY(110vh) rotate(360deg);
    opacity: 0;
  }
}

/* --- WANTED POSTER --- */
.wanted-poster {
  position: relative;
  width: 90%;
  max-width: 420px;
  margin: 0 auto;
  padding: 30px 20px 50px 20px;
  background-color: var(--parchment-base);
  background-image:
    url("https://www.transparenttextures.com/patterns/aged-paper.png"),
    radial-gradient(circle at center, var(--stain-yellow) 10%, transparent 60%),
    radial-gradient(circle at 10% 10%, var(--stain-brown) 0%, transparent 20%),
    linear-gradient(to bottom, transparent 80%, rgba(60, 30, 10, 0.2) 100%);
  box-shadow:
    inset 0 0 40px var(--stain-brown),
    inset 0 0 10px var(--burn-edge),
    0 20px 40px rgba(0, 0, 0, 0.8);
  clip-path: polygon(
    2% 0%,
    98% 1%,
    100% 98%,
    95% 100%,
    90% 99%,
    85% 100%,
    15% 100%,
    10% 99%,
    5% 100%,
    0% 98%
  );
  transition:
    max-width 0.3s ease,
    padding 0.3s ease;
}

@media (min-width: 768px) {
  .wanted-poster {
    max-width: 650px;
    padding: 30px 15px 50px 15px;
  }
}

.wanted-header-text {
  font-family: "Rye", serif;
  color: #3e2723;
  line-height: 0.8;
  text-align: center;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
  transform: scaleY(1.3);
  letter-spacing: 2px;
  font-size: clamp(3rem, 13vw, 5.5rem);
  width: 100%;
  white-space: nowrap;
}

.photo-frame {
  background: #2c1810;
  padding: 4px;
  margin-bottom: 12px;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, 0.4);
}
.poster-image-container {
  width: 100%;
  aspect-ratio: 1 / 0.75;
  overflow: hidden;
  position: relative;
  background: #d4c5a9;
}
.toon-filter {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(1.1) sepia(0.3) brightness(1.05) saturate(1.1);
}

.wanted-name {
  font-family: "Rye", serif;
  font-size: clamp(2rem, 11vw, 3.5rem);
  color: #3e2723;
  text-align: center;
  text-transform: uppercase;
  line-height: 0.9;
  margin: 15px 0 10px 0;
  white-space: nowrap;
  width: 100%;
}
.separator-line {
  width: 90%;
  height: 2px;
  background: #3e2723;
  margin: 5px auto;
  opacity: 0.8;
}
.wanted-bounty {
  font-family: "Rye", serif;
  font-size: clamp(1.2rem, 6vw, 2.2rem);
  color: #3e2723;
  display: flex;
  align-items: baseline;
  justify-content: center;
  margin-top: 5px;
  width: 100%;
  white-space: nowrap;
}
.wanted-bounty span {
  font-size: 0.6em;
  margin-right: 8px;
  font-weight: bold;
}

.marine-text {
  text-align: center;
  font-family: "Rye", serif;
  font-size: 2rem;
  color: #3e2723;
  opacity: 0.9;
  margin-top: 30px;
  letter-spacing: 6px;
  font-weight: bold;
  transform: scaleY(1.2);
}
.pirate-btn {
  background: linear-gradient(to bottom, #7f1d1d, #450a0a);
  border: 2px solid #d4af37;
  color: #fff;
  font-family: "Pirata One", cursive;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4);
  text-shadow: 1px 1px 0 #000;
}

.music-float {
  animation: floatIcon 3s ease-in-out infinite;
}
@keyframes floatIcon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

.paper-counter {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid #8b4513;
  border-radius: 4px;
}

::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: #0f0f10;
}
::-webkit-scrollbar-thumb {
  background: #92400e;
  border-radius: 4px;
}
