:root {
  --primary-color: #ffa500;
  --accent-color: #ffd700;
  --bg-dark: #0d070d;
  --card-bg: #222222;
  --header-bg: rgba(34, 34, 34, 0.85);
  --border-radius: 8px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  background-color: var(--bg-dark);
  background-image: url('img/fondo.webp');
  background-repeat: repeat;
  background-size: 150px 150px;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: Arial, sans-serif;
  color: white;
  user-select: none;
  -webkit-user-select: none;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-x: hidden;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 48px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  background-color: var(--header-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--primary-color);
  padding: 0 20px;
  z-index: 1000;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

header.hidden {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}

.logo-container img {
  height: 32px;
  width: auto;
  cursor: pointer;
  -webkit-user-drag: none;
  transition: transform 0.2s ease;
}

.logo-container img:hover {
  transform: scale(1.05);
}

.logo-container { justify-self: start; }

.title {
  min-width: 0;
  justify-self: center;
  text-align: center;
  font-size: 16px;
  color: var(--primary-color);
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
  padding: 0 10px;
}

.gravatar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
}

.gravatar-link img {
  display: block;
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  -webkit-user-drag: none;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gravatar-link:hover img {
  transform: scale(1.08);
  border-color: var(--primary-color);
}

main {
  margin-top: 68px;
  margin-bottom: 40px;
  width: 100%;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

.slider-container {
  position: relative;
  width: 50vw;
  max-width: 800px;
  aspect-ratio: 16/9;
  overflow: hidden;
  border: 2px solid var(--primary-color);
  background-color: var(--card-bg);
  margin: 0 auto;
  z-index: 1;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.slider-images {
  position: relative;
  width: 100%;
  height: 100%;
}

.slider-images img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  display: none;
  transform: translateX(0);
  -webkit-user-drag: none;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.arrow:hover {
  background-color: rgba(255, 165, 0, 0.8);
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

.arrow.left { left: 10px; }
.arrow.right { right: 10px; }

.dots-container {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.dot.active {
  background-color: var(--primary-color);
  transform: scale(1.2);
}

.download-tabs {
  position: relative;
  width: 70vw;
  max-width: 800px;
  margin-top: 20px;
  background-color: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  color: var(--accent-color);
  font-size: 18px;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.tab-buttons {
  display: flex;
  background: #333333;
  border-bottom: 2px solid var(--primary-color);
  position: relative;
  z-index: 2;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.tab-buttons::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.tab-buttons button {
  flex: 1;
  background: #333333;
  border: none;
  padding: 12px 16px;
  color: #dddddd;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
  position: relative;
  z-index: 2;
  white-space: nowrap;
}

.tab-buttons button:not(:last-child) {
  border-right: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-buttons button:hover {
  background: #444444;
  color: #ffffff;
}

.tab-buttons button.active {
  background: var(--card-bg);
  color: var(--primary-color);
  z-index: 3;
}

.tab-content-container {
  background: var(--card-bg);
  padding: 16px;
  display: none;
  z-index: 1;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content-container.active {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.download-button {
  background-color: var(--accent-color);
  border: none;
  padding: 10px 18px;
  font-size: 14px;
  cursor: pointer;
  border-radius: 6px;
  color: #000000;
  font-weight: bold;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  white-space: normal;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.download-button:hover {
  background-color: #ffe033;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(255, 215, 0, 0.4);
}

.youtube-container {
  position: relative;
  width: 70vw;
  max-width: 800px;
  margin-top: 20px;
  background-color: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.youtube-facade {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  padding: 0;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  background: #000000;
  cursor: pointer;
}

.youtube-facade img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease;
}

.youtube-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 68px;
  height: 48px;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
  transition: transform 0.2s ease;
}

.youtube-play svg { display: block; width: 100%; height: 100%; }

.youtube-facade:hover img { filter: brightness(1.1); }
.youtube-facade:hover .youtube-play { transform: translate(-50%, -50%) scale(1.1); }
.youtube-facade:focus-visible { outline: 3px solid var(--primary-color); outline-offset: 2px; }

.youtube-embed {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 4px;
}

.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease;
}

.fullscreen-container {
  position: relative;
  width: min(90vw, calc(90vh * 16/9));
  aspect-ratio: 16/9;
  max-width: 1000px;
  border: 3px solid var(--primary-color);
  overflow: hidden;
  background: #000000;
  border-radius: var(--border-radius);
  box-shadow: 0 0 25px rgba(255, 165, 0, 0.3);
}

.fullscreen-slider {
  position: relative;
  width: 100%;
  height: 100%;
}

.fullscreen-slider img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
  cursor: pointer;
  transform: translateX(0);
  -webkit-user-drag: none;
}

.fullscreen-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  cursor: pointer;
  z-index: 2;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.fullscreen-arrow:hover {
  background-color: rgba(255, 165, 0, 0.8);
  color: #000;
  transform: translateY(-50%) scale(1.1);
}

.fullscreen-arrow.left { left: 12px; }
.fullscreen-arrow.right { right: 12px; }

.close-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  font-size: 20px;
  color: white;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  border-radius: 50%;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.close-icon:hover {
  background-color: rgba(255, 0, 0, 0.8);
  transform: scale(1.1);
}

/* ================= KO-FI ================= */
:root { --kofi: #ff5e5b; --kofi-dark: #e0403d; }

.kofi-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 14px;
  padding: 6px 12px;
  background: var(--kofi);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(255, 94, 91, 0.4);
  transition: transform 0.2s ease, background 0.2s ease;
}
.kofi-header-btn:hover { background: var(--kofi-dark); transform: translateY(-1px) scale(1.04); }
.kofi-header-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.header-right { display: flex; align-items: center; justify-self: end; }
#langCurrent { display: inline-block; width: 22px; text-align: center; }

.donate-card {
  position: relative;
  width: 70vw;
  max-width: 800px;
  margin-top: 20px;
  padding: 28px 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 94, 91, 0.18), transparent 65%),
    var(--card-bg);
  border: 2px solid var(--kofi);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), 0 0 25px rgba(255, 94, 91, 0.15);
  overflow: hidden;
}

.donate-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--kofi);
  border-radius: 50%;
  animation: kofiFloat 3s ease-in-out infinite;
  box-shadow: 0 0 0 0 rgba(255, 94, 91, 0.6);
}
.donate-icon svg { width: 36px; height: 36px; }

.donate-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--accent-color);
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.donate-card p {
  margin: 0 auto 18px;
  max-width: 560px;
  font-size: 15px;
  line-height: 1.55;
  color: #dddddd;
}

.donate-perks {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}
.donate-perks li {
  padding: 5px 12px;
  font-size: 12px;
  color: #ffb3b1;
  background: rgba(255, 94, 91, 0.12);
  border: 1px solid rgba(255, 94, 91, 0.35);
  border-radius: 20px;
}

.kofi-main-btn {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 30px;
  font-size: 17px;
  font-weight: bold;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #ff7875, var(--kofi));
  border-radius: 50px;
  /* Borde inferior sólido (efecto botón físico) + sombra suave, sin resplandor de color */
  box-shadow: 0 3px 0 var(--kofi-dark), 0 6px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.kofi-main-btn svg { width: 24px; height: 24px; }

/* Destello diagonal que cruza el botón de vez en cuando (queda dentro del botón) */
.kofi-main-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: kofiShine 4.5s ease-in-out infinite;
  pointer-events: none;
}

.kofi-main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 var(--kofi-dark), 0 10px 16px rgba(0, 0, 0, 0.35);
  filter: brightness(1.06);
}
.kofi-main-btn:hover svg { animation: kofiWiggle 0.6s ease; }

.kofi-main-btn:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--kofi-dark), 0 2px 6px rgba(0, 0, 0, 0.35);
}

