/* ============================================================
   Chicama · Memoria del valle
   Hoja de estilos principal. Sin frameworks, sin dependencias.
   ============================================================ */

/* ---------- Variables ---------- */
:root {
  --bg: #f4efe6;
  --bg-2: #ebe3d5;
  --surface: #fbf8f2;
  --surface-2: #f1eadf;
  --ink: #1d1a16;
  --muted: #6a6156;
  --line: rgba(29, 26, 22, 0.13);
  --line-strong: rgba(29, 26, 22, 0.26);
  --accent: #b4552d;
  --accent-strong: #8f3f20;
  --accent-soft: rgba(180, 85, 45, 0.12);
  --sea: #2f5d62;
  --sea-soft: rgba(47, 93, 98, 0.12);
  --gold: #c99a4b;
  --ok: #3e7a57;
  --ok-soft: rgba(62, 122, 87, 0.12);
  --bad: #b4443e;
  --bad-soft: rgba(180, 68, 62, 0.11);
  --header-bg: rgba(244, 239, 230, 0.84);
  --panel: #1e2b26;
  --panel-ink: #f6f0e5;
  --panel-muted: rgba(246, 240, 229, 0.66);
  --shadow: 0 24px 70px rgba(70, 45, 20, 0.12);
  --shadow-soft: 0 10px 30px rgba(70, 45, 20, 0.07);
  --radius: 22px;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #131110;
  --bg-2: #1a1714;
  --surface: #201c18;
  --surface-2: #27211c;
  --ink: #f4ede2;
  --muted: #b8ab9b;
  --line: rgba(244, 237, 226, 0.14);
  --line-strong: rgba(244, 237, 226, 0.28);
  --accent: #e58256;
  --accent-strong: #f09a72;
  --accent-soft: rgba(229, 130, 86, 0.16);
  --sea: #8bc0bd;
  --sea-soft: rgba(139, 192, 189, 0.14);
  --gold: #dbb06a;
  --ok: #7fc39a;
  --ok-soft: rgba(127, 195, 154, 0.14);
  --bad: #e07a72;
  --bad-soft: rgba(224, 122, 114, 0.15);
  --header-bg: rgba(19, 17, 16, 0.84);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}

