/* ===================================================
   EL GENERAL LEGACY — STYLES
   =================================================== */

/* --- TOKENS --- */
:root {
  --gold: #efba43;
  --white: #ffffff;
  --black: #000000;
  --presave-bg: rgba(63, 63, 63, 0.15);
  --font-display: 'Bebas Neue', cursive;
  --font-body: 'Poppins', sans-serif;
  --header-h: 100px;
}

/* --- RESET --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-body);
  overflow: hidden;
  /* No scroll — todo en 1 pantalla */
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

/* --- ANIMATIONS --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes colorize {
  from {
    filter: grayscale(100%);
  }

  to {
    filter: grayscale(0%);
  }
}

@keyframes popupEnter {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp 0.7s ease forwards;
}

.fade-in-delay {
  animation-delay: 0.3s;
}

/* ===================================================
   HEADER
   =================================================== */
#header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 40px;
  height: var(--header-h);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.75) 0%, transparent 100%);
}

.header-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

#logo {
  height: 72px;
  width: auto;
  animation: fadeIn 1s ease forwards;
}

.header-social,
.header-music {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.header-social {
  align-items: flex-start;
}

.header-music {
  align-items: flex-end;
}

.header-social-icons,
.header-music-icons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  align-items: center;
}

.header-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.5px;
}

.social-icon img {
  width: 34px;
  height: 34px;
  transition: transform 0.2s, opacity 0.2s;
}

.social-icon:hover img {
  transform: scale(1.15);
  opacity: 0.8;
}

/* Mobile buttons */
.mobile-btn {
  display: none;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 10px;
  padding: 10px;
  cursor: pointer;
  z-index: 200;
  transition: background 0.2s;
}

.mobile-btn img {
  width: 26px;
  height: 26px;
}

.mobile-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Mobile panels */
.mobile-panel {
  display: none;
  position: absolute;
  top: 50%;
  flex-direction: row;
  gap: 10px;
  align-items: center;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.panel-left {
  left: 70px;
  transform: translateY(-50%) translateX(-10px);
}

.panel-right {
  right: 70px;
  transform: translateY(-50%) translateX(10px);
}

.mobile-panel.open {
  opacity: 1;
  pointer-events: all;
}

.panel-left.open {
  transform: translateY(-50%) translateX(0);
}

.panel-right.open {
  transform: translateY(-50%) translateX(0);
}

/* ===================================================
   MAIN — ocupa el espacio bajo el header, sin scroll
   =================================================== */
#home {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--header-h));
  margin-top: var(--header-h);
  display: flex;
  align-items: center;
  overflow: hidden;
}

/* ── Imagen de fondo El General ── */
.general-img-wrap {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 62%;
  /* contenedor de la zona izquierda */
  height: 100%;
  pointer-events: none;
  z-index: 0;
  animation: fadeIn 1.2s ease 0.2s both;
}

#general-img {
  position: absolute;
  bottom: 0;
  left: 10%;
  /* desplazamiento visual en desktop */
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom left;
  animation: colorize 5s ease 0.5s forwards;
  filter: grayscale(100%);
}

/* Degradado lateral para fundir la imagen con el fondo negro */
.general-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right,
      transparent 45%,
      rgba(0, 0, 0, 0.5) 70%,
      rgba(0, 0, 0, 0.92) 90%,
      #000 100%);
  z-index: 1;
}

/* Degradado inferior */
.general-img-wrap::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 12%;
  background: linear-gradient(to top, #000 0%, transparent 100%);
  z-index: 2;
}

/* ── Contenido derecho ── */
.content-wrap {
  position: relative;
  z-index: 2;
  margin-left: auto;
  width: 60%;
  /* 60% del ancho de la pantalla */
  max-width: 780px;
  padding: 2vh 5vw 2vh 2vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(10px, 1.8vh, 24px);
  height: 100%;
  overflow: hidden;
}

/* ── BOX COUNTDOWN ── */
.subtitle-gold {
  font-family: var(--font-body);
  font-size: clamp(11px, 1.4vh, 16px);
  color: var(--gold);
  letter-spacing: 0.5px;
  margin-bottom: 0;
}

.title-main {
  font-family: var(--font-display);
  font-size: clamp(32px, 7vh, 88px);
  color: var(--white);
  line-height: 0.92;
  margin-bottom: clamp(8px, 1.5vh, 20px);
  letter-spacing: 1px;
}

.countdown {
  display: flex;
  gap: clamp(8px, 1.2vw, 16px);
  flex-wrap: nowrap;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(4px, 0.6vh, 8px);
}

.countdown-btn {
  width: clamp(52px, 8vh, 90px);
  height: clamp(52px, 8vh, 90px);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.countdown-num {
  font-family: var(--font-display);
  font-size: clamp(20px, 4vh, 44px);
  color: var(--gold);
  line-height: 1;
}

.countdown-label {
  font-family: var(--font-body);
  font-size: clamp(10px, 1.2vh, 14px);
  font-weight: 600;
  color: var(--white);
  letter-spacing: 2px;
}

/* ── BOX PRE-SAVE ── */
.box-presave {
  background: var(--presave-bg);
  border-radius: 14px;
  padding: clamp(10px, 1.6vh, 22px) clamp(14px, 2vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(6px);
}

.presave-header {
  margin-bottom: clamp(6px, 1vh, 16px);
}

.presave-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 5vh, 54px);
  color: var(--white);
  line-height: 1;
}

