/* Truco Argentino — sitio estático (juegatruco.com)
   Mobile-first. Sin fuentes externas ni dependencias. */

:root {
  --felt-dark: #0D1510;
  --felt: #162B1A;
  --felt-light: #1E3A23;
  --gold: #F6CE4D;
  --gold-deep: #C9981A;
  --truco: #C03030;
  --envido: #1A70C8;
  --flor: #7E2CAA;
  --cream: #F5ECD7;
  --cream-muted: rgba(245, 236, 215, 0.82);
  --white: #FFFFFF;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-border: rgba(246, 206, 77, 0.28);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", "Courier New", monospace;
  color-scheme: dark;
}

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

html {
  background-color: var(--felt-dark);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--cream);
  background-color: var(--felt-dark);
  position: relative;
  isolation: isolate;
}

/* Paño verde: degradé fijo (funciona también en iOS, donde background-attachment: fixed no). */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 80% 55% at 50% 40%, rgba(46, 84, 52, 0.35), transparent 70%),
    linear-gradient(180deg, #0D1510 0%, #162B1A 50%, #0D1510 100%);
  pointer-events: none;
}

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

a {
  color: var(--gold);
  text-underline-offset: 0.18em;
}

a:hover {
  color: #FFE08A;
}

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

h1,
h2,
h3 {
  font-family: var(--font-serif);
  line-height: 1.2;
  margin: 0 0 0.5em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 7vw, 3.25rem);
  color: var(--gold);
  letter-spacing: 0.01em;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.45), 0 0 24px rgba(246, 206, 77, 0.18);
}

h2 {
  font-size: clamp(1.5rem, 4.6vw, 2.1rem);
  color: var(--gold);
}

h3 {
  font-size: 1.25rem;
  color: var(--white);
}

p {
  margin: 0 0 1em;
}

strong {
  color: var(--white);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--gold);
  color: var(--felt-dark);
  font-weight: 700;
  border-radius: var(--radius-sm);
  text-decoration: none;
}

.skip-link:focus {
  top: 1rem;
}

.container {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
}

main {
  flex: 1 0 auto;
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  min-width: 44px;
  padding: 0.7rem 1.4rem;
  border: 2px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 1.0625rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(180deg, #FFE07A 0%, var(--gold) 45%, var(--gold-deep) 100%);
  color: #1A1206;
  border-color: #FFE7A0;
  box-shadow: 0 4px 0 #7A5A0C, 0 10px 24px rgba(0, 0, 0, 0.35);
}

.btn-primary:hover {
  color: #1A1206;
  filter: brightness(1.06);
}

.btn-primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #7A5A0C, 0 6px 16px rgba(0, 0, 0, 0.35);
}

.btn-outline {
  background: rgba(0, 0, 0, 0.2);
  color: var(--gold);
  border-color: var(--gold);
}

.btn-outline:hover {
  background: rgba(246, 206, 77, 0.12);
  color: #FFE08A;
}

.btn-lg {
  min-height: 56px;
  font-size: 1.2rem;
  padding-inline: 2rem;
}

.btn-block {
  width: 100%;
}

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

.hero {
  text-align: center;
  padding-block: clamp(2rem, 7vw, 4rem) clamp(1.5rem, 5vw, 3rem);
}