/* ---------- Reset y base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 90px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.35s ease, color 0.35s ease;
}

body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: inherit; }

::selection {
  background: var(--accent);
  color: #fff8ef;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1, h2, h3, h4, p, ul, ol, blockquote { margin-top: 0; }
[hidden] { display: none !important; }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.05;
}

h2 {
  font-size: clamp(2.1rem, 4.6vw, 3.6rem);
  margin-bottom: 0;
}

h3 { font-size: 1.35rem; }

p { margin-bottom: 1rem; }

.container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 2.5rem);
}

.section {
  padding: clamp(4.5rem, 9vw, 8rem) 0;
}

.section-alt {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.9rem;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.17em;
  text-transform: uppercase;
}

.kicker::before {
  content: "";
  width: 26px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section-head { max-width: 780px; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.section-head-wide { max-width: 900px; }
.section-sub {
  max-width: 620px;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 1.02rem;
}

.section-head.split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  max-width: none;
  gap: 2rem;
  flex-wrap: wrap;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.9rem 1.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease,
              transform 0.2s ease, box-shadow 0.2s ease;
}

.btn svg { width: 18px; height: 18px; flex-shrink: 0; }

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #fff8ef;
  box-shadow: 0 8px 20px rgba(180, 85, 45, 0.22);
}
.btn-primary:hover { background: var(--accent-strong); }

.btn-outline {
  border-color: var(--line-strong);
  background: transparent;
  color: var(--ink);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }

.btn-small { padding: 0.58rem 1rem; font-size: 0.82rem; }
.btn-block { width: 100%; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); }
.icon-btn svg { width: 20px; height: 20px; }

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  width: fit-content;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.text-link span { transition: transform 0.2s ease; }
.text-link:hover span { transform: translateX(4px); }

.tag {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Animación de entrada ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}
.feature-card:nth-child(2) { transition-delay: 0.08s; }
.feature-card:nth-child(3) { transition-delay: 0.16s; }
.game-card:nth-child(2) { transition-delay: 0.08s; }
.game-card:nth-child(3) { transition-delay: 0.16s; }

/* ---------- Cabecera ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  height: 76px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: var(--accent-soft);
  color: var(--accent);
}
.brand-mark svg { width: 32px; height: 32px; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand-text small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.4vw, 1.8rem);
}
.nav a {
  position: relative;
  padding: 0.4rem 0;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}
.nav a:hover, .nav a.is-active { color: var(--ink); }
.nav a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
  transform: translateX(-50%);
}

.header-actions { display: flex; align-items: center; gap: 0.35rem; }

.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

.menu-toggle { display: none; }
.nav-login { display: none; }

/* ---------- Portada ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: calc(100svh - 76px);
  padding: clamp(4rem, 8vw, 7rem) 0 clamp(5rem, 9vw, 8rem);
  overflow: hidden;
}

.hero-glow {
  position: absolute;
  top: -25%;
  right: -10%;
  width: min(75vw, 900px);
  aspect-ratio: 1;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 67%);
  pointer-events: none;
}

.hero-rings {
  position: absolute;
  top: 50%;
  right: -14%;
  width: min(58vw, 780px);
  aspect-ratio: 1;
  transform: translateY(-50%);
  pointer-events: none;
  opacity: 0.65;
}
.hero-rings span {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.hero-rings span:nth-child(1) { inset: 0; }
.hero-rings span:nth-child(2) { inset: 11%; }
.hero-rings span:nth-child(3) { inset: 22%; }
.hero-rings span:nth-child(4) { inset: 33%; }

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1.4rem;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.pulse-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  opacity: 0.45;
  animation: pulse 2.6s ease-out infinite;
}
@keyframes pulse {
  0% { transform: scale(0.6); opacity: 0.7; }
  70%, 100% { transform: scale(1.7); opacity: 0; }
}

.hero-title {
  max-width: 980px;
  margin: 0 0 1.6rem;
  font-size: clamp(3.1rem, 8.6vw, 7.6rem);
  font-weight: 600;
  line-height: 0.94;
  letter-spacing: -0.038em;
  word-spacing: 0.04em;
}
.hero-title em {
  display: block;
  color: var(--accent);
  font-weight: 400;
  font-style: italic;
}

.hero-lead {
  max-width: 620px;
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.18rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.hero-stats {
  display: flex;
  gap: clamp(1.6rem, 4vw, 3rem);
  max-width: 650px;
  margin: clamp(2.8rem, 6vw, 4.5rem) 0 0;
  padding: 1.5rem 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}
.hero-stats li { display: flex; flex-direction: column; gap: 0.1rem; }
.hero-stats strong {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}
.hero-stats span {
  max-width: 120px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.scroll-cue {
  position: absolute;
  bottom: 1.4rem;
  left: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-decoration: none;
  text-transform: uppercase;
  transform: translateX(-50%);
  z-index: 2;
}
.scroll-cue svg { width: 18px; height: 18px; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* ---------- Cinta de palabras ---------- */
.marquee {
  overflow: hidden;
  padding: 0.95rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-track span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  white-space: nowrap;
}
.marquee-track span:nth-child(even) { color: var(--accent); }
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---------- Introducción ---------- */
.intro-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}
.intro-copy { padding-top: 0.4rem; }
.intro-copy p { color: var(--muted); }
.intro-copy .lead {
  color: var(--ink);
  font-size: clamp(1.08rem, 1.6vw, 1.25rem);
  line-height: 1.55;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.feature-card {
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: 1.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.feature-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-4px);
}
.feature-num {
  margin-bottom: auto;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
}
.feature-card h3 { margin: 1.6rem 0 0.5rem; }
.feature-card p {
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.quote {
  max-width: 900px;
  margin: clamp(3rem, 6vw, 5rem) auto 0;
  padding: clamp(2rem, 4vw, 3rem) 1rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.quote p {
  margin-bottom: 0.8rem;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3.2vw, 2.4rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.quote footer {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* ---------- Línea de tiempo ---------- */
.timeline {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding-left: 2.5rem;
}
.timeline::before {
  content: "";
  position: absolute;
  top: 0.8rem;
  bottom: 0.8rem;
  left: 6px;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--line-strong) 8%, var(--line-strong) 92%, transparent);
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 155px 1fr;
  gap: 1.8rem;
  padding: 0.7rem 0;
}
.timeline-item::before {
  content: "";
  position: absolute;
  top: 1.55rem;
  left: calc(-2.5rem + 2px);
  width: 9px;
  height: 9px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: var(--bg-2);
  box-shadow: 0 0 0 4px var(--bg-2);
}
.timeline-year {
  padding-top: 0.85rem;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: right;
}
.timeline-card {
  padding: 1.35rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.timeline-card:hover {
  border-color: var(--line-strong);
  transform: translateX(3px);
}
.timeline-card h3 { margin: 0.65rem 0 0.45rem; }
.timeline-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

.timeline-note {
  max-width: 920px;
  margin: 2rem auto 0;
  padding: 1rem 1.25rem;
  border-left: 2px solid var(--accent);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
}
.timeline-note strong { color: var(--ink); }

/* ---------- Noticias ---------- */
.news-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(62, 122, 87, 0.5);
  animation: live 2.4s ease-out infinite;
}
@keyframes live {
  0% { box-shadow: 0 0 0 0 rgba(62, 122, 87, 0.45); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(62, 122, 87, 0); }
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.5rem;
}
.filter-btn {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.filter-btn:hover { border-color: var(--line-strong); color: var(--ink); }
.filter-btn.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

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

.news-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 215px;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.news-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-soft);
  transform: translateY(-4px);
}

.news-card.is-featured {
  grid-column: span 2;
  background:
    radial-gradient(circle at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
}
.news-card.is-featured .news-title { font-size: clamp(1.35rem, 2.2vw, 1.75rem); }

.news-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.news-cat {
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.news-source {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-title {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 1rem;
  font-family: var(--font-display);
  font-size: 1.13rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.news-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.67rem;
}
.news-arrow {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.news-arrow svg { width: 13px; height: 13px; }
.news-card:hover .news-arrow {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff8ef;
}

.news-empty {
  grid-column: 1 / -1;
  padding: 3rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: 20px;
  color: var(--muted);
  text-align: center;
}

.news-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}
.news-source-note {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: center;
}

/* ---------- Juegos ---------- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.game-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.game-card:hover {
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.game-art {
  position: relative;
  display: grid;
  place-items: center;
  height: 172px;
  overflow: hidden;
}
.game-index {
  position: absolute;
  top: 1rem;
  left: 1.2rem;
  color: rgba(255, 248, 239, 0.72);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.game-art--quiz {
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.22), transparent 45%),
    linear-gradient(135deg, #a94c27, #d98b5f);
}
.game-symbol {
  font-family: var(--font-display);
  font-size: 7rem;
  font-weight: 400;
  line-height: 1;
  color: rgba(255, 248, 239, 0.9);
}

.game-art--timeline {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(135deg, #254b4f, #6f9a8f);
}
.timeline-dots {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 58%;
}
.timeline-dots i {
  position: relative;
  display: block;
  height: 2px;
  border-radius: 2px;
  background: rgba(255, 248, 239, 0.6);
}
.timeline-dots i::after {
  content: "";
  position: absolute;
  top: -3px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff8ef;
}
.timeline-dots i:nth-child(1) { width: 58%; }
.timeline-dots i:nth-child(2) { width: 86%; margin-left: 8%; }
.timeline-dots i:nth-child(3) { width: 46%; margin-left: 18%; }
.timeline-dots i:nth-child(4) { width: 72%; margin-left: 4%; }
.timeline-dots i:nth-child(5) { width: 54%; margin-left: 22%; }

.game-art--memory {
  background:
    radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(135deg, #b9873c, #8f5a24);
}
.memory-symbols {
  display: grid;
  grid-template-columns: repeat(2, 54px);
  gap: 0.55rem;
}
.memory-symbols i {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid rgba(255, 248, 239, 0.5);
  border-radius: 12px;
  color: rgba(255, 248, 239, 0.9);
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-style: normal;
}

.game-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.4rem;
}
.game-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.game-body h3 { margin-bottom: 0.5rem; }
.game-body p {
  flex: 1;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: 0.86rem;
}
.game-body .btn { align-self: flex-start; }

.games-note {
  margin-top: 2rem;
  padding: 1rem 1.3rem;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  background: var(--surface);
}
.games-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.83rem;
}
.games-note strong { color: var(--ink); }

/* ---------- Comunidad ---------- */
.community-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 4rem);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background:
    radial-gradient(circle at 0% 0%, rgba(201, 154, 75, 0.18), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(139, 192, 189, 0.12), transparent 45%),
    var(--panel);
  color: var(--panel-ink);
  overflow: hidden;
}
.community-card .kicker { color: var(--gold); }
.community-card h2 { color: var(--panel-ink); }
.community-copy p {
  max-width: 520px;
  color: var(--panel-muted);
  font-size: 0.95rem;
}
.community-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.8rem;
}
.community-card .btn-primary {
  background: #e8c48a;
  color: #1e2b26;
  box-shadow: none;
}
.community-card .btn-primary:hover { background: #f3d6a4; }
.community-card .btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: var(--panel-ink);
}
.community-card .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }

.ranking {
  padding: 1.4rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
}
.ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.ranking-head h3 {
  margin: 0;
  color: var(--panel-ink);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
}
.badge-soft {
  padding: 0.2rem 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--panel-muted);
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ranking-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.ranking-list li {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.82rem;
}
.ranking-list li:last-child { border-bottom: none; }
.ranking-list li.is-you {
  margin: 0 -0.5rem;
  padding: 0.65rem 0.5rem;
  border-radius: 8px;
  background: rgba(201, 154, 75, 0.14);
}
.rank-pos {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 0.9rem;
}
.rank-name {
  min-width: 0;
  overflow: hidden;
  color: var(--panel-ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rank-score {
  color: var(--panel-ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.ranking-list li.ranking-empty {
  display: block;
  padding: 1.15rem 0.35rem;
  border-bottom: none;
  color: var(--panel-muted);
  font-size: 0.76rem;
  line-height: 1.5;
  text-align: center;
}
.ranking-note {
  margin: 0.9rem 0 0;
  color: var(--panel-muted);
  font-size: 0.66rem;
  line-height: 1.5;
}

/* ---------- Pie ---------- */
.site-footer {
  padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem;
  border-top: 1px solid var(--line);
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
}
.footer-brand p {
  max-width: 330px;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.footer-nav {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.footer-nav h4 {
  margin-bottom: 0.9rem;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}
.footer-nav a, .footer-link {
  display: block;
  width: fit-content;
  margin: 0.45rem 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}
.footer-nav a:hover, .footer-link:hover { color: var(--accent); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.8rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.footer-bottom p {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
}

/* ---------- Diálogos ---------- */
dialog {
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: none;
  border-radius: 26px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.35);
}
dialog::backdrop {
  background: rgba(18, 15, 13, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
dialog[open] { animation: dialog-in 0.28s ease both; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

.dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.35rem 1.5rem;
  border-bottom: 1px solid var(--line);
}
.dialog-kicker {
  margin-bottom: 0.25rem;
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.dialog-head h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
}
.dialog-close { flex-shrink: 0; }

/* Diálogo de juego */
.game-dialog {
  width: min(940px, calc(100vw - 2rem));
  height: min(88dvh, 720px);
}
.game-dialog[open] { display: flex; flex-direction: column; }
.game-dialog .game-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  overscroll-behavior: contain;
}

/* Diálogo de acceso */
.login-dialog {
  display: none;
  grid-template-columns: 0.85fr 1.15fr;
  width: min(880px, calc(100vw - 2rem));
  overflow: hidden;
}
.login-dialog[open] { display: grid; }

.login-art {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
  background:
    radial-gradient(circle at 30% 20%, rgba(201, 154, 75, 0.22), transparent 55%),
    var(--panel);
  overflow: hidden;
}
.login-art-ring {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}
.login-art-ring:nth-child(1) { width: 340px; height: 340px; }
.login-art-ring:nth-child(2) { width: 250px; height: 250px; }
.login-art-ring:nth-child(3) { width: 160px; height: 160px; }
.login-art-word {
  position: relative;
  z-index: 1;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 8rem;
  font-style: italic;
  line-height: 1;
  opacity: 0.9;
}

.login-content {
  padding: clamp(1.8rem, 4vw, 2.8rem);
  overflow-y: auto;
}
.login-content h2 { margin-bottom: 0.7rem; font-size: clamp(1.8rem, 3vw, 2.4rem); }
.login-content > p { color: var(--muted); font-size: 0.88rem; }
.login-close {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 3;
  background: var(--header-bg);
}

.login-label {
  display: inline-block;
  max-width: 12ch;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
  white-space: nowrap;
}
.footer-link .login-label { max-width: 18ch; }

.oauth-list { display: grid; gap: 0.6rem; margin: 1.4rem 0 1rem; }
.oauth-btn {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 600;
  text-align: left;
  opacity: 0.72;
  cursor: not-allowed;
  transition: border-color 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}
.oauth-btn.is-available {
  opacity: 1;
  cursor: pointer;
}
.oauth-btn.is-available:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.oauth-btn svg { width: 20px; height: 20px; flex-shrink: 0; }
.oauth-btn .soon {
  margin-left: auto;
  padding: 0.18rem 0.45rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.login-note {
  margin-bottom: 1.2rem !important;
  color: var(--muted);
  font-size: 0.73rem !important;
  line-height: 1.55;
}
.login-status {
  margin: 0.2rem 0 1rem;
  padding: 0.62rem 0.75rem;
  border-radius: 10px;
  background: var(--bad-soft);
  color: var(--bad);
  font-size: 0.75rem;
  line-height: 1.45;
}
.login-status[data-kind="ok"] {
  background: var(--ok-soft);
  color: var(--ok);
}
.login-account {
  margin-top: 1.4rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-2);
}
.login-account-head {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.login-avatar {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff8ef;
  font-family: var(--font-display);
  font-size: 1.2rem;
  object-fit: cover;
  overflow: hidden;
}
.login-account-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.3;
}
.login-account-copy strong {
  overflow-wrap: anywhere;
  font-size: 0.92rem;
}
.login-account-copy span {
  color: var(--muted);
  font-size: 0.7rem;
}
.login-account-note {
  margin: 0.85rem 0 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* ---------- Juego: quiz ---------- */
.game-screen { display: flex; flex-direction: column; gap: 1rem; min-height: 100%; }

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
}
.quiz-top strong { color: var(--ink); }
.quiz-topic {
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  background: var(--sea-soft);
  color: var(--sea);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.game-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}
.game-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.35s ease;
}

.quiz-question {
  margin: 0.2rem 0 0.3rem;
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.8vw, 1.9rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.quiz-cycle-note {
  margin: 0;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
}

.quiz-options { display: grid; gap: 0.55rem; }
.quiz-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.9rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}
.quiz-option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.quiz-option:disabled { cursor: default; }
.quiz-option .letter {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 700;
  flex-shrink: 0;
}
.quiz-option.is-correct {
  border-color: var(--ok);
  background: var(--ok-soft);
}
.quiz-option.is-correct .letter {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}
.quiz-option.is-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
}
.quiz-option.is-wrong .letter {
  border-color: var(--bad);
  background: var(--bad);
  color: #fff;
}

.quiz-feedback {
  padding: 0.8rem 0.95rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 11px 11px 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}
.quiz-feedback strong { color: var(--ink); }
.quiz-feedback.is-ok { border-left-color: var(--ok); }
.quiz-feedback.is-bad { border-left-color: var(--bad); }

.quiz-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding-top: 0.5rem;
}
.quiz-actions-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.quiz-hint {
  color: var(--muted);
  font-size: 0.74rem;
}
.quiz-score-inline {
  color: var(--muted);
  font-size: 0.76rem;
}
.quiz-score-inline strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 1.05rem;
}

/* ---------- Resultados ---------- */
.result {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.5rem 0;
  text-align: center;
}
.result-ring {
  position: relative;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  margin-bottom: 0.8rem;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--score, 0) * 1%), var(--surface-2) 0);
}
.result-ring::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
}
.result-ring span {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  letter-spacing: -0.04em;
}
.result-ring small {
  display: block;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}