.donate-card .donate-thanks {
  margin: 32px auto 0;
  font-size: 13px;
  color: #aaa;
  text-wrap: balance;
}

.kofi-toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 140%);
  width: min(92vw, 440px);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(34, 34, 34, 0.97);
  border: 2px solid var(--kofi);
  border-radius: 12px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.7);
  z-index: 1500;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.45s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.45s ease, visibility 0s linear 0.45s;
}
.kofi-toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
.kofi-toast-text { flex: 1; font-size: 13px; line-height: 1.4; color: #eee; }
.kofi-toast-text strong { color: var(--accent-color); }
.kofi-toast a {
  padding: 8px 14px;
  background: var(--kofi);
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 20px;
  white-space: nowrap;
}
.kofi-toast a:hover { background: var(--kofi-dark); }
.kofi-toast-close {
  background: none;
  border: none;
  color: #aaa;
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
}
.kofi-toast-close:hover { color: #fff; }

/* ================= SELECTOR DE IDIOMA ================= */
.lang-dropdown { position: relative; margin-right: 12px; }

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: #333333;
  color: var(--primary-color);
  font-size: 13px;
  font-weight: bold;
  font-family: inherit;
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.lang-btn:hover, .lang-dropdown.open .lang-btn { background: var(--primary-color); color: #000; }
.lang-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.lang-caret { font-size: 10px; transition: transform 0.2s ease; }
.lang-dropdown.open .lang-caret { transform: rotate(180deg); }

.lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 140px;
  margin: 0;
  padding: 4px;
  display: none;
  flex-direction: column;
  gap: 2px;
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: var(--border-radius);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
  z-index: 1100;
}
.lang-dropdown.open .lang-menu { display: flex; animation: fadeIn 0.2s ease; }

.lang-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  background: none;
  border: none;
  border-radius: 5px;
  color: #dddddd;
  font-size: 14px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.lang-option:hover { background: #444444; color: #fff; }
.lang-option[aria-selected="true"] { color: var(--primary-color); font-weight: bold; }
.lang-option[aria-selected="true"]::after { content: "\2713"; }

@keyframes kofiFloat {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-5px) rotate(4deg); }
}
@keyframes kofiShine {
  0%, 55% { transform: translateX(0) skewX(-20deg); }
  100% { transform: translateX(410%) skewX(-20deg); }
}
@keyframes kofiWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-14deg); }
  75% { transform: rotate(14deg); }
}
@media (prefers-reduced-motion: reduce) {
  .donate-icon, .kofi-main-btn::before, .kofi-main-btn:hover svg { animation: none; }
}

