/* ═══════════════════════════════════════════════
   PRIMEJUEGOS · diseño moderno tipo magazine
   Paleta: crema + coral + verde lima + negro
   ═══════════════════════════════════════════════ */

:root {
  --bg: #FAF8F3;
  --bg-2: #FFFFFF;
  --panel: #FFFFFF;
  --panel-2: #F5F2EB;
  --linea: #E8E3D5;
  --linea-2: #D4CEB8;
  
  --tinta: #1A1A1A;
  --tinta-2: #5A5549;
  --tinta-3: #8A8474;
  
  --coral: #FF3B30;
  --coral-osc: #D62820;
  --coral-suave: #FFE8E5;
  --lima: #A8E10C;
  --lima-osc: #8BB80A;
  --lima-suave: #E8F7B8;
  --azul: #0066FF;
  --azul-suave: #E5F0FF;
  
  --titulo: 'Space Grotesk', sans-serif;
  --cuerpo: 'Inter', sans-serif;
  --mono: 'JetBrains Mono', monospace;
  
  --radio-s: 8px;
  --radio-m: 14px;
  --radio-l: 22px;
  
  --sombra-s: 0 2px 8px rgba(26, 26, 26, 0.06);
  --sombra-m: 0 8px 24px rgba(26, 26, 26, 0.08);
  --sombra-l: 0 16px 48px rgba(26, 26, 26, 0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--cuerpo);
  background: var(--bg);
  color: var(--tinta);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Patrón de fondo sutil */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: 
    radial-gradient(circle at 20% 10%, rgba(255, 59, 48, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168, 225, 12, 0.04) 0%, transparent 50%);
}

/* ═══ HEADER ═══ */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 243, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--linea);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--tinta);
}

.logo-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.logo-text {
  font-family: var(--titulo);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.5px;
}

.logo-accent {
  color: var(--coral);
  font-weight: 700;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.badge-nuevo {
  font-family: var(--titulo);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  background: var(--lima);
  color: var(--tinta);
  padding: 6px 12px;
  border-radius: 100px;
  text-transform: uppercase;
}

.stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--titulo);
}

.stat-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--coral);
}

.stat-label {
  font-size: 13px;
  color: var(--tinta-2);
  font-weight: 500;
}

/* ═══ MAIN ═══ */
.main {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px 80px;
}

/* ═══ HERO ═══ */
.hero {
  padding: 80px 0 40px;
}

.hero-inner {
  text-align: center;
}

.hero-title {
  font-family: var(--titulo);
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: var(--tinta);
  margin-bottom: 20px;
}

.accent {
  background: linear-gradient(120deg, var(--coral) 0%, #FF6B5C 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 18px;
  line-height: 1.6;
  color: var(--tinta-2);
  max-width: 620px;
  margin: 0 auto 40px;
}

/* ═══ SEARCH FORM ═══ */
.search-form {
  max-width: 680px;
  margin: 0 auto 28px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  border: 2px solid var(--linea);
  border-radius: 100px;
  padding: 8px 8px 8px 24px;
  box-shadow: var(--sombra-m);
  transition: all 0.25s ease;
}

.search-box:focus-within {
  border-color: var(--coral);
  box-shadow: 0 0 0 5px var(--coral-suave), var(--sombra-l);
  transform: translateY(-1px);
}

.search-icon {
  color: var(--tinta-3);
  flex: none;
  display: flex;
  align-items: center;
}

#q {
  flex: 1;
  background: none;
  border: 0;
  outline: 0;
  font: 500 17px var(--cuerpo);
  color: var(--tinta);
  min-width: 0;
}

#q::placeholder {
  color: var(--tinta-3);
}

.btn-search {
  font-family: var(--titulo);
  font-size: 15px;
  font-weight: 600;
  background: var(--coral);
  color: white;
  border: 0;
  border-radius: 100px;
  padding: 14px 28px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--coral-osc);
}

.btn-search:hover {
  background: var(--coral-osc);
  transform: translateY(1px);
  box-shadow: 0 3px 0 var(--coral-osc);
}

