/* Gunka Games — una hoja para todo el sitio.
 *
 * Cada juego trae su paleta y sus fuentes como variables (las escribe
 * templates/game_base.html desde games/<juego>/game.json); aquí sólo hay
 * estructura y los pocos guiños propios de cada juego, al final. El
 * directorio usa los valores por defecto de :root.
 */

:root {
  --bg: #f4f1ea;
  --bg-deep: #e9e3d6;
  --surface: #fffdf8;
  --ink: #1b1d21;
  --muted: #5c6068;
  --line: #d6cfc1;
  --accent: #1b1d21;
  --accent-ink: #fffdf8;
  --font-display: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-strong: var(--font-body);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1.5px; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0; }

.wrap {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  padding: 8px 14px;
  background: var(--ink);
  color: var(--surface);
  border-radius: 8px;
  z-index: 10;
}
.skip:focus { top: 12px; }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

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

.eyebrow {
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 400;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.eyebrow a { text-decoration: none; }
.eyebrow a:hover { text-decoration: underline; }

/* ---- Barra superior --------------------------------------------------- */

.topbar { padding-block: 18px; }

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: -.01em;
  text-decoration: none;
}

.langs { position: relative; font-size: .92rem; }

.langs summary {
  list-style: none;
  cursor: pointer;
  padding: 6px 12px;
  border: 1.5px solid currentColor;
  border-radius: 999px;
}
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: " ▾"; font-size: .8em; }

.langs ul {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 5;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  box-shadow: 0 10px 30px rgb(0 0 0 / .12);
  min-width: 160px;
}

.langs a {
  display: block;
  padding: 7px 12px;
  border-radius: 9px;
  text-decoration: none;
}
.langs a:hover { background: var(--bg); }
.langs a[aria-current] { font-weight: 700; }

/* ---- Teléfono --------------------------------------------------------- */

.phone {
  background: var(--ink);
  padding: 5px;
  border-radius: 30px;
  box-shadow: 0 24px 50px -18px rgb(0 0 0 / .35);
}
.phone img { border-radius: 25px; width: 100%; }

/* ---- Portada de un juego ---------------------------------------------- */

.hero { padding-block: clamp(16px, 4vw, 48px) clamp(40px, 7vw, 88px); }

.hero-inner {
  display: grid;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

@media (min-width: 860px) {
  .hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); }
}

.hero-icon { border-radius: 22%; margin-bottom: 24px; box-shadow: 0 8px 20px -8px rgb(0 0 0 / .35); }

.hero h1 { font-size: clamp(2.3rem, 6vw, 3.9rem); letter-spacing: -.02em; }

.subtitle {
  font-family: var(--font-mono);
  font-size: .95rem;
  color: var(--muted);
  margin-top: .7rem;
}

.lead { font-size: 1.15rem; margin-top: 1.2rem; max-width: 36em; }
.lead + .lead { margin-top: .8rem; font-size: 1.05rem; color: var(--muted); }

.hero-shot { justify-self: center; width: min(300px, 78vw); }

/* ---- Botones de descarga ---------------------------------------------- */

.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 2rem;
}

.store {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  min-height: 54px;
  padding: 8px 20px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-strong);
  font-weight: 700;
  font-size: .98rem;
  line-height: 1.25;
  text-decoration: none;
}
.store:hover { filter: brightness(1.15); }

.store.is-soon {
  background: transparent;
  color: var(--muted);
  border: 1.5px dashed currentColor;
  cursor: default;
}
.store small {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.play { margin-top: 1.4rem; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }

.play-link {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-strong);
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 -3px 0 rgb(0 0 0 / .18);
}
.play-link:hover { filter: brightness(1.06); }

.play-note { font-size: .9rem; color: var(--muted); }

/* ---- Galería ---------------------------------------------------------- */

.gallery { padding-bottom: clamp(48px, 8vw, 96px); }

.shots {
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 8px max(var(--gutter), calc((100vw - 1120px) / 2 + var(--gutter))) 40px;
  list-style: none;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: max(var(--gutter), calc((100vw - 1120px) / 2 + var(--gutter)));
  scrollbar-width: thin;
}

.shots li { flex: 0 0 auto; width: clamp(180px, 46vw, 236px); scroll-snap-align: start; }

.shots figure { margin: 0; }

.shots figcaption { margin-top: 14px; font-size: .9rem; line-height: 1.45; color: var(--muted); }

/* ---- Secciones de la descripción -------------------------------------- */

.feature { padding-block: clamp(36px, 6vw, 64px); border-top: 1.5px solid var(--line); }

.feature-text { font-size: 1.15rem; max-width: 40em; }
.feature-text + .feature-text { margin-top: 1rem; }