.presave-sub {
  font-size: clamp(10px, 1.2vh, 14px);
  color: var(--gold);
  line-height: 1.4;
  margin-top: 2px;
}

.presave-list {
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.9vh, 12px);
}

.presave-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.presave-logo {
  height: clamp(20px, 3vh, 34px);
  width: auto;
  max-width: 150px;
  object-fit: contain;
  flex-shrink: 0;
}

.presave-btn {
  display: inline-block;
  padding: clamp(6px, 0.9vh, 10px) clamp(12px, 1.5vw, 22px);
  border: 1px solid var(--white);
  border-radius: 10px;
  background: linear-gradient(135deg, #121212, #1a1a1a);
  color: var(--white);
  font-family: var(--font-body);
  font-size: clamp(9px, 1vh, 12px);
  font-weight: 600;
  letter-spacing: 1.5px;
  white-space: nowrap;
  transition: background 0.25s, transform 0.15s, border-color 0.25s, color 0.25s;
  flex-shrink: 0;
}

.presave-btn:hover {
  background: linear-gradient(135deg, #1e1e1e, #2a2a2a);
  border-color: var(--gold);
  color: var(--gold);
  transform: translateY(-1px);
}

/* ===================================================
   POPUP
   =================================================== */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
  padding: 20px;
}

.popup-overlay[hidden] {
  display: none;
}

.popup-box {
  position: relative;
  width: 70%;
  max-width: 860px;
  max-height: 88vh;
  background: rgba(8, 8, 8, 0.97);
  border-radius: 20px;
  border: 1px solid rgba(239, 186, 67, 0.25);
  padding: 36px 36px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  overflow: auto;
  animation: popupEnter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.popup-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: transform 0.2s, opacity 0.2s;
}

.popup-close:hover {
  transform: scale(1.2);
  opacity: 0.8;
}

.popup-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 3.5vw, 44px);
  color: var(--white);
  text-align: center;
  line-height: 1;
}

.popup-subtitle {
  font-family: var(--font-display);
  font-size: clamp(16px, 2vw, 28px);
  color: var(--gold);
  text-align: center;
  letter-spacing: 2px;
}

.popup-video-wrap {
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  margin-top: 8px;
}

#popup-video {
  width: 100%;
  display: block;
  border-radius: 12px;
  max-height: 58vh;
  object-fit: contain;
  background: #000;
}

/* Botón para activar sonido */
.unmute-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 8px 20px;
  background: rgba(239, 186, 67, 0.12);
  border: 1px solid var(--gold);
  border-radius: 30px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  animation: fadeIn 0.5s ease 0.4s both;
}

.unmute-btn:hover {
  background: rgba(239, 186, 67, 0.22);
  transform: scale(1.04);
}

.unmute-btn svg {
  width: 18px;
  height: 18px;
  fill: var(--gold);
}

.unmute-btn.hidden {
  display: none;
}

/* ===================================================
   RESPONSIVE — Mobile (≤768px)
   =================================================== */
@media (max-width: 768px) {
  :root {
    --header-h: 72px;
  }

  html,
  body {
    overflow: hidden;
  }

  /* Header */
  #header {
    padding: 10px 14px;
  }

  #logo {
    height: 48px;
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-panel {
    display: flex;
  }

  /* Main: columna, mismo cálculo de altura */
  #home {
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: calc(100vh - var(--header-h));
  }

  /* Imagen de fondo — ocupa toda la pantalla en vertical */
  .general-img-wrap {
    position: absolute;
    width: 100%;
    height: 100%;
    /* full height del home */
    bottom: 0;
    left: 0;
  }

  #general-img {
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* cubre todo el fondo */
    object-position: center top;
    /* enfoca la parte superior (cara del jugador) */
  }

  /* Degradado: negro arriba para leer el texto, transparente abajo */
  .general-img-wrap::after {
    background: linear-gradient(to bottom,
        rgba(0, 0, 0, 0.85) 0%,
        rgba(0, 0, 0, 0.55) 35%,
        rgba(0, 0, 0, 0.15) 65%,
        transparent 100%);
  }

  /* Contenido: arriba, sin padding extra de header */
  .content-wrap {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-left: 0;
    padding: 20px 20px 20px;
    align-items: center;
    text-align: center;
    justify-content: flex-start;
    height: 100%;
    gap: 12px;
  }

  .subtitle-gold {
    text-align: center;
  }

  .title-main {
    text-align: center;
    font-size: clamp(36px, 11vw, 56px);
    margin-bottom: 10px;
  }

  .countdown {
    justify-content: center;
    gap: 8px;
  }

  .countdown-btn {
    width: 64px;
    height: 64px;
  }

  .countdown-num {
    font-size: 26px;
  }

  .box-presave {
    padding: 14px 16px;
    backdrop-filter: blur(2px);
    margin-top: 40px;
  }

  .presave-title {
    font-size: clamp(26px, 8vw, 40px);
  }

  .presave-sub {
    font-size: 11px;
  }

  .presave-logo {
    height: 24px;
  }

  .presave-btn {
    padding: 7px 14px;
    font-size: 10px;
  }

  /* Popup mobile */
  .popup-box {
    width: 94%;
    padding: 28px 16px 20px;
  }
}