/* === ADN HINCHA GUARANÍ — Estilos Globales === */

:root {
  --rojo:       #D52B1E;
  --azul:       #0038A8;
  --blanco:     #FFFFFF;
  --amarillo:   #FFD700;
  --verde:      #2D6A2D;
  --negro:      #111111;
  --gris:       #F5F5F0;
  --gris-dark:  #E0E0D8;
  --sombra:     4px 4px 0px var(--negro);
  --sombra-sm:  2px 2px 0px var(--negro);
  --borde:      3px solid var(--negro);
  --radio:      14px;
  --radio-sm:   8px;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Nunito', 'Arial Rounded MT Bold', Arial, sans-serif;
  background-color: var(--gris);
  color: var(--negro);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, .display, .bebas {
  font-family: 'Bebas Neue', Impact, 'Arial Black', sans-serif;
  line-height: 1.05;
  letter-spacing: 1px;
}

/* ============================
   SCREENS / SECCIONES
   ============================ */

.screen {
  display: none;
  min-height: 100vh;
  flex-direction: column;
}
.screen.active { display: flex; }

/* ============================
   HERO / BIENVENIDA
   ============================ */

#hero {
  background-color: var(--azul);
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero-bg-shape {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 45%;
  background-color: var(--rojo);
  clip-path: polygon(0 35%, 100% 0%, 100% 100%, 0% 100%);
  z-index: 0;
}

.hero-content { position: relative; z-index: 1; }

.hero-emoji {
  font-size: clamp(3.5rem, 15vw, 6rem);
  display: block;
  animation: heroPulse 2.5s ease-in-out infinite;
  margin-bottom: 0.25rem;
}

.hero-title {
  font-size: clamp(3rem, 14vw, 7rem);
  color: var(--blanco);
  text-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  margin-bottom: 0.75rem;
  animation: slideDown 0.5s ease-out both;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 4vw, 1.2rem);
  color: rgba(255,255,255,0.9);
  font-weight: 700;
  margin-bottom: 1.25rem;
  line-height: 1.5;
  animation: slideUp 0.5s ease-out 0.15s both;
}

.hero-badge {
  display: inline-block;
  background-color: var(--amarillo);
  color: var(--negro);
  font-weight: 800;
  font-size: 0.88rem;
  padding: 0.45rem 1.1rem;
  border-radius: 50px;
  border: 2px solid var(--negro);
  box-shadow: var(--sombra-sm);
  margin-bottom: 2rem;
  animation: slideUp 0.5s ease-out 0.3s both;
}

.hero-players {
  position: absolute;
  bottom: 1.5rem;
  left: 0; right: 0;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.55);
  font-weight: 700;
  letter-spacing: 1px;
  z-index: 1;
}

/* ============================
   BOTONES
   ============================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-family: 'Bebas Neue', Impact, sans-serif;
  letter-spacing: 1.5px;
  padding: 0.9rem 2rem;
  border-radius: var(--radio);
  border: var(--borde);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, box-shadow 0.08s;
  font-size: 1.25rem;
  box-shadow: var(--sombra);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0px var(--negro);
}

.btn-amarillo { background-color: var(--amarillo); color: var(--negro); }
.btn-rojo     { background-color: var(--rojo);     color: var(--blanco); }
.btn-azul     { background-color: var(--azul);     color: var(--blanco); }
.btn-blanco   { background-color: var(--blanco);   color: var(--negro); }
.btn-full     { width: 100%; }
.btn-lg       { font-size: 1.5rem; padding: 1.1rem 2.5rem; }
.btn-sm       { font-size: 1rem; padding: 0.65rem 1.25rem; box-shadow: var(--sombra-sm); }

.btn-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 1.15rem;
  letter-spacing: 1.5px;
  padding: 0.85rem 1rem;
  border-radius: var(--radio-sm);
  border: var(--borde);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.08s;
  box-shadow: var(--sombra);
  margin-top: 0.75rem;
  -webkit-tap-highlight-color: transparent;
}

.btn-share:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0px var(--negro);
}

.btn-share.rojo   { background-color: var(--rojo);     color: var(--blanco); }
.btn-share.azul   { background-color: var(--azul);     color: var(--blanco); }
.btn-share.verde  { background-color: var(--verde);    color: var(--blanco); }
.btn-share.negro  { background-color: var(--negro);    color: var(--blanco); }

/* ============================
   FORMULARIO NOMBRE
   ============================ */

