/*
 * La misma identidad que la app, «papel y color» (apps/app/src/styles.css): papel cálido, terracota
 * como único acento y letra Nunito. Los colores son los mismos que allí. La web no tiene scripts:
 * todo lo que se mueve o se abre (la pieza que flota, las preguntas) es CSS y HTML.
 */

/* Nunito va en la propia web (fonts/), no se descarga de Google Fonts. Licencia: fonts/OFL.txt */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('/fonts/nunito-latin-ext.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF,
    U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-display: swap;
  font-weight: 200 1000;
  src: url('/fonts/nunito-latin.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light dark;
  --bg: #f8f5ef;
  --surface: #ffffff;
  --text: #1e1c1a;
  --muted: #6e6a64;
  --line: #e7e1d7;
  /* La mesa de juego de la app: fondo de las bandas y de las capturas */
  --canvas: #ece7df;
  /* Enlaces: el terracota oscuro, que se lee bien sobre el papel */
  --accent: #a3401f;
  --accent-soft: #fbe4db;
  /* Botón principal, como el de la app */
  --primary: #c8502f;
  --primary-pressed: #b04325;
  --on-primary: #ffffff;
  --phone: #1e1c1a;
  --shadow: 0 6px 22px rgba(30, 28, 26, 0.09);
  --shadow-big: 0 30px 60px -24px rgba(30, 28, 26, 0.45);
  --radius: 20px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1916;
    --surface: #262320;
    --text: #f3eee6;
    --muted: #b3aca2;
    --line: #3a3632;
    --canvas: #12110f;
    --accent: #ffb59e;
    --accent-soft: #4a2a20;
    --primary: #e27556;
    --primary-pressed: #d4674a;
    --on-primary: #2a120a;
    --phone: #0b0a09;
    --shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
    --shadow-big: 0 30px 60px -24px rgba(0, 0, 0, 0.8);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 17px/1.6 'Nunito', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

img {
  max-width: 100%;
}

a {
  color: var(--accent);
  font-weight: 700;
}

.wrap {
  width: min(1120px, 100% - 32px);
  margin-inline: auto;
}

.prose {
  width: min(720px, 100% - 32px);
  margin-inline: auto;
}

/* ---------- Cabecera ---------- */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* ---------- Botones e insignias ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 14px 30px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 19px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 10px 24px -10px rgba(200, 80, 47, 0.7);
  transition: background-color 0.15s, transform 0.15s;
}

.btn:hover {
  background: var(--primary-pressed);
}

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

.btn:focus-visible,
.faq summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn svg {
  width: 20px;
  height: 20px;
}

.btn-small {
  min-height: 40px;
  padding: 8px 20px;
  font-size: 16px;
  box-shadow: none;
}

.btn-light {
  background: #ffffff;
  color: #a3401f;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.5);
}

.btn-light:hover {
  background: #fbe4db;
}

.stores {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

/* Las insignias oficiales de Apple y Google, sin tocar: misma altura las dos */
.badge,
.badge img {
  display: block;
  height: 48px;
  width: auto;
}

.soon {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

/* ---------- Portada ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  align-items: center;
  gap: 56px;
  padding-block: 40px 88px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 6.4vw, 68px);
  font-weight: 900;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead {
  max-width: 32em;
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.5;
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 28px;
}

.cta-note {
  color: var(--muted);
  font-weight: 700;
}

.hero-art {
  position: relative;
  margin: 0;
  padding: 0 0 8% 14%;
}

.table-shot {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 28px;
  background: var(--canvas);
  box-shadow: var(--shadow-big);
}

.hero-art .phone {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 33%;
  transform: rotate(-4deg);
}

/* ---------- El móvil con una captura ---------- */

.phone {
  width: min(290px, 100%);
  padding: 7px;
  border-radius: 40px;
  background: var(--phone);
  box-shadow: var(--shadow-big), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.phone img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 600 / 1304;
  border-radius: 33px;
}

/* ---------- Cifras ---------- */

.facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.facts li {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.facts strong {
  display: block;
  color: var(--accent);
  font-size: 30px;
  font-weight: 900;
  line-height: 1.15;
}

.facts span {
  color: var(--muted);
  font-weight: 700;
  line-height: 1.35;
}

/* ---------- Secciones ---------- */

.section {
  padding-block: 96px;
}

h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4.2vw, 44px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.section-intro {
  max-width: 40em;
  margin: 0 0 36px;
  color: var(--muted);
  font-size: 19px;
  font-weight: 600;
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 64px;
}

.feature-text > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 19px;
  font-weight: 600;
}

.feature-art {
  position: relative;
  display: flex;
  justify-content: center;
  padding-block: 32px;
}

/* Detrás del móvil, la mesa de juego */
.feature-art::before {
  content: '';
  position: absolute;
  inset: 0 6%;
  border-radius: 40px;
  background: var(--canvas);
}

.feature-art .phone {
  position: relative;
  width: min(280px, 72%);
}

.feature-reverse .feature-art {
  order: -1;
}

/* Viñetas con forma de pieza */
.checks {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  position: relative;
  margin-bottom: 12px;
  padding-left: 34px;
  font-size: 18px;
  font-weight: 700;
}

.checks li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  background: var(--primary);
  -webkit-mask: url('/img/pieza.svg') center / contain no-repeat;
  mask: url('/img/pieza.svg') center / contain no-repeat;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 16px;
  font-weight: 700;
}

/* ---------- Colecciones ---------- */

.band {
  background: var(--canvas);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gallery li {
  position: relative;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/*
 * «La última pieza», como el icono: a una imagen le falta una pieza (hueco.svg) y la pieza flota
 * encima, a punto de encajar. Las dos máscaras están dibujadas sobre una baldosa de 400 × 300, la
 * proporción de las imágenes; la pieza ocupa (262, 139)-(351, 228) en ella (scripts: ver pieza.svg).
 */
.gallery .missing {
  filter: drop-shadow(0 6px 14px rgba(30, 28, 26, 0.16));
}

/* El fondo del hueco, un poco más oscuro que la mesa para que se lea como un hueco */
.gallery .missing::before {
  content: '';
  position: absolute;
  left: 65.5%;
  top: 46.33%;
  width: 22.25%;
  height: 29.67%;
  background: rgba(30, 28, 26, 0.22);
  -webkit-mask: url('/img/pieza.svg') 0 0 / 100% 100% no-repeat;
  mask: url('/img/pieza.svg') 0 0 / 100% 100% no-repeat;
}

.gallery .missing img {
  box-shadow: none;
  -webkit-mask: url('/img/hueco.svg') 0 0 / 100% 100% no-repeat;
  mask: url('/img/hueco.svg') 0 0 / 100% 100% no-repeat;
}

.loose {
  position: absolute;
  left: 65.5%;
  top: 46.33%;
  width: 22.25%;
  height: 29.67%;
  /* Un filo claro, como el canto de una pieza recortada, y la sombra de estar levantada */
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.95)) drop-shadow(0 0 1px rgba(255, 255, 255, 0.95))
    drop-shadow(0 18px 14px rgba(20, 16, 10, 0.5));
  animation: hover-piece 5s ease-in-out infinite;
}

.loose span {
  display: block;
  width: 100%;
  height: 100%;
  background: url('/img/casas-junto-al-mar.webp') 84.24% 65.88% / 449.44% 337.08% no-repeat;
  -webkit-mask: url('/img/pieza.svg') 0 0 / 100% 100% no-repeat;
  mask: url('/img/pieza.svg') 0 0 / 100% 100% no-repeat;
}

@keyframes hover-piece {
  0%,
  100% {
    transform: translate(30%, -74%) rotate(-14deg) scale(1.08);
  }
  50% {
    transform: translate(30%, -86%) rotate(-10deg) scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .loose {
    animation: none;
    transform: translate(30%, -78%) rotate(-12deg) scale(1.08);
  }
}

.packs-note {
  margin: 28px 0 0;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- Dónde jugar ---------- */

.platforms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.platform {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
}

.platform h3 {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
}

.platform p:not(.soon) {
  flex: 1;
  margin: 0 0 24px;
  color: var(--muted);
  font-weight: 600;
}

.platform .soon {
  margin-top: 8px;
}

/* ---------- Preguntas ---------- */

.faq {
  max-width: 760px;
}

.faq details {
  border-bottom: 1px solid var(--line);
}

.faq summary {
  position: relative;
  padding: 20px 44px 20px 0;
  font-size: 19px;
  font-weight: 800;
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: '+';
  position: absolute;
  right: 4px;
  top: 50%;
  translate: 0 -50%;
  color: var(--accent);
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
}

.faq details[open] summary::after {
  content: '–';
}

.faq details p {
  margin: 0 0 20px;
  color: var(--muted);
}

/* ---------- Cierre ---------- */

.closing {
  padding: 72px 24px;
  border-radius: 36px;
  /* El degradado de la pantalla de arranque de la app */
  background: linear-gradient(135deg, #e27556, #b84222);
  color: #ffffff;
  text-align: center;
}

.closing h2 {
  margin-bottom: 10px;
}

.closing p {
  margin: 0 auto 28px;
  max-width: 30em;
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  font-weight: 600;
}

.closing .stores {
  justify-content: center;
  margin-top: 24px;
}

.closing .soon {
  color: rgba(255, 255, 255, 0.8);
}

/* ---------- Páginas legales ---------- */

.prose h1 {
  margin-top: 24px;
  font-size: clamp(30px, 5vw, 40px);
  line-height: 1.1;
}

.prose h2 {
  margin: 36px 0 8px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.prose li {
  margin-bottom: 8px;
}

.updated {
  color: var(--muted);
}

/* ---------- Pie ---------- */

footer {
  margin-top: 96px;
  padding-block: 24px 32px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 10px;
}

footer p {
  margin: 0;
}

/* ---------- Pantallas estrechas ---------- */

@media (max-width: 900px) {
  .hero,
  .feature {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .hero {
    padding-block: 16px 64px;
  }

  .feature-reverse .feature-art {
    order: 0;
  }

  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .section {
    padding-block: 72px;
  }
}

@media (max-width: 600px) {
  body {
    font-size: 16px;
  }

  .top-nav {
    gap: 14px;
  }

  .lead,
  .section-intro,
  .feature-text > p {
    font-size: 18px;
  }

  .cta .btn {
    width: 100%;
  }

  .hero-art {
    padding: 0 0 14% 20%;
  }

  .hero-art .phone {
    width: 38%;
    padding: 5px;
    border-radius: 26px;
  }

  .hero-art .phone img {
    border-radius: 21px;
  }

  .facts li {
    padding: 16px;
  }

  .facts strong {
    font-size: 24px;
  }

  .gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .gallery img {
    border-radius: 14px;
  }

  .badge,
  .badge img {
    height: 44px;
  }

  .closing {
    padding: 56px 20px;
    border-radius: 28px;
  }

  .section {
    padding-block: 56px;
  }

  footer {
    margin-top: 64px;
  }
}

/* Insignia con enlace (la del App Store desde el 18 nov 2026; la de Google Play, al publicarse) */
.store-link {
  display: block;
  border-radius: 8px;
}

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

/* ---------- Guías (apps/site/guias, las genera scripts/guias.py) ---------- */

.breadcrumbs {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.breadcrumbs li + li::before {
  content: '›';
  margin-right: 8px;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.guides-header {
  padding-block: 24px 40px;
}

.guides-header h1 {
  max-width: 16em;
}

.article {
  width: min(740px, 100% - 32px);
  margin-inline: auto;
}

.article-header {
  padding-block: 24px 32px;
}

.article-header h1 {
  margin-bottom: 14px;
  font-size: clamp(34px, 5.6vw, 54px);
}

.article-meta {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.article-hero {
  width: min(1040px, 100% - 32px);
  margin: 0 auto 48px;
}

.article-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 28px;
  background: var(--canvas);
  box-shadow: var(--shadow-big);
}

.article-body {
  font-size: 18px;
  line-height: 1.75;
}

.article-body > p:first-of-type,
.article-body .intro {
  font-size: 20px;
  font-weight: 600;
}

.article-body h2 {
  margin: 56px 0 14px;
  font-size: clamp(26px, 3.6vw, 34px);
  line-height: 1.2;
  scroll-margin-top: 24px;
}

.article-body h3 {
  margin: 32px 0 8px;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
}

.article-body ul,
.article-body ol {
  padding-left: 1.3em;
}

.article-body li {
  margin-bottom: 8px;
}

.article-body li::marker {
  color: var(--accent);
  font-weight: 800;
}

.toc {
  margin: 0 0 40px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 17px;
}

.toc h2 {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
}

.toc li {
  margin-bottom: 4px;
}

.callout {
  margin: 32px 0;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.callout p {
  margin: 0;
}

.callout p + p {
  margin-top: 10px;
}

.callout strong {
  color: var(--accent);
}

.table-wrap {
  margin: 28px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}

.article-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  line-height: 1.45;
}

.article-body th,
.article-body td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.article-body tr:last-child td {
  border-bottom: none;
}

.article-body th {
  background: var(--canvas);
  font-weight: 800;
}

.article-body figure {
  margin: 32px 0;
}

.article-body figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.article-body figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

/* Los cortes de verdad del motor (img/cortes/*.svg) sobre una ilustración */
.article-body .cuts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}

.cuts li {
  margin: 0;
}

.cut-demo {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 16px;
  background: url('/img/callejuela.webp') center / cover no-repeat;
}

.cut-demo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.cuts p {
  margin: 8px 0 0;
  font-size: 16px;
  font-weight: 800;
}

.sources {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.sources h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.sources li {
  overflow-wrap: anywhere;
}

.article-cta {
  margin-top: 72px;
}

.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  color: inherit;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
}

.guide-card a:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.guide-card a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.guide-card img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.guide-card div {
  padding: 18px 20px 22px;
}

.guide-card .eyebrow {
  margin-bottom: 6px;
  font-size: 13px;
}

.guide-card h2,
.guide-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: 0;
}

.guide-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
}

.related h2 {
  margin-bottom: 28px;
}

.more-link {
  margin: 28px 0 0;
  font-size: 18px;
}

@media (max-width: 900px) {
  .guide-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .guide-cards,
  .cuts {
    grid-template-columns: 1fr;
  }

  .article-body {
    font-size: 17px;
  }

  .article-body > p:first-of-type,
  .article-body .intro {
    font-size: 18px;
  }

  .article-hero img {
    border-radius: 20px;
  }
}