.result h3 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.result p { flex: 0 0 auto; max-width: 440px; margin: 0; color: var(--muted); font-size: 0.9rem; }
.result-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.result-points {
  margin-top: 0.2rem !important;
  color: var(--accent) !important;
  font-size: 0.78rem !important;
  font-weight: 600;
}
.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 1rem;
}

/* ---------- Juego: línea de tiempo ---------- */
.order-screen { display: flex; flex-direction: column; gap: 0.8rem; }
.order-intro {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.order-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.order-item {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.order-index {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}
.order-text strong { display: block; font-size: 0.87rem; line-height: 1.25; }
.order-text span { color: var(--muted); font-size: 0.7rem; }
.order-controls { display: flex; gap: 0.25rem; }
.order-controls button {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease;
}
.order-controls button:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.order-controls button:disabled { opacity: 0.25; cursor: default; }
.order-controls svg { width: 13px; height: 13px; }
.order-item.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.order-item.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.order-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.6rem;
}
.order-score { color: var(--muted); font-size: 0.8rem; }
.order-score strong { color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }

/* ---------- Juego: memorama ---------- */
.memory-screen { display: flex; flex-direction: column; gap: 0.8rem; }
.memory-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: 0.78rem;
}
.memory-bar strong { color: var(--ink); }
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
}
.memory-card {
  aspect-ratio: 4 / 3;
  padding: 0;
  border: none;
  background: transparent;
  perspective: 800px;
  cursor: pointer;
}
.memory-inner {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1);
  transform-style: preserve-3d;
}
.memory-card.is-flipped .memory-inner,
.memory-card.is-matched .memory-inner { transform: rotateY(180deg); }