#nombre-section {
  background-color: var(--gris);
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.nombre-card {
  background-color: var(--blanco);
  border: var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 420px;
  text-align: center;
  animation: fadeInUp 0.4s ease-out;
}

.nombre-icon { font-size: 3rem; margin-bottom: 0.5rem; }

.nombre-card h2 {
  font-size: 2.2rem;
  color: var(--azul);
  margin-bottom: 0.5rem;
}

.nombre-card p {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.input-field {
  width: 100%;
  padding: 0.9rem 1rem;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: var(--borde);
  border-radius: var(--radio-sm);
  outline: none;
  background-color: var(--gris);
  margin-bottom: 0.75rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}

.input-field:focus {
  border-color: var(--azul);
  box-shadow: 0 0 0 3px rgba(0, 56, 168, 0.15);
  background-color: var(--blanco);
}

.nombre-btns {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* ============================
   TEST
   ============================ */

#test-section {
  background-color: var(--gris);
  padding: 1.5rem 1.25rem 2rem;
}

.progress-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.progress-track {
  flex: 1;
  background-color: var(--gris-dark);
  border: 2px solid var(--negro);
  border-radius: 50px;
  height: 13px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--rojo);
  border-radius: 50px;
  transition: width 0.35s ease;
}

.progress-label {
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 1.05rem;
  color: #777;
  letter-spacing: 1px;
  white-space: nowrap;
}

.question-card {
  background-color: var(--blanco);
  border: var(--borde);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  animation: slideRight 0.3s ease-out;
}

.question-text {
  font-size: clamp(1.05rem, 4.5vw, 1.3rem);
  font-weight: 800;
  color: var(--negro);
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background-color: var(--gris);
  border: var(--borde);
  border-radius: var(--radio-sm);
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  font-family: 'Nunito', Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: left;
  color: var(--negro);
  transition: background-color 0.15s, transform 0.08s, box-shadow 0.08s;
  box-shadow: var(--sombra-sm);
  -webkit-tap-highlight-color: transparent;
}

