/* play.kynoralabs.com — store for Kynora Labs games */

@font-face {
  font-family: "Poppins";
  src: url("/fonts/Poppins-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("/fonts/Poppins-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --surface: #f4f5fb;
  --surface-strong: #e9ebf5;
  --line: #e1e4ef;
  --text: #11142a;
  --muted: #5a6078;
  --accent: #4f46e5;
  --brand-gradient: linear-gradient(120deg, #22d3ee 0%, #3b82f6 38%, #7c3aed 72%, #d946ef 100%);
  --button-gradient: linear-gradient(120deg, #2563eb 0%, #6d28d9 60%, #a21caf 100%);
  --radius: 20px;
  --shadow: 0 1px 2px rgb(17 20 42 / 6%), 0 10px 28px rgb(17 20 42 / 8%);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d17;
    --surface: #141827;
    --surface-strong: #1c2136;
    --line: #262c44;
    --text: #eef1fb;
    --muted: #a3abc6;
    --accent: #9aa2ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 12px 32px rgb(0 0 0 / 40%);
  }
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

h1,
h2,
h3 {
  font-weight: 600;
  line-height: 1.2;
  margin: 0;
  letter-spacing: -0.01em;
}

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

.container {
  width: 100%;
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right));
}

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

svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
  flex: none;
}

/* ---------- Top bar ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  height: 34px;
  width: auto;
}

.brand-tag {
  font-weight: 600;
  font-size: 13px;
  padding: 3px 10px;
  border-radius: 999px;
  color: #fff;
  background: var(--button-gradient);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-left: -10px;
  border-radius: 50%;
  color: var(--text);
}

.icon-button:hover {
  background: var(--surface);
}

.search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 42vw);
  height: 44px;
  padding-inline: 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--muted);
}

.search:focus-within {
  border-color: var(--accent);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: none;
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 600 15px/1 var(--font);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}

.button:active {
  transform: scale(0.97);
}

.button-primary {
  color: #fff;
  background: var(--button-gradient);
  box-shadow: 0 6px 18px rgb(79 70 229 / 30%);
}

.button-primary:hover {
  filter: brightness(1.08);
}

.button-secondary {
  color: var(--accent);
  background: transparent;
  border-color: var(--line);
}

.button-secondary:hover {
  background: var(--surface);
}

.button-on-dark {
  color: #fff;
  border-color: rgb(255 255 255 / 45%);
  background: rgb(255 255 255 / 8%);
}

.button-on-dark:hover {
  background: rgb(255 255 255 / 16%);
}

.button-lg {
  min-height: 50px;
  font-size: 16px;
}

/* ---------- App icons, badges ---------- */

.app-icon {
  width: 72px;
  height: 72px;
  border-radius: 22%;
  flex: none;
  box-shadow: 0 1px 2px rgb(0 0 0 / 12%), 0 4px 14px rgb(0 0 0 / 14%);
  background: var(--surface-strong);
}

.app-icon-lg {
  width: 88px;
  height: 88px;
}

.app-icon-xl {
  width: 112px;
  height: 112px;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badges span {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  color: var(--muted);
  background: var(--surface-strong);
}

/* ---------- Hero ---------- */

.heroes {
  display: grid;
  gap: 16px;
}

/* Two or more featured games: a snap carousel where the next one peeks at the edge. */
.heroes.is-carousel {
  display: flex;
  gap: 14px;
  margin: 20px -16px 0;
  padding: 0 16px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
  scrollbar-width: none;
}

.heroes.is-carousel::-webkit-scrollbar {
  display: none;
}

.heroes.is-carousel .hero {
  flex: 0 0 86%;
  margin-top: 0;
  scroll-snap-align: start;
}

@media (min-width: 760px) {
  .heroes.is-carousel .hero {
    flex-basis: 66%;
  }
}

@media (min-width: 1100px) {
  .heroes.is-carousel .hero {
    flex-basis: 49%;
  }
}

.hero {
  position: relative;
  overflow: hidden;
  margin-top: 20px;
  border-radius: 28px;
  color: #fff;
  background:
    radial-gradient(120% 90% at 90% 10%, color-mix(in srgb, var(--game-accent) 35%, transparent) 0%, transparent 55%),
    linear-gradient(135deg, var(--from) 0%, var(--to) 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 28px 22px 0;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 10%);
}

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 14%);
  margin-bottom: 16px;
}