.points {
  display: grid;
  gap: 14px 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
@media (min-width: 760px) { .points { grid-template-columns: 1fr 1fr; } }

.points li { position: relative; padding-left: 26px; }
.points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--accent);
}
.points strong { font-family: var(--font-strong); font-weight: 700; }
.points strong::after { content: " —"; font-weight: 400; color: var(--muted); }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr));
  gap: clamp(12px, 2.5vw, 20px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 14px 18px;
  background: var(--surface);
  border-radius: var(--radius);
}
.card .phone { padding: 0; border-radius: 14px; overflow: hidden; aspect-ratio: 480 / 560; margin-bottom: 10px; box-shadow: none; }
.card .phone img { border-radius: 0; height: 100%; object-fit: cover; object-position: top; }
.card h3 { font-size: 1.15rem; }
.card p { font-size: .95rem; line-height: 1.45; color: var(--muted); }

/* ---- Llamada final ---------------------------------------------------- */

.cta { padding-block: clamp(48px, 8vw, 96px); }

.cta-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cta-icon { border-radius: 22%; margin-bottom: 18px; }
.cta h2 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); }
.cta p { margin-top: .8rem; max-width: 34em; color: var(--muted); }
.cta .stores, .cta .play { justify-content: center; }

/* ---- Documentos (privacidad, soporte) --------------------------------- */

.doc { max-width: 760px; padding-block: clamp(24px, 5vw, 56px) clamp(56px, 8vw, 96px); }
.doc h1 { font-size: clamp(2rem, 5vw, 2.8rem); margin-bottom: 1.4rem; }
.doc h2 { font-size: 1.35rem; margin: 2.2rem 0 .8rem; }
.doc h3 { font-size: 1.1rem; margin: 1.6rem 0 .6rem; }
.doc p, .doc ul, .doc ol, .doc table { margin: 0 0 1rem; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li + li { margin-top: .35rem; }
.doc a { overflow-wrap: anywhere; }
.doc table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc strong { font-family: var(--font-strong); font-weight: 700; }
.doc code { font-family: var(--font-mono); font-size: .88em; }
.doc .lead { margin: 0 0 1rem; }

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

.footer {
  padding-block: 36px 48px;
  border-top: 1.5px solid var(--line);
  font-size: .92rem;
  color: var(--muted);
}

.footer-inner { display: grid; gap: 14px; }

.footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.footer-links a { color: var(--ink); font-weight: 600; }
.footer-games a { text-decoration: none; }
.footer-games a:hover, .footer-studio a:hover { text-decoration: underline; }
.footer-studio a { text-decoration: none; color: var(--ink); }

/* ---- Directorio ------------------------------------------------------- */

.intro { padding-block: clamp(32px, 8vw, 104px) clamp(32px, 6vw, 64px); }
.intro h1 { font-size: clamp(2.4rem, 7vw, 4.6rem); letter-spacing: -.03em; font-weight: 800; max-width: 12em; }
.intro .lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); max-width: 34em; margin-top: 1.4rem; color: var(--muted); }

.catalog { padding-bottom: clamp(56px, 9vw, 120px); }

.game-cards { display: grid; gap: 24px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .game-cards { grid-template-columns: 1fr 1fr; } }

.game-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(110px, 28%, 170px);
  gap: 20px;
  padding: clamp(22px, 4vw, 34px);
  border-radius: 28px;
  background: linear-gradient(160deg, var(--bg), var(--bg-deep));
  color: var(--ink);
  overflow: hidden;
  transition: transform .2s ease;
}
.game-card:hover { transform: translateY(-3px); }
.game-card:focus-within { outline: 3px solid var(--ink); outline-offset: 3px; }

.game-card img { border-radius: 22%; }
.game-card h3 { font-size: clamp(1.5rem, 3.4vw, 2rem); margin-top: 18px; }
.game-card h3 a { text-decoration: none; }
/* Toda la tarjeta es el enlace, sin anidar nada dentro de un <a>. */
.game-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: 28px; }
.game-card h3 a:focus-visible { outline: none; }
.game-card-sub { font-size: .95rem; font-weight: 600; color: var(--muted); margin: 6px 0 14px; }
.game-card p { font-size: .98rem; }
.game-card-more {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  font-size: .92rem;
}
.game-card-shot { align-self: end; margin-bottom: calc(-1 * clamp(60px, 10vw, 110px)); }
.game-card-shot img { border-radius: 20px; }
.game-card .phone { border-radius: 25px; padding: 4px; }

@media (max-width: 520px) {
  .game-card { grid-template-columns: 1fr; }
  .game-card-shot { display: none; }
}

/* ---- El candado del día ----------------------------------------------- */