.memory-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 0.55rem;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  text-align: center;
}
.memory-front {
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 50%),
    linear-gradient(135deg, var(--sea), #244a4d);
  color: rgba(255, 248, 239, 0.9);
  font-family: var(--font-display);
  font-size: 1.5rem;
}
.memory-back {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.25;
  transform: rotateY(180deg);
}
.memory-card.is-matched .memory-back {
  border-color: var(--ok);
  background: var(--ok-soft);
  color: var(--ok);
}
.memory-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.memory-card:disabled { cursor: default; }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  z-index: 100;
  padding: 0.7rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.8rem;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 18px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Enlace de salto ---------- */
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  z-index: 200;
  padding: 0.7rem 1rem;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.82rem;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* ---------- Adaptación a pantallas ---------- */
@media (max-width: 1024px) {
  .intro-grid { grid-template-columns: 1fr; gap: 1.2rem; }
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .news-card.is-featured { grid-column: span 2; }
  .games-grid { grid-template-columns: repeat(2, 1fr); }
  .game-card:last-child { grid-column: span 2; }
  .game-card:last-child { flex-direction: row; }
  .game-card:last-child .game-art { width: 38%; height: auto; min-height: 230px; }
  .game-card:last-child .game-body { width: 62%; }
}

@media (max-width: 900px) {
  .nav {
    position: absolute;
    top: 76px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.7rem 1.25rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    box-shadow: var(--shadow-soft);
    max-height: calc(100dvh - 76px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav.is-open { display: flex; }
  .nav a {
    padding: 0.75rem 0.2rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
  }
  .nav a:last-of-type { border-bottom: none; }
  .nav a.is-active::after { display: none; }
  .nav-login {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.9rem;
    padding: 0.85rem 1.1rem;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff8ef;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
  }
  .nav-login:hover { background: var(--accent-strong); }
  .nav-login svg { width: 18px; height: 18px; flex-shrink: 0; }
  .menu-toggle { display: inline-grid; }

  .timeline { padding-left: 1.6rem; }
  .timeline::before { left: 4px; }
  .timeline-item { grid-template-columns: 1fr; gap: 0.35rem; padding: 0.5rem 0; }
  .timeline-item::before { top: 1.35rem; left: calc(-1.6rem + 0px); }
  .timeline-year { padding-top: 0; text-align: left; font-size: 1rem; }

  .community-card { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 2.5rem; }

  .login-dialog[open] { display: block; }
  .login-art { display: none; }
  .login-dialog { max-height: calc(100dvh - 2rem); }
}

@media (max-width: 720px) {
  .hero { min-height: auto; padding-top: 4rem; }
  .hero-rings { width: 90vw; right: -38%; opacity: 0.45; }
  .hero-title { font-size: clamp(2.9rem, 13vw, 5rem); }
  .hero-stats { gap: 1.2rem; flex-wrap: wrap; }
  .scroll-cue { display: none; }

  .feature-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 0; }

  .news-grid { grid-template-columns: 1fr; }
  .news-card.is-featured { grid-column: span 1; }

  .games-grid { grid-template-columns: 1fr; }
  .game-card:last-child { grid-column: auto; flex-direction: column; }
  .game-card:last-child .game-art { width: 100%; min-height: 0; height: 172px; }
  .game-card:last-child .game-body { width: 100%; }

  .footer-nav { grid-template-columns: 1fr 1fr; }

  .game-dialog { width: calc(100vw - 1rem); height: calc(100dvh - 1rem); max-height: calc(100dvh - 1rem); border-radius: 20px; }
  .dialog-head { padding: 1.1rem 1.15rem; }
  .game-dialog .game-body { padding: 1.1rem; }
  .memory-grid { grid-template-columns: repeat(3, 1fr); }
  .memory-back { font-size: 0.68rem; }

  .quiz-actions, .order-actions { flex-direction: column; align-items: stretch; }
  .quiz-actions .btn, .order-actions .btn { width: 100%; }
  .quiz-actions-right { flex-direction: column; align-items: stretch; width: 100%; }
  .quiz-hint { text-align: center; }
  .order-score, .quiz-score-inline { text-align: center; }
}

@media (max-width: 520px) {
  .header-inner { height: 68px; }
  .nav { top: 68px; max-height: calc(100dvh - 68px); }
  .brand-text small { display: none; }
  .header-actions .login-trigger { display: none; }

  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-stats { justify-content: space-between; gap: 0.8rem; }
  .hero-stats span { font-size: 0.66rem; }

  .filter-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 0.4rem; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-btn { flex-shrink: 0; }

  .footer-nav { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }

  .game-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
  .memory-grid { gap: 0.4rem; }
  .memory-screen { flex: 1; }
  .memory-grid { margin: auto 0; }
  .memory-card { aspect-ratio: 1 / 1; }
  .memory-face { border-radius: 9px; }
  .memory-back { font-size: 0.6rem; padding: 0.35rem; }
  .memory-front { font-size: 1.2rem; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