.hero-app {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero h1,
.hero .hero-title {
  font-size: clamp(26px, 5vw, 38px);
}

.hero-meta {
  margin: 4px 0 0;
  color: rgb(255 255 255 / 78%);
}

.hero-tagline {
  font-size: 17px;
  margin: 18px 0 22px;
  max-width: 34ch;
  color: rgb(255 255 255 / 92%);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-shots {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 14px;
  height: 300px;
  overflow: hidden;
}

.hero-shots img {
  width: 150px;
  height: auto;
  border-radius: 22px;
  border: 5px solid rgb(0 0 0 / 55%);
  box-shadow: 0 20px 40px rgb(0 0 0 / 40%);
  transform: translateY(28px);
}

.hero-shots img:nth-child(2) {
  transform: translateY(64px);
}

.hero.is-card .hero-tagline {
  font-size: 16px;
  max-width: 40ch;
}

.hero.is-card .hero-shots {
  height: 230px;
}

.hero.is-card .hero-shots img {
  width: 132px;
}

@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.1fr 1fr;
    align-items: center;
    padding: 44px 48px 0;
    min-height: 380px;
  }

  .hero-text {
    padding-bottom: 44px;
  }

  .hero-shots {
    height: 380px;
    align-self: end;
  }

  .hero-shots img {
    width: 190px;
  }

  .hero.is-card {
    grid-template-columns: 1.15fr 0.85fr;
    padding: 32px 30px 0;
    min-height: 300px;
  }

  .hero.is-card h1,
  .hero.is-card .hero-title {
    font-size: clamp(24px, 2.4vw, 30px);
  }

  .hero.is-card .hero-text {
    padding-bottom: 32px;
  }

  .hero.is-card .hero-shots {
    height: 300px;
  }

  .hero.is-card .hero-shots img {
    width: 150px;
  }
}

/* ---------- Chips ---------- */

.chips {
  display: flex;
  gap: 8px;
  margin: 24px 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.chips::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: none;
  min-height: 38px;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 600 14px/1 var(--font);
  cursor: pointer;
}

.chip:hover {
  background: var(--surface);
}

.chip.is-active {
  color: #fff;
  border-color: transparent;
  background: var(--button-gradient);
}

/* ---------- Sections, game cards ---------- */

.section {
  margin-top: 24px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-head h2 {
  font-size: 21px;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 12px;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.game-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.game-card h3 {
  font-size: 17px;
}

.game-card-meta {
  font-size: 13px;
  color: var(--muted);
}

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

.empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
}

.install-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.install-card > div {
  flex: 1 1 260px;
}

.install-card h2 {
  font-size: 18px;
  margin-bottom: 4px;
}

.install-card p {
  margin: 0;
}

/* ---------- Store listing ---------- */

.listing {
  padding-top: 24px;
}

.listing-head {
  display: flex;
  align-items: center;
  gap: 20px;
}

.listing-head h1 {
  font-size: clamp(26px, 5vw, 36px);
}

.developer {
  display: inline-block;
  margin-top: 4px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.listing-head p {
  margin: 2px 0 0;
  font-size: 14px;
}

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

.stats li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  text-align: center;
  min-width: 0;
}

.stats li + li {
  border-left: 1px solid var(--line);
}

.stats strong {
  font-size: 14px;
}

.stats span {
  font-size: 11px;
  line-height: 1.3;
  color: var(--muted);
}

@media (min-width: 640px) {
  .stats {
    max-width: 640px;
  }

  .stats strong {
    font-size: 15px;
  }

  .stats span {
    font-size: 12px;
  }
}

.listing-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 22px;
}

@media (min-width: 640px) {
  .listing-actions {
    grid-template-columns: repeat(2, max-content);
  }

  .listing-actions .button {
    padding-inline: 32px;
  }
}

/* "Jugar en CrazyGames": only on listings that declare the address. Deliberately lighter than the two main actions,
   sized to its text so it never becomes a third full-width button on a phone. */
.alt-play {
  display: flex;
  /* El botón y, debajo, el aviso del nombre: por eso en columna y alineados a la izquierda. */
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 10px;
}