.btn-search:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--coral-osc);
}

/* ═══ CHIPS ═══ */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 48px;
}

.chip {
  font-family: var(--cuerpo);
  font-size: 14px;
  font-weight: 500;
  color: var(--tinta-2);
  background: var(--bg-2);
  border: 1px solid var(--linea);
  border-radius: 100px;
  padding: 9px 18px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  color: var(--coral);
  border-color: var(--coral);
  background: var(--coral-suave);
  transform: translateY(-2px);
  box-shadow: var(--sombra-s);
}

/* ═══ STEPS ═══ */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.step {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-2);
  padding: 14px 22px;
  border-radius: var(--radio-l);
  border: 1px solid var(--linea);
  box-shadow: var(--sombra-s);
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--coral);
  color: white;
  font-family: var(--titulo);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.step-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--tinta);
}

.step-arrow {
  color: var(--tinta-3);
  font-size: 22px;
}

/* ═══ TRUST BOX ═══ */
.trust-box {
  background: var(--lima-suave);
  border: 1px solid rgba(168, 225, 12, 0.3);
  border-radius: var(--radio-l);
  padding: 20px 28px;
  max-width: 600px;
  margin: 0 auto 40px;
}

.trust-label {
  font-family: var(--titulo);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--lima-osc);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.trust-sites {
  font-family: var(--titulo);
  font-size: 17px;
  font-weight: 600;
  color: var(--tinta);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

.trust-dot {
  color: var(--tinta-3);
}

/* ═══ RECIENTES ═══ */
.recientes {
  margin-top: 32px;
}

.recientes-label {
  font-family: var(--titulo);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--tinta-3);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* ═══ RESULTADOS ═══ */
.resultados {
  padding-top: 40px;
}

.resultados-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.btn-volver {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--titulo);
  font-size: 14px;
  font-weight: 600;
  color: var(--coral);
  background: var(--coral-suave);
  border: 0;
  border-radius: 100px;
  padding: 12px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-volver:hover {
  background: var(--coral);
  color: white;
  transform: translateX(-3px);
}

.meta-busqueda {
  font-family: var(--cuerpo);
  font-size: 13px;
  color: var(--tinta-2);
}

.meta-busqueda b {
  color: var(--tinta);
  font-weight: 600;
}

/* ═══ LOADER ═══ */
.loader {
  background: var(--bg-2);
  border: 1px solid var(--linea);
  border-radius: var(--radio-l);
  padding: 40px;
  text-align: center;
  box-shadow: var(--sombra-m);
  animation: fadeIn 0.4s ease;
}

.loader-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.loader-text {
  font-family: var(--titulo);
  font-size: 16px;
  font-weight: 500;
  color: var(--tinta-2);
  margin-bottom: 20px;
}

.loader-bar {
  max-width: 320px;
  height: 6px;
  background: var(--linea);
  border-radius: 100px;
  margin: 0 auto;
  overflow: hidden;
}

.loader-bar i {
  display: block;
  height: 100%;
  width: 5%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--coral), #FF6B5C);
  transition: width 0.5s ease;
}

/* ═══ PANELES ═══ */
.panel-fuera, .panel-error {
  background: var(--bg-2);
  border: 2px solid;
  border-radius: var(--radio-l);
  padding: 48px 32px;
  text-align: center;
  box-shadow: var(--sombra-m);
  animation: fadeIn 0.4s ease;
}

.panel-fuera {
  border-color: var(--azul);
  background: var(--azul-suave);
}

.panel-error {
  border-color: var(--coral);
  background: var(--coral-suave);
}

.panel-fuera-icon, .panel-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.panel-fuera h3, .panel-error h3 {
  font-family: var(--titulo);
  font-size: 22px;
  font-weight: 700;
  color: var(--tinta);
  margin-bottom: 12px;
}

.panel-fuera p, .panel-error p {
  font-size: 15px;
  line-height: 1.6;
  color: var(--tinta-2);
  max-width: 500px;
  margin: 0 auto;
}

