/* Import Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* Global variables */
:root {
  --green: #1aa36f;
  --light-green: #e9f7f1;
  --dark: #123024;
  --grey: #f5f5f5;
  --text: #222222;
  --radius: 14px;
}

/* Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Poppins", system-ui, sans-serif;
  background: #ffffff;
  color: var(--text);
  line-height: 1.6;
}

/* Header */
header {
  background: #ffffff;
  border-bottom: 1px solid #e5f5e5;
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}

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

.header-logo {
  height: 48px;
}

/* Banner */
.banner-wrapper {
  position: relative;
  max-width: 1000px;
  margin: 1.7rem auto 3.5rem auto;
  padding: 0 1rem;
}

.banner {
  width: 100%;
  border-radius: 16px;
  display: block;
}

.badge {
  position: absolute;
  top: 15px;
  left: calc(15px + 1rem);
  background: #e53935;
  padding: 0.45rem 0.9rem;
  color: #ffffff;
  border-radius: 999px;
  font-weight: 600;
}

/* Listas */
ul {
  list-style: circle;
  padding: 6px;
  margin: 8px;
}

li {
  padding-left: 2px;
}

.flacon {
  position: absolute;
  bottom: -65px;
  right: calc(25px + 1rem);
  width: 230px;
  max-width: 33%;
  pointer-events: none;
}

/* Main content */
main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

p {
  margin-bottom: 0.8rem;
  font-size: 1rem;
}



main.error {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center; /* centra verticalmente */
  align-items: center;     /* centra horizontalmente */
  text-align: center;
  padding: 2rem 1rem;
}


/* Hero */
.hero {
  background: var(--light-green);
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
  margin-bottom: 2.2rem;
}

.hero-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 0.3rem;
}

.hero-subtitle {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-list {
  list-style: none;
}

.hero-list li {
  padding-left: 1.4rem;
  margin-bottom: 0.45rem;
  position: relative;
}

.hero-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--green);
  font-weight: 600;
}

/* Titles */
h1 {
  font-size: 2rem;
  margin-bottom: 0.8rem;
  font-weight: 600;
}

h2 {
  font-size: 1.45rem;
  margin: 1.7rem 0 0.9rem;
  font-weight: 600;
}

/* Video responsive 16:9 */
.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 1000px;
  margin: 2.4rem auto 2rem auto; /* mayor espacio antes del video */
  padding: 0 1rem;
}

.video-inner {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.video-inner iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* Grid of arguments */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
  margin-top: 2.4rem; /* mayor espacio antes de las 3 tarjetas */
}

.card {
  background: var(--grey);
  padding: 1rem;
  border-radius: var(--radius);
}

/* Iconos SVG de argumentos */
.card-icon {
  margin-bottom: 0.3rem;
}

.card-icon-img {
  display: block;
  width: 40px;
  height: auto;
}

/* FAQ */
.faq-item {
  margin-bottom: 0.9rem;
}

.faq-item strong {
  display: block;
  margin-bottom: 0.2rem;
}

/* CTA veterinario */
.cta-box {
  background: #f0faf6;
  padding: 1.3rem;
  border-radius: var(--radius);
  margin-top: 1.7rem;
  text-align: center;
}

/* Mini banner del juego Localim */
.lower-banner-subtitle {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
}

.lower-banner-wrapper {
  max-width: 1000px;
  margin: 1.2rem auto 0 auto;
  padding: 0 1rem;
}

.lower-banner-link {
  display: block;
  position: relative;
}

.lower-banner-img {
  width: 100%;
  border-radius: 12px;
  display: block;
}

/* Boton rojo superpuesto */
.lower-banner-btn {
  display: inline-block;
  background: #e53935;
  color: #ffffff;
  padding: 0.45rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  text-decoration: none;
  font-weight: 600;
}

.lower-banner-btn-overlay {
  position: absolute;
  right: 15px;
  bottom: 15px;
}

/* Pie de pagina */
footer {
  margin-top: 2.2rem;
  padding: 1rem;
  border-top: 1px solid #e5f5e5;
  background-color: white;
}

.footer-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: #777777;
}

.footer-logo {
  height: 28px;
}

.footer-links a {
  color: #777777;
  text-decoration: none;
  margin-left: 0.8rem;
}

.footer-links a:first-child {
  margin-left: 0;
}

/* Game container */
.game-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1rem 3rem;
}

.game-area {
  background: #ffffff;
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
}

.story-text {
  max-width: 600px;
  margin: 1rem auto;
}

/* Game instructions */
.game-instructions {
  background: #e9f7f1;
  border-radius: 12px;
  padding: 1.2rem;
  max-width: 600px;
  margin: 1.5rem auto;
}

.instruction-item {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #d7eae0;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.7rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.instruction-icon-img {
  width: 40px;
  height: auto;
  image-rendering: pixelated;
}

/* Game buttons */
.start-btn,
.restart-btn {
  background: var(--green);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1.5rem;
  margin-top: 1rem;
  font-size: 1rem;
  cursor: pointer;
}

/* Game info */
.game-info {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 0.8rem;
}

.game-info div {
  background: var(--green);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  font-size: 0.95rem;
}

/* Game canvas and cells */
.game-canvas {
  position: relative;
  margin: 0 auto;
  background: #f5f5f5;
  border-radius: 8px;
}

.game-cell {
  position: absolute;
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* sprites pixel art */
.sprite-img {
  width: 80%;
  height: auto;
  image-rendering: pixelated;
}

.wall {
  background: #d9eee4;
  border-radius: 6px;
}

/* Mobile controls */
.mobile-controls {
  margin-top: 1rem;
  display: none;
}

.controls-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 0.5rem;
}

.control-btn {
  width: 60px;
  height: 60px;
  background: var(--green);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 26px;
  cursor: pointer;
  touch-action: none;
}

/* Keyboard easter egg */
.easter-egg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.62);
  z-index: 99999;
  overflow: hidden;
  cursor: pointer;
}

.easter-egg-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.easter-egg-piece {
  position: absolute;
  border-radius: 2px;
  will-change: transform;
  animation-name: easterEggFall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}

.easter-egg-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.85rem 1.35rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  color: #123024;
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  font-weight: 600;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.14);
  pointer-events: none;
}

@keyframes easterEggFall {
  from {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }
  to {
    transform: translate3d(var(--egg-drift), var(--egg-fall-distance), 0) rotate(var(--egg-rotation));
  }
}

/* Responsive */
@media (max-width: 700px) {
  .header-container {
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .header-center {
    justify-content: center;
  }

  .flacon {
    width: 180px;
    bottom: -40px;
    right: 1rem;
  }

  .badge {
    left: calc(15px + 1rem);
    top: 15px;
  }

  .grid-3 {
    grid-template-columns: 1fr;
  }

  .mobile-controls {
    display: block;
  }

  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
  }

  .footer-links a {
    margin-left: 0;
  }
}