/* Allí el juego se llama distinto. Chico y en gris: es una aclaración, no una promesa. */
.alt-play-note {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.alt-play .button {
  max-width: 100%;
  font-size: 14px;
}

.alt-play svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.shots {
  display: flex;
  gap: 12px;
  margin: 26px -16px 0;
  padding: 4px 16px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 16px;
}

.shots img {
  flex: none;
  height: 380px;
  width: auto;
  border-radius: 18px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

@media (min-width: 760px) {
  .shots img {
    height: 460px;
  }
}

.block {
  margin-top: 30px;
  max-width: 760px;
}

.block h2 {
  font-size: 20px;
  margin-bottom: 12px;
}

.block p {
  margin: 0 0 12px;
}

.lead {
  font-size: 17px;
  font-weight: 600;
}

.highlights,
.news {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.highlights li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.highlights svg {
  color: #fff;
  background: var(--button-gradient);
  border-radius: 50%;
  padding: 3px;
  margin-top: 1px;
}

.news li {
  position: relative;
  padding-left: 18px;
}

.news li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.62em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-gradient);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.info {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px 24px;
}

.info dt {
  font-size: 13px;
  color: var(--muted);
}

.info dd {
  margin: 2px 0 0;
  font-weight: 600;
}

.info a {
  color: var(--accent);
  text-decoration: none;
}

/* ---------- Install sheet ---------- */

.sheet {
  width: min(560px, 100%);
  max-width: 100%;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow);
}

.sheet::backdrop {
  background: rgb(5 7 15 / 55%);
}

@media (min-width: 640px) {
  .sheet {
    margin: auto;
    border-radius: 24px;
  }
}

.sheet-inner {
  display: grid;
  gap: 14px;
  padding: 14px 22px calc(22px + env(safe-area-inset-bottom));
}

.sheet-handle {
  justify-self: center;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}

.sheet h2 {
  font-size: 20px;
}

.install-steps {
  display: grid;
  gap: 12px;
}

@media (min-width: 520px) {
  .install-steps {
    grid-template-columns: 1fr 1fr;
  }
}

.install-steps section {
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--surface);
}

.install-steps h3 {
  font-size: 15px;
  margin-bottom: 6px;
}

.install-steps ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
}

.sheet p {
  margin: 0;
  font-size: 14px;
}

/* ---------- Footer ---------- */

.footer {
  margin-top: 48px;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  font-size: 14px;
  color: var(--muted);
}

.footer-links {
  margin-left: auto;
  display: flex;
  gap: 18px;
}

.footer-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* ---------- Legal pages ---------- */

.legal {
  max-width: 760px;
  padding-top: 28px;
}

.legal h1 {
  font-size: clamp(28px, 5vw, 38px);
}

.legal .updated {
  margin: 6px 0 0;
  font-size: 14px;
}

.lang-switch {
  display: inline-block;
  margin-top: 10px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.legal .intro {
  font-size: 16px;
  margin: 22px 0 0;
}

.legal section {
  margin-top: 28px;
}

.legal h2 {
  font-size: 20px;
  margin-bottom: 10px;
}

.legal p {
  margin: 0 0 12px;
}

.legal ul {
  margin: 0 0 12px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.legal a {
  color: var(--accent);
}

@media (max-width: 420px) {
  .brand img {
    height: 28px;
  }

  .search {
    width: 44px;
    padding: 0;
    justify-content: center;
    transition: width 0.2s ease;
  }

  .search input {
    width: 0;
    flex: 0;
  }

  .search:focus-within {
    position: absolute;
    left: 16px;
    right: 16px;
    width: auto;
    padding-inline: 14px;
    justify-content: flex-start;
    background: var(--bg);
  }

  .search:focus-within input {
    flex: 1;
    width: auto;
  }

  .hero-shots img {
    width: 132px;
  }
}

/* ---------- Google Play (games played only from their Android app) ---------- */

/* The badge is used as Google ships it (it carries its own clear space). 56px tall reads well on a phone and keeps
   the badge above Google's minimum size. */
.listing-actions-store {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.store-badge {
  display: inline-block;
  line-height: 0;
  border-radius: 12px;
}

.store-badge img {
  width: auto;
  height: 60px;
}

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

.store-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 50px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-weight: 600;
}

.store-pending svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.button.is-static {
  cursor: default;
  white-space: nowrap;
}

.button.is-static:active {
  transform: none;
}

.listing-actions-store + .alt-play-note,
.listing-actions-store + .alt-play {
  margin-top: 10px;
}

.moved-text {
  margin: 18px 0 0;
  max-width: 60ch;
}

.moved-links {
  margin-top: 28px;
  font-size: 14px;
}

.moved-links a {
  color: var(--accent);
}

/* QR to the Google Play page: only on computers (wide screen and a mouse). On a phone the badge already opens the
   store app, and a QR on the same screen can't be scanned. White card in both themes so every camera reads it. */
.store-qr {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 820px) {
  .store-qr {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 16px;
    padding: 14px 20px 14px 14px;
    max-width: 460px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .store-qr-code {
    flex: none;
    width: 128px;
    height: 128px;
    padding: 4px;
    border-radius: 12px;
    background: #ffffff;
    line-height: 0;
  }

  .store-qr-code svg {
    width: 100%;
    height: 100%;
  }

  .store-qr p {
    margin: 0;
    font-size: 14px;
    color: var(--muted);
  }

  .store-qr strong {
    color: var(--text);
  }
}

/* "Descargar en Google Play" fits on one line in the hero. */
.hero .actions .button {
  white-space: nowrap;
}

/* Only for search engines and screen readers. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