.game-candado {
  background: linear-gradient(180deg, var(--bg) 0, var(--bg-deep) 1400px, var(--bg-deep)) no-repeat, var(--bg-deep);
}
.game-candado h1, .game-candado h2, .game-candado h3 { letter-spacing: -.015em; }
.game-candado .card { border: 1.5px solid var(--line); }
.game-candado .feature { border-top-color: rgb(21 23 27 / .14); }
.game-candado .store { border-radius: 12px; }
.game-candado .play-link { border-radius: 14px; text-transform: uppercase; letter-spacing: .04em; font-family: var(--font-display); font-size: .95rem; }

/* ---- Toilet Games ----------------------------------------------------- */

/* Los azulejos del fondo del juego: líneas blancas sobre menta. */
.game-toilet-games {
  background-color: var(--bg);
  background-image:
    linear-gradient(rgb(255 255 255 / .7) 3px, transparent 3px),
    linear-gradient(90deg, rgb(255 255 255 / .7) 3px, transparent 3px);
  background-size: 64px 64px;
}
.game-toilet-games .subtitle,
.game-toilet-games .eyebrow,
.game-toilet-games .store small { font-family: var(--font-strong); letter-spacing: .08em; }
.game-toilet-games .subtitle { text-transform: none; letter-spacing: 0; font-size: 1.05rem; }
.game-toilet-games .card,
.game-toilet-games .phone {
  border: 3px solid var(--ink);
}
.game-toilet-games .card { box-shadow: 0 5px 0 var(--ink); }
.game-toilet-games .card .phone { border-width: 2px; }
.game-toilet-games .phone { padding: 0; background: var(--ink); }
.game-toilet-games .phone img { border-radius: 26px; }
.game-toilet-games .card .phone img { border-radius: 0; }
.game-toilet-games .store,
.game-toilet-games .play-link { border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.game-toilet-games .store.is-soon { border-style: dashed; box-shadow: none; }
.game-toilet-games .feature,
.game-toilet-games .footer { border-top: 3px solid var(--ink); }
.game-toilet-games .feature, .game-toilet-games .cta, .game-toilet-games .footer { background: rgb(251 246 238 / .82); }
.game-toilet-games .points li::before { border-radius: 50%; border: 2px solid var(--ink); width: 12px; height: 12px; }
.game-toilet-games .langs ul { border-width: 3px; }

/* ---- Kintze ----------------------------------------------------------- */

/* El cartel del juego: papel arriba, el suelo de la cancha con sus rayas
   abajo, sombras de tinta sólida y esquinas casi rectas. */
.game-kintze {
  background:
    repeating-linear-gradient(180deg, transparent 0 46px, #d9bc7e 46px 48px) 0 1000px / 100% 100% no-repeat,
    linear-gradient(180deg, var(--bg) 0 1000px, var(--bg-deep) 1000px);
  background-color: var(--bg-deep);
}
.game-kintze .subtitle { font-family: var(--font-body); font-size: 1.05rem; }
.game-kintze .eyebrow,
.game-kintze .store small { font-family: var(--font-strong); letter-spacing: .08em; }
.game-kintze .eyebrow { color: #106b59; }
/* La quiniela se explica con el circuito dentro: tarjetas más anchas, para
   que esa no salga como una columna. */
.game-kintze .cards { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.game-kintze .hero-icon { border-radius: 18%; box-shadow: 0 5px 0 var(--ink); }
.game-kintze .phone { border-radius: 8px; padding: 4px; box-shadow: 6px 6px 0 var(--ink); }
.game-kintze .phone img { border-radius: 5px; }
.game-kintze .card .phone { box-shadow: none; border-radius: 4px; }
.game-kintze .card .phone img { border-radius: 0; }
.game-kintze .card { border: 3px solid var(--ink); border-radius: 6px; box-shadow: 0 5px 0 var(--ink); }
.game-kintze .store,
.game-kintze .play-link { border-radius: 6px; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); }
.game-kintze .store.is-soon { border-style: dashed; box-shadow: none; }
.game-kintze .feature { border-top: 3px solid var(--ink); }
.game-kintze .feature, .game-kintze .cta, .game-kintze .footer { background: rgb(255 246 227 / .86); }
.game-kintze .footer { border-top: 3px solid var(--ink); }
/* La franja roja de la chapa, bajo cada sección. */
.game-kintze .points li::before { border-radius: 0; background: #e63b2e; width: 14px; height: 6px; top: .65em; }
.game-kintze .langs ul { border-width: 3px; border-radius: 6px; }

@media (prefers-reduced-motion: reduce) {
  .game-card { transition: none; }
  .game-card:hover { transform: none; }
}
