/* Colores sacados del logo: papel de naipe, tinta y los cuatro palos */
:root {
  --paper: #f6f0de;
  --paper-2: #efe5c9;
  --card: #fbf7ea;
  --ink: #1b1712;
  --ink-2: #4a4136;
  --red: #c62f2a;
  --blue: #2a64ae;
  --yellow: #f2c021;
  --gold: #d7981d;
  --green: #3e8c39;
  --felt: #176a3d;
  --sc: "Alegreya SC", Georgia, "Times New Roman", serif;
  --serif: "Alegreya", Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  background:
    radial-gradient(ellipse at 50% 0%, #fffaf0 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, var(--paper-2) 0%, transparent 70%),
    var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.12rem;
  line-height: 1.55;
  font-variant-numeric: lining-nums;
  overflow-x: hidden;
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, .btn, .brand { font-family: var(--sc); font-weight: 800; line-height: 1.12; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 14px 26px; border-radius: 12px; text-decoration: none;
  background: var(--red); color: #fff8e6; font-size: 1.2rem; letter-spacing: .02em;
  border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-ghost { background: var(--card); color: var(--ink); }
.btn-sm { padding: 8px 16px; font-size: 1rem; box-shadow: 3px 3px 0 var(--ink); }
.btn:focus-visible, .links a:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

/* ---------- Cabecera ---------- */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, calc((100% - 1120px) / 2));
  background: rgba(246, 240, 222, .94); backdrop-filter: blur(6px);
  border-bottom: 3px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 1.35rem; }
.brand img { border-radius: 10px; border: 2px solid var(--ink); }
.links { display: none; gap: 22px; margin-left: auto; }
.links a { text-decoration: none; font-weight: 700; }
.links a:hover { color: var(--red); }
.nav .btn { margin-left: auto; }
@media (min-width: 760px) {
  .links { display: flex; }
  .nav .btn { margin-left: 8px; }
}

/* ---------- Portada ---------- */
.hero {
  max-width: 820px; margin: 0 auto; padding: 28px 16px 12px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px;
}
.hero-logo { width: min(520px, 100%); filter: drop-shadow(0 10px 18px rgba(80, 55, 20, .18)); }
.hero h1 { font-size: clamp(1.9rem, 6vw, 3rem); max-width: 15em; }
.lead { font-size: 1.22rem; color: var(--ink-2); max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 4px; }
.cta.center { margin-top: 28px; }
.fine { font-size: .95rem; color: var(--ink-2); font-style: italic; }

/* Floritura como la de debajo del logo */
.ornament { height: 46px; max-width: 280px; margin: 34px auto; }
.ornament svg { width: 100%; height: 100%; display: block; }

/* ---------- Secciones ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 8px 16px; }
.section > h2, .split-text > h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); text-align: center; }
.sub { text-align: center; color: var(--ink-2); font-style: italic; margin: 6px 0 26px; }

/* Naipes de "Así se juega" */
.naipes { display: grid; grid-template-columns: 1fr; gap: 22px; }
@media (min-width: 600px) { .naipes { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .naipes { grid-template-columns: repeat(4, 1fr); } }
.naipe {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 30px 22px 34px; border-radius: 16px; background: var(--card);
  border: 3px solid var(--ink); box-shadow: 5px 6px 0 rgba(27, 23, 18, .85);
  transition: transform .2s;
}
/* Marco interior del naipe, cortado en las "pintas" como en la baraja */
.naipe::before {
  content: ""; position: absolute; inset: 9px; border-radius: 9px; pointer-events: none;
  border: 1.5px solid var(--ink);
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 30% no-repeat, linear-gradient(#000 0 0) bottom / 100% 55% no-repeat;
          mask: linear-gradient(#000 0 0) top / 100% 30% no-repeat, linear-gradient(#000 0 0) bottom / 100% 55% no-repeat;
}
.naipe:nth-child(odd) { transform: rotate(-1.6deg); }
.naipe:nth-child(even) { transform: rotate(1.4deg); }
.naipe:hover { transform: rotate(0) translateY(-4px); }
.naipe .num { position: absolute; top: 14px; left: 18px; font-family: var(--sc); font-weight: 900; font-size: 1.7rem; line-height: 1; }
.naipe .num-b { top: auto; left: auto; bottom: 14px; right: 18px; transform: rotate(180deg); }
.naipe .palo { width: 76px; height: 110px; margin: 4px 0 12px; }
.naipe .palo svg { width: 100%; height: 100%; display: block; }
.naipe h3 { font-size: 1.45rem; margin-bottom: 6px; }
.naipe p { color: var(--ink-2); }
.naipe[data-palo="oros"] h3 { color: #a8700c; }
.naipe[data-palo="copas"] h3 { color: var(--red); }
.naipe[data-palo="espadas"] h3 { color: var(--blue); }
.naipe[data-palo="bastos"] h3 { color: var(--green); }

/* ---------- La mesa ---------- */
.split { display: grid; gap: 34px; align-items: center; justify-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: auto 1fr; gap: 64px; } }
.split-text > h2 { text-align: left; }
.split-text .sub { text-align: left; margin-bottom: 18px; }
@media (max-width: 859px) { .split-text > h2, .split-text .sub { text-align: center; } }
.phone {
  width: min(280px, 78vw); aspect-ratio: 9 / 18.5; padding: 10px; border-radius: 38px;
  background: var(--ink); box-shadow: 8px 10px 0 rgba(27, 23, 18, .25), inset 0 0 0 2px #3b342b;
}
.mesa { position: relative; width: 100%; height: 100%; border-radius: 30px; overflow: hidden; background: #1a120b; }
.mesa .mat { position: absolute; inset: 0; box-sizing: border-box; }
.mesa .decor, .mesa .lines, .mesa .pitas { position: absolute; inset: 0; width: 100%; height: 100%; }

.mesa .lines line { stroke: rgba(255, 255, 255, .25); stroke-width: 1.5; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }
.mesa .bank {
  position: absolute; left: 30%; right: 30%; top: 38.5%; bottom: 38.5%;
  border-radius: 14px; border: 1.5px dashed rgba(255, 255, 255, .3); background: rgba(0, 0, 0, .14);
}
.mesa .score {
  position: absolute; color: #f4efe2; font-family: var(--sc); font-weight: 800; font-size: .95rem;
  white-space: nowrap; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); transform: translate(-50%, -50%);
}
.mesa .score b { display: block; font-size: .7rem; font-weight: 700; color: #ffb4ad; letter-spacing: .04em; }
.mesa .score small { font-size: .65rem; opacity: .8; }
.mesa .score.left b, .mesa .score.right b { color: #b2d0ff; }
.mesa .score.top { left: 50%; top: 7%; transform: translate(-50%, -50%) rotate(180deg); }
.mesa .score.bottom { left: 50%; top: 93%; }
.mesa .score.left { left: 9%; top: 50%; transform: translate(-50%, -50%) rotate(90deg); }
.mesa .score.right { left: 91%; top: 50%; transform: translate(-50%, -50%) rotate(-90deg); }
.mesa .pita { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 1.5px rgba(0, 0, 0, .5)); }
.mesa .pita img, .pita-card .disc img { display: block; }
.mesa .pita.lifted { filter: drop-shadow(0 12px 7px rgba(0, 0, 0, .35)); transform: translate(-50%, -50%) translateY(-5px) scale(1.25); }
.mesa > .pitas { transition: opacity .35s; }
.mesa.fading > .pitas { opacity: 0; }

.features { list-style: none; display: grid; gap: 14px; margin-bottom: 26px; }
.features li { position: relative; padding-left: 46px; color: var(--ink-2); }
.features li b { color: var(--ink); }
.features li i { position: absolute; left: 0; top: 0; width: 30px; height: 40px; }
.features li i svg { width: 100%; height: 100%; display: block; }
@media (max-width: 859px) { .split-text { text-align: center; } .features { text-align: left; } }

/* ---------- Tienda ---------- */
.row-title { font-size: 1.35rem; margin: 10px 0 12px; }
.row {
  display: grid; grid-auto-flow: column; grid-auto-columns: 150px; gap: 14px;
  overflow-x: auto; padding: 4px 4px 18px; scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.row > * { scroll-snap-align: start; }
/* En pantallas anchas se ve todo el catálogo sin desplazar */
@media (min-width: 1000px) {
  .row { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); overflow: visible; }
  .row-pitas { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
}
.row-pitas { grid-auto-columns: 118px; }
.pita-card { text-align: center; }
.pita-card .disc {
  position: relative; width: 104px; height: 104px; margin: 0 auto; border-radius: 50%;
  background: radial-gradient(ellipse at center, #22874f 0%, #176a3d 60%, #0c4527 100%);
  border: 3px solid var(--ink); box-shadow: 3px 3px 0 rgba(27, 23, 18, .8);
}
.pita-card .disc div { position: absolute; aspect-ratio: 1; transform: translate(-50%, -50%); filter: drop-shadow(0 2px 1px rgba(0, 0, 0, .5)); }

.pita-card .name { display: block; margin-top: 8px; font-family: var(--sc); font-weight: 700; font-size: .98rem; line-height: 1.2; }
.pita-card .price { font-size: .9rem; color: var(--ink-2); }
.pita-card .price.free { color: var(--green); font-weight: 800; }

/* ---------- Cierre ---------- */
.final { padding: 56px 16px 40px; }
.ribbon {
  max-width: 760px; margin: 0 auto; text-align: center; padding: 34px 24px 38px;
  background: var(--card); border: 3px solid var(--ink); border-radius: 22px;
  box-shadow: 6px 7px 0 var(--ink);
  background-image:
    linear-gradient(90deg, var(--yellow) 0 25%, var(--red) 25% 50%, var(--blue) 50% 75%, var(--green) 75%);
  background-size: 100% 10px; background-repeat: no-repeat; background-position: top;
}
.ribbon h2 { font-size: clamp(2rem, 7vw, 3rem); margin: 10px 0 6px; }
.ribbon p { color: var(--ink-2); margin-bottom: 22px; }

.footer {
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 26px 16px 40px; border-top: 3px solid var(--ink); margin-top: 20px;
}
.footer img { border-radius: 10px; border: 2px solid var(--ink); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .naipe, .mesa > .decor, .mesa > .pitas { transition: none; }
}

.legal-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem .7rem; padding: 1rem 0; font-size: .85rem; }
.legal-nav a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