.hero-logo {
  width: min(560px, 92%);
  margin: 0 auto 1rem;
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.tagline {
  font-family: var(--font-serif);
  font-size: clamp(1.15rem, 3.6vw, 1.5rem);
  color: var(--cream);
  margin-bottom: 1.75rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

@media (prefers-reduced-motion: no-preference) {
  /* Solo transform (sin opacidad): si la animación no corre, el logo igual se ve. */
  .hero-logo {
    animation: logo-in 700ms ease-out;
  }

  @keyframes logo-in {
    from {
      transform: translateY(-10px) scale(0.97);
    }
    to {
      transform: none;
    }
  }
}

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

.section {
  padding-block: clamp(2rem, 6vw, 3.5rem);
}

.section-head {
  text-align: center;
  max-width: 40rem;
  margin: 0 auto 2rem;
}

.section-head p {
  color: var(--cream-muted);
}

.divider {
  width: min(520px, 80%);
  margin: 0.5rem auto;
  opacity: 0.9;
}

/* ---------- Features ---------- */

.features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

@media (min-width: 680px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
}

.feature {
  --accent: var(--gold);
  position: relative;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-top: 4px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.feature p {
  color: var(--cream-muted);
  margin-bottom: 0;
}

.feature-icon {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 0.75rem;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}

.feature-icon svg {
  width: 26px;
  height: 26px;
}

.feature--torre {
  --accent: var(--gold-deep);
}

.feature--online {
  --accent: var(--envido);
}

.feature--flor {
  --accent: var(--flor);
}

.feature--voces {
  --accent: var(--truco);
}

.cantos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
  padding: 0;
  list-style: none;
}

.canto {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.canto--truco {
  background: var(--truco);
}

.canto--envido {
  background: var(--envido);
}

.canto--flor {
  background: var(--flor);
}

/* ---------- Descarga ---------- */

.download {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  text-align: center;
}

.download-art {
  width: min(380px, 85%);
  margin-inline: auto;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.45));
}

.download p {
  color: var(--cream-muted);
}

@media (min-width: 760px) {
  .download {
    grid-template-columns: 1fr 1.1fr;
    text-align: left;
    gap: 2.5rem;
  }

  .download .badges {
    justify-content: flex-start;
  }
}

.badges {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.badge {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 56px;
  padding: 0.55rem 1.1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px dashed rgba(246, 206, 77, 0.6);
  color: var(--cream);
  text-align: left;
}

.badge svg {
  width: 26px;
  height: 26px;
  flex: none;
  color: var(--gold);
}

.badge-small {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cream-muted);
  line-height: 1.2;
}

.badge-big {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.25;
}

/* ---------- Pasos (unirse con código) ---------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1.25rem, 4vw, 2rem);
}

.code-help {
  max-width: 44rem;
  margin-inline: auto;
}

.steps {
  list-style: none;
  counter-reset: paso;
  margin: 0 0 1.25rem;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.steps li {
  counter-increment: paso;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-height: 44px;
}

.steps li::before {
  content: counter(paso);
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--gold);
  color: #1A1206;
  font-weight: 800;
  font-family: var(--font-serif);
}

.note {
  color: var(--cream-muted);
  font-size: 0.975rem;
  margin-bottom: 0;
}

.code-inline {
  font-family: var(--font-mono);
  letter-spacing: 0.12em;
  color: var(--gold);
  font-weight: 700;
}

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

.site-footer {
  flex-shrink: 0;
  text-align: center;
  padding: 2rem 1rem calc(2rem + env(safe-area-inset-bottom, 0px));
  color: var(--cream-muted);
  font-size: 0.95rem;
  border-top: 1px solid rgba(246, 206, 77, 0.15);
  margin-top: 1.5rem;
}

.site-footer p {
  margin: 0;
}

/* ---------- Páginas chicas (invitación, 404) ---------- */

.page-narrow {
  width: 100%;
  max-width: 34rem;
  margin-inline: auto;
  padding: clamp(1.5rem, 6vw, 3rem) clamp(1rem, 5vw, 1.5rem) 2rem;
  text-align: center;
}

.logo-link {
  display: inline-block;
  margin: 0 auto 1.25rem;
  border-radius: 12px;
}

.logo-small {
  width: min(280px, 70vw);
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.5));
}

.page-narrow h1 {
  font-size: clamp(1.75rem, 7vw, 2.4rem);
}

.lead {
  color: var(--cream-muted);
  font-size: 1.1rem;
}

.code-card {
  margin: 1.25rem auto 1rem;
  padding: 1.1rem 0.75rem;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--gold);
  box-shadow:
    inset 0 0 0 4px rgba(0, 0, 0, 0.35),
    inset 0 0 0 6px rgba(201, 152, 26, 0.7),
    var(--shadow);
}

.code-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cream-muted);
  margin-bottom: 0.25rem;
}

.code {
  display: block;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: clamp(2.2rem, 12vw, 3.4rem);
  line-height: 1.15;
  letter-spacing: 0.22em;
  /* compensa el letter-spacing del último carácter para que quede centrado */
  margin: 0 -0.22em 0 0;
  color: var(--gold);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.5);
  -webkit-user-select: all;
  user-select: all;
  overflow-wrap: anywhere;
}

.actions {
  display: grid;
  gap: 0.85rem;
  max-width: 22rem;
  margin: 1.25rem auto 0;
}

.copy-status {
  min-height: 1.6em;
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--cream-muted);
}

.no-app {
  margin-top: 2rem;
  text-align: left;
}

.no-app h2 {
  font-size: 1.4rem;
  text-align: center;
}

.no-app .soon {
  text-align: center;
  font-weight: 700;
  color: var(--white);
}

.no-app .steps {
  margin-bottom: 0;
}

.desktop-hint {
  text-align: center;
  color: var(--cream-muted);
  font-size: 0.975rem;
  margin: 1rem 0 0;
}

@media (prefers-reduced-motion: no-preference) {
  .reveal {
    animation: reveal-in 400ms ease-out both;
  }

  @keyframes reveal-in {
    from {
      opacity: 0;
      transform: translateY(8px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }
}

.big-404 {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 18vw, 6rem);
  line-height: 1;
  color: var(--truco);
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.5);
  margin: 0 0 0.5rem;
  font-weight: 700;
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .btn,
  .badge,
  .feature,
  .panel,
  .code-card {
    border: 2px solid CanvasText;
  }
}

/* ---------- Política de privacidad ---------- */

.legal {
  max-width: 44rem;
  text-align: left;
}

.legal .logo-link {
  display: block;
  width: fit-content;
}

.legal h1,
.legal-date,
.legal-back {
  text-align: center;
}

.legal-date {
  color: var(--cream-muted);
  font-size: 0.95rem;
}

.legal h2 {
  font-size: clamp(1.3rem, 4vw, 1.6rem);
  margin-top: 2rem;
}

.legal h3 {
  margin-top: 1.25rem;
}

.legal ul {
  padding-left: 1.25rem;
  margin: 0 0 1em;
}

.legal li {
  margin-bottom: 0.4em;
}

.legal-back {
  margin-top: 2rem;
}