@media (max-width: 768px), (max-aspect-ratio: 3/4) {
  .slider-container, .download-tabs, .youtube-container, .donate-card {
    width: 92vw;
  }
  .kofi-header-btn { margin-right: 8px; padding: 6px 9px; }
  .kofi-header-btn span { display: none; }
  .lang-dropdown { margin-right: 8px; }
  .lang-btn { padding: 6px 8px; }
  .kofi-main-btn { width: 100%; padding: 14px 16px; font-size: 16px; }
  .donate-card h2 { font-size: 19px; }
  header {
    height: 48px;
    padding: 0 12px;
    grid-template-columns: auto 1fr auto;
  }
  .title {
    font-size: 12px;
    line-height: 1.2;
  }
  .logo-container img {
    height: 26px;
  }
  .gravatar-link {
    width: 32px;
    height: 32px;
  }
  .gravatar-link img {
    width: 28px;
    height: 28px;
  }
  .arrow {
    width: 34px;
    height: 34px;
    font-size: 16px;
  }
  .tab-buttons button {
    padding: 10px 12px;
    font-size: 14px;
  }
  .download-button {
    width: 100%;
    justify-content: center;
  }
}

.slider-container, .fullscreen-container { touch-action: pan-y; }

@media (max-width: 1000px) {
  .kofi-header-btn span { display: none; }
  .kofi-header-btn { padding: 6px 9px; }
}

@media (max-width: 420px) {
  .title { font-size: 10.5px; }
  .logo-container img { height: 22px; }
  header { padding: 0 8px; gap: 6px; }
}