/* ═══ RESUMEN CARD ═══ */
.resumen-card {
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--panel-2) 100%);
  border: 1px solid var(--linea);
  border-left: 5px solid var(--coral);
  border-radius: var(--radio-l);
  padding: 28px 32px;
  margin-bottom: 32px;
  box-shadow: var(--sombra-s);
  animation: fadeIn 0.5s ease;
}

.etiqueta-ia {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-family: var(--titulo);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--coral);
}

.tag-groq {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--tinta-2);
  background: var(--bg-2);
  border: 1px solid var(--linea);
  padding: 4px 10px;
  border-radius: 6px;
}

.resumen-card p {
  font-size: 17px;
  line-height: 1.65;
  color: var(--tinta);
}

/* ═══ GRID RESULTADOS ═══ */
.grid-resultados {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 28px;
  align-items: start;
}

.lista {
  display: grid;
  gap: 20px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ═══ CARD DE RESULTADO ═══ */
.card {
  background: var(--bg-2);
  border: 1px solid var(--linea);
  border-radius: var(--radio-l);
  padding: 24px;
  box-shadow: var(--sombra-s);
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
  transition: all 0.25s ease;
}

.card:hover {
  border-color: var(--coral);
  transform: translateY(-3px);
  box-shadow: var(--sombra-l);
}

.card.recomendada {
  border: 2px solid var(--lima);
  background: linear-gradient(135deg, var(--bg-2) 0%, var(--lima-suave) 100%);
  box-shadow: 0 4px 16px rgba(168, 225, 12, 0.2);
}

.card.recomendada:hover {
  border-color: var(--lima-osc);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 12px;
}

.card h3 {
  font-family: var(--titulo);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--tinta);
  letter-spacing: -0.3px;
}

/* Leds de fiabilidad */
.leds {
  display: flex;
  gap: 4px;
  align-items: center;
  flex: none;
  padding-top: 4px;
}

.led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--linea-2);
}

.led.on-verde { background: var(--lima); box-shadow: 0 0 6px rgba(168, 225, 12, 0.5); }
.led.on-oro { background: #FFB800; box-shadow: 0 0 6px rgba(255, 184, 0, 0.5); }
.led.on-rojo { background: var(--coral); box-shadow: 0 0 6px rgba(255, 59, 48, 0.5); }

.fiab {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--tinta-3);
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Badge recomendado */
.badge-recomendado {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--titulo);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tinta);
  background: var(--lima);
  padding: 6px 14px;
  border-radius: 100px;
  margin: 8px 0 14px;
}

/* Código copiable */
.codigo {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--tinta);
  border-radius: var(--radio-m);
  padding: 14px 18px;
  margin: 14px 0;
}

.codigo code {
  flex: 1;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  color: var(--lima);
  letter-spacing: 0.3px;
  word-break: break-all;
}

.btn-copiar {
  font-family: var(--titulo);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tinta);
  background: var(--lima);
  border: 0;
  border-radius: 100px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.15s ease;
  flex: none;
}

.btn-copiar:hover {
  background: white;
  transform: translateY(-1px);
}

.btn-copiar.ok {
  background: white;
  color: var(--lima-osc);
}

.card.copiada {
  animation: flashCard 0.6s ease;
}

@keyframes flashCard {
  0% { box-shadow: 0 0 0 4px rgba(168, 225, 12, 0.5); }
  100% { box-shadow: var(--sombra-s); }
}

/* Guía paso a paso */
.guia {
  margin: 14px 0;
  display: grid;
  gap: 10px;
  list-style: none;
  counter-reset: paso;
}

.guia li {
  counter-increment: paso;
  position: relative;
  padding: 14px 18px 14px 56px;
  background: var(--panel-2);
  border: 1px solid var(--linea);
  border-radius: var(--radio-m);
  font-size: 15px;
  line-height: 1.55;
  color: var(--tinta);
  transition: all 0.2s ease;
}

.guia li:hover {
  border-color: var(--coral);
  transform: translateX(4px);
  background: var(--coral-suave);
}