.option-btn:hover  { background-color: #e8f0ff; }

.option-btn.selected,
.option-btn:active {
  background-color: var(--azul);
  color: var(--blanco);
  border-color: var(--azul);
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 var(--negro);
}

.option-emoji { font-size: 1.4rem; flex-shrink: 0; }

.test-footer {
  margin-top: auto;
  text-align: center;
  font-size: 0.8rem;
  color: #aaa;
  padding-top: 1rem;
}

/* ============================
   LOADING / TRANSICIÓN
   ============================ */

#loading-section {
  background-color: var(--azul);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.loading-emoji  { font-size: 4rem; margin-bottom: 1rem; animation: heroPulse 1.5s ease-in-out infinite; }
.loading-title  { font-size: 1.8rem; color: var(--blanco); margin-bottom: 0.5rem; }
.loading-sub    { color: rgba(255,255,255,0.65); font-size: 0.9rem; margin-bottom: 1.5rem; }

.dots {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.dot {
  width: 13px; height: 13px;
  background-color: var(--amarillo);
  border-radius: 50%;
  animation: dotBounce 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

.loading-track {
  width: 100%; max-width: 280px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 50px;
  height: 8px;
  overflow: hidden;
}

.loading-fill {
  height: 100%;
  background-color: var(--amarillo);
  border-radius: 50px;
  animation: fakeLoad 4s ease-in-out infinite;
}

/* ============================
   DASHBOARD — HEADER
   ============================ */

.dash-header {
  background-color: var(--azul);
  border-bottom: var(--borde);
  padding: 1.25rem 1.5rem;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dash-header h1 {
  font-size: clamp(1.6rem, 7vw, 2.5rem);
  color: var(--blanco);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.dash-header p {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  margin-top: 0.2rem;
}

/* ============================
   DASHBOARD — CONTENEDOR
   ============================ */

.dash-main {
  max-width: 600px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ============================
   MÓDULO CARD
   ============================ */

.modulo {
  background-color: var(--blanco);
  border: var(--borde);
  border-radius: var(--radio);
  box-shadow: 5px 5px 0px var(--negro);
  overflow: hidden;
  animation: fadeInUp 0.5s ease-out both;
}

.modulo:nth-child(1) { animation-delay: 0.05s; }
.modulo:nth-child(2) { animation-delay: 0.15s; }
.modulo:nth-child(3) { animation-delay: 0.25s; }
.modulo:nth-child(4) { animation-delay: 0.35s; }
.modulo:nth-child(5) { animation-delay: 0.45s; }
.modulo:nth-child(6) { animation-delay: 0.55s; }

.modulo-head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 2px solid var(--negro);
}

.modulo-head .icon { font-size: 1.3rem; }

.modulo-head h3 {
  font-size: 1.3rem;
  letter-spacing: 1px;
}

.head-rojo    { background-color: var(--rojo);    color: var(--blanco); }
.head-azul    { background-color: var(--azul);    color: var(--blanco); }
.head-amarillo{ background-color: var(--amarillo); color: var(--negro); }
.head-verde   { background-color: var(--verde);   color: var(--blanco); }
.head-negro   { background-color: var(--negro);   color: var(--blanco); }

.modulo-body { padding: 1.25rem; }

/* ============================
   MÓDULO 1 — ADN DE HINCHA
   ============================ */

.titulo-epico {
  font-size: clamp(2.4rem, 10vw, 4rem);
  color: var(--rojo);
  text-shadow: 3px 3px 0 rgba(0,0,0,0.12);
  line-height: 1;
  margin-bottom: 0.75rem;
}

.desc-perfil {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #333;
  margin-bottom: 1.25rem;
}

.rasgos { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.25rem; }

.rasgo { display: flex; flex-direction: column; gap: 0.2rem; }

.rasgo-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
}

.bar-track {
  background-color: var(--gris-dark);
  border: 2px solid var(--negro);
  border-radius: 50px;
  height: 13px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 50px;
  width: 0%;
  transition: width 1.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fill-rojo    { background-color: var(--rojo); }
.fill-azul    { background-color: var(--azul); }
.fill-verde   { background-color: var(--verde); }
.fill-amarillo{ background-color: var(--amarillo); }
.fill-purple  { background-color: #8B5CF6; }
.fill-orange  { background-color: #F97316; }
.fill-teal    { background-color: #0D9488; }

.guarani-badge {
  display: inline-block;
  background-color: var(--rojo);
  color: var(--blanco);
  font-weight: 800;
  font-style: italic;
  font-size: 1rem;
  padding: 0.45rem 1.1rem;
  border-radius: 50px;
  border: 2px solid var(--negro);
  box-shadow: var(--sombra-sm);
  margin-bottom: 0.3rem;
}

.guarani-trad {
  font-size: 0.82rem;
  color: #777;
  font-style: italic;
  padding-left: 0.25rem;
}

/* ============================
   MÓDULO 2 — JUGADOR
   ============================ */

.jugador-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.jugador-avatar {
  width: 78px; height: 78px;
  flex-shrink: 0;
  background-color: var(--rojo);
  border: var(--borde);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Bebas Neue', Impact, sans-serif;
  font-size: 2rem;
  color: var(--blanco);
  position: relative;
  overflow: hidden;
}

.jugador-avatar::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 40%;
  background-color: var(--azul);
}

.jugador-avatar span { position: relative; z-index: 1; }

.jugador-meta { flex: 1; }

.jugador-nombre {
  font-size: clamp(1.7rem, 7vw, 2.6rem);
  color: var(--azul);
  line-height: 1;
  margin-bottom: 0.3rem;
}

.jugador-pos {
  display: inline-block;
  background-color: var(--amarillo);
  color: var(--negro);
  font-weight: 800;
  font-size: 0.78rem;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  border: 2px solid var(--negro);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.35rem;
}

.jugador-razon {
  font-size: 0.9rem;
  color: #444;
  line-height: 1.55;
}

/* ============================
   MÓDULO 3 — PREDICCIÓN
   ============================ */

.partidos { display: flex; flex-direction: column; gap: 0.85rem; margin-bottom: 1rem; }

.partido {
  background-color: var(--gris);
  border: 2px solid var(--negro);
  border-radius: var(--radio-sm);
  padding: 1rem;
}

.partido-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
}

.partido-rival { font-weight: 800; font-size: 1rem; }
.partido-fecha { font-size: 0.78rem; color: #777; }

.suf-label {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #666;
  margin-bottom: 0.2rem;
}

.suf-track {
  background-color: var(--gris-dark);
  border: 2px solid var(--negro);
  border-radius: 50px;
  height: 11px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.suf-fill {
  height: 100%;
  border-radius: 50px;
  width: 0%;
  transition: width 1.2s ease;
}

.suf-low  { background-color: #22C55E; }
.suf-mid  { background-color: var(--amarillo); }
.suf-high { background-color: var(--rojo); }

.partido-stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.partido-msg {
  font-size: 0.83rem;
  color: #555;
  font-style: italic;
  border-left: 3px solid var(--rojo);
  padding-left: 0.65rem;
  line-height: 1.4;
}

.pred-final {
  background-color: var(--azul);
  color: var(--blanco);
  border-radius: var(--radio-sm);
  border: 2px solid var(--negro);
  padding: 1rem 1.1rem;
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.55;
  text-align: center;
}

/* ============================
   MÓDULO 4 & 6 — CANVAS
   ============================ */

.canvas-wrap {
  text-align: center;
  margin-bottom: 0.5rem;
}

.canvas-wrap canvas {
  max-width: 100%;
  border: var(--borde);
  border-radius: var(--radio-sm);
  box-shadow: var(--sombra);
}

/* ============================
   MÓDULO 5 — GRITO GUARANÍ
   ============================ */

.grito-cartel {
  background-color: var(--rojo);
  border: var(--borde);
  border-radius: var(--radio-sm);
  padding: 1.5rem 1.25rem;
  text-align: center;
  margin-bottom: 0.75rem;
}

.grito-frase {
  font-size: clamp(1.5rem, 7vw, 2.5rem);
  color: var(--blanco);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.25);
  letter-spacing: 2px;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.grito-pron {
  display: inline-block;
  background-color: var(--amarillo);
  color: var(--negro);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.3rem 0.85rem;
  border-radius: 50px;
  border: 2px solid var(--negro);
  font-style: italic;
  margin-bottom: 0.5rem;
}

.grito-trad { color: rgba(255,255,255,0.88); font-size: 0.88rem; font-weight: 600; }

.grito-historia {
  font-size: 0.83rem;
  color: #666;
  line-height: 1.5;
  font-style: italic;
  padding: 0.75rem;
  background-color: var(--gris);
  border-radius: var(--radio-sm);
  border: 1px solid var(--gris-dark);
  margin-top: 0.75rem;
}

/* ============================
   ESTADOS — LOADING / ERROR
   ============================ */

#dashboard-loading {
  background-color: var(--azul);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  text-align: center;
  padding: 2rem;
}

#dashboard-error {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--gris);
  padding: 2rem;
  text-align: center;
}

.error-card {
  background-color: var(--blanco);
  border: 3px solid var(--rojo);
  border-radius: var(--radio);
  box-shadow: 5px 5px 0px var(--rojo);
  padding: 2rem 1.5rem;
  max-width: 380px;
  width: 100%;
}

.error-card h2 { font-size: 2rem; color: var(--rojo); margin-bottom: 0.5rem; }
.error-card p  { color: #555; margin-bottom: 1.25rem; font-size: 0.95rem; }

/* ============================
   DASHBOARD CONTENIDO
   ============================ */

#dashboard-content { display: none; }

/* ============================
   FOOTER
   ============================ */

.footer-global {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.82rem;
  color: #999;
  border-top: 2px solid var(--gris-dark);
  margin-top: auto;
}

.footer-global strong { color: var(--rojo); }

/* ============================
   ANIMACIONES
   ============================ */

@keyframes heroPulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.08); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-25px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

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

@keyframes dotBounce {
  0%, 80%, 100% { transform: scale(0.75); opacity: 0.4; }
  40%           { transform: scale(1.25); opacity: 1; }
}

@keyframes fakeLoad {
  0%   { width: 5%; }
  40%  { width: 70%; }
  70%  { width: 88%; }
  100% { width: 95%; }
}

@keyframes barFill {
  from { width: 0%; }
}

/* ============================
   RESPONSIVE DESKTOP
   ============================ */

@media (min-width: 640px) {
  .options-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .partidos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .jugador-top { align-items: center; }
}

@media (min-width: 768px) {
  .dash-main { padding: 2rem 2rem 4rem; }
  .hero-title { font-size: 7rem; }
}