.guia li::before {
  content: counter(paso, decimal-leading-zero);
  position: absolute;
  left: 16px;
  top: 14px;
  width: 28px;
  height: 28px;
  background: var(--coral);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--titulo);
  font-size: 12px;
  font-weight: 700;
}

/* Tags */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.tag {
  font-family: var(--cuerpo);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid;
}

.tag-tipo {
  font-family: var(--titulo);
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 12px;
  border: 0;
  color: white;
}

.tipo-codigo { background: var(--coral); }
.tipo-guia { background: var(--azul); }
.tipo-info { background: var(--tinta); }

.tag-juego {
  color: var(--coral);
  border-color: var(--coral-suave);
  background: var(--coral-suave);
}

.tag-plat {
  color: var(--tinta-2);
  border-color: var(--linea);
  background: var(--panel-2);
}

.como {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--tinta-2);
}

.como b {
  color: var(--tinta);
  font-weight: 600;
}

.notas {
  margin-top: 14px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--coral-osc);
  background: var(--coral-suave);
  border-left: 4px solid var(--coral);
  padding: 10px 14px;
  border-radius: 0 var(--radio-m) var(--radio-m) 0;
}

.card-pie {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--linea);
  flex-wrap: wrap;
}

.verif {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tinta-3);
}

.fuente-link {
  font-family: var(--cuerpo);
  font-size: 13px;
  font-weight: 600;
  color: var(--coral);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}

.fuente-link:hover {
  color: var(--coral-osc);
  text-decoration: underline;
}

/* ═══ FUENTES (sidebar) ═══ */
.fuentes {
  position: sticky;
  top: 100px;
  background: var(--bg-2);
  border: 1px solid var(--linea);
  border-radius: var(--radio-l);
  padding: 24px;
  box-shadow: var(--sombra-s);
}

.fuentes h4 {
  font-family: var(--titulo);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--coral);
  text-transform: uppercase;
  margin-bottom: 18px;
}

.fuentes ol {
  list-style: none;
  display: grid;
  gap: 14px;
  counter-reset: f;
}

.fuentes li {
  counter-increment: f;
  font-size: 13px;
  line-height: 1.45;
}

.fuentes li a {
  color: var(--tinta);
  text-decoration: none;
  font-weight: 500;
  display: block;
  transition: color 0.2s;
}

.fuentes li a::before {
  content: "[" counter(f, decimal-leading-zero) "] ";
  color: var(--coral);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
}

.fuentes li a:hover {
  color: var(--coral);
}

.fuentes li small {
  color: var(--tinta-3);
  font-family: var(--mono);
  font-size: 11px;
  display: block;
  margin-top: 3px;
  word-break: break-all;
}

.fuente-recomendada {
  display: inline-block;
  font-family: var(--titulo);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--tinta);
  background: var(--lima);
  padding: 3px 8px;
  border-radius: 100px;
  margin-bottom: 4px;
}

/* ═══ FOOTER ═══ */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--linea);
  background: var(--bg-2);
  margin-top: 60px;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 28px;
  text-align: center;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.footer-text {
  font-size: 13px;
  color: var(--tinta-2);
  max-width: 560px;
  margin: 0 auto 14px;
  line-height: 1.6;
}

.footer-links {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--tinta-3);
}

kbd {
  background: var(--panel-2);
  border: 1px solid var(--linea);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 8px;
  color: var(--coral);
  font-family: var(--mono);
  font-weight: 600;
}

.shortcut {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 900px) {
  .grid-resultados { grid-template-columns: 1fr; }
  .fuentes { position: static; }
  .step-arrow { display: none; }
  .steps { gap: 10px; }
}

@media (max-width: 600px) {
  .header-inner { padding: 14px 18px; }
  .logo-text { font-size: 20px; }
  .stat { display: none; }
  .hero { padding: 48px 0 30px; }
  .search-box { padding: 6px 6px 6px 18px; }
  .btn-search { padding: 12px 20px; font-size: 14px; }
  .steps { flex-direction: column; gap: 8px; }
  .step { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .card { opacity: 1; }
}