/* ---------- Fuentes (alojadas aquí: sin peticiones a terceros) ---------- */
@font-face {
  font-family: 'BertholdBlock';
  src: url('fonts/BertholdBlock.ttf') format('truetype');
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('fonts/Inter-Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

/* ---------- Tokens (los mismos que la app: src/ui/theme/theme.ts) ---------- */
:root {
  --bg: #252944;
  --bg-deep: #181b30;
  --text: #ffffff;
  --text-soft: #d3d1c7;
  --ink: #252944;
  --paper: #e4e2df;
  --accent: #e7ef3a;
  --accent-press: #c7c71f;
  --coin: #dbc033;
  --power: #9b6bdf;

  --deck-science: #a9d464;
  --deck-history: #ffdf6c;
  --deck-geography: #ffa73f;
  --deck-art: #f46f62;
  --deck-sports: #7385ea;
  --deck-movies: #ffa0ce;

  --team-1: #38b6ff;
  --team-2: #cf1c1c;
  --team-3: #dbc033;
  --team-4: #009432;

  --r-sm: 8px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-pill: 999px;

  --font-display: 'BertholdBlock', 'Anton', 'Impact', 'Arial Black', sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --gutter: clamp(16px, 5vw, 48px);
  --max: 1120px;

  color-scheme: dark;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

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

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--accent);
  color: var(--ink);
  padding: 8px 16px;
  border-radius: var(--r-sm);
  font-weight: 700;
  z-index: 10;
}
.skip-link:focus {
  left: 8px;
}

/* ---------- Cabecera ---------- */
.site-header {
  padding: 20px 0;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.02em;
}
.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.nav {
  display: flex;
  gap: 24px;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}
.nav a:hover {
  color: var(--accent);
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 32px;
  border-radius: var(--r-md);
  text-decoration: none;
  text-transform: uppercase;
  transition:
    transform 140ms ease-out,
    background-color 140ms ease-out;
}
.btn:active {
  transform: scale(0.96);
  transition-duration: 90ms;
}
.btn-primary {
  background: var(--accent);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 0.03em;
}
.btn-primary:hover {
  background: var(--accent-press);
}
.btn-core {
  background: #fff;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
}
.btn-core:hover {
  background: var(--paper);
}
.btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(32px, 6vw, 72px) 0 clamp(64px, 10vw, 120px);
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(32px, 6vw, 72px);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(56px, 10vw, 112px);
  line-height: 0.95;
  margin: 0 0 20px;
  letter-spacing: 0.01em;
}
.hero h1 .hl {
  color: var(--accent);
}
.hero .lead {
  font-size: clamp(18px, 2.2vw, 22px);
  color: var(--text-soft);
  margin: 0 0 32px;
  max-width: 34ch;
}
.hero .lead strong {
  color: var(--text);
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}
.hero-note {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-soft);
}

.hero-art {
  position: relative;
  aspect-ratio: 1;
  max-width: 460px;
  width: 100%;
  justify-self: center;
}
.hero-art .icon {
  width: 100%;
  border-radius: 22%;
  transform: rotate(-4deg);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}
.hero-art .deco {
  position: absolute;
  pointer-events: none;
}
.hero-art .deco-star {
  width: 22%;
  top: -6%;
  right: -4%;
  transform: rotate(14deg);
}

/* ---------- Secciones ---------- */
.section {
  padding: clamp(64px, 9vw, 112px) 0;
}
.section-deep {
  background: var(--bg-deep);
}
.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto clamp(40px, 6vw, 64px);
}
.eyebrow {
  display: inline-block;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 5.5vw, 56px);
  line-height: 1;
  margin: 0 0 16px;
}
.section-head p {
  color: var(--text-soft);
  margin: 0;
}

/* ---------- Rondas ---------- */
.rounds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.round {
  background: #fff;
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: 28px 28px 32px;
  position: relative;
}
.round:nth-child(1) {
  transform: rotate(-2deg);
}
.round:nth-child(2) {
  background: var(--accent);
  transform: translateY(-12px);
}
.round:nth-child(3) {
  transform: rotate(2deg);
}
.round-num {
  font-family: var(--font-display);
  font-size: 64px;
  line-height: 1;
  display: block;
  margin-bottom: 12px;
}
.round h3 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 24px;
  margin: 0 0 8px;
}
.round p {
  margin: 0;
  font-size: 16px;
}
.rounds-foot {
  text-align: center;
  margin: 48px auto 0;
  max-width: 560px;
  color: var(--text-soft);
}

/* ---------- Mazos ---------- */
.decks {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.deck {
  border-radius: var(--r-md);
  padding: 16px 12px 14px;
  color: var(--ink);
  text-align: center;
  transition: transform 140ms ease-out;
}
.deck:nth-child(odd) {
  transform: rotate(-3deg);
}
.deck:nth-child(even) {
  transform: rotate(3deg);
}
.deck:hover {
  transform: rotate(0) scale(1.04);
}
.deck img {
  width: 100%;
  aspect-ratio: 1287 / 895;
  object-fit: contain;
  margin-bottom: 8px;
}
.deck span {
  font-family: var(--font-display);
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.deck-science {
  background: var(--deck-science);
}
.deck-history {
  background: var(--deck-history);
}
.deck-geography {
  background: var(--deck-geography);
}
.deck-art {
  background: var(--deck-art);
}
.deck-sports {
  background: var(--deck-sports);
}
.deck-movies {
  background: var(--deck-movies);
}

/* ---------- Características ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.feature {
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--r-lg);
  padding: 28px;
}
.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--r-md);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  color: var(--ink);
}
.feature-icon img {
  width: 40px;
  height: 40px;
}
.feature-icon svg {
  width: 30px;
  height: 30px;
}
.feature h3 {
  font-size: 20px;
  margin: 0 0 6px;
}
.feature p {
  margin: 0;
  color: var(--text-soft);
  font-size: 16px;
}
.teams-dots {
  display: flex;
  gap: 4px;
}
.teams-dots i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}

/* ---------- CTA final ---------- */
.cta {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(40px, 7vw, 80px);
  line-height: 1;
  margin: 0 0 16px;
}
.cta p {
  color: var(--text-soft);
  margin: 0 auto 32px;
  max-width: 44ch;
}
.cta .ink {
  position: absolute;
  width: 220px;
  opacity: 0.22;
  right: -40px;
  top: -30px;
  transform: rotate(18deg);
  pointer-events: none;
}

/* ---------- Pie ---------- */
.site-footer {
  background: var(--bg-deep);
  padding: 40px 0;
  font-size: 15px;
  color: var(--text-soft);
}
.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.site-footer a {
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}
.site-footer a:hover {
  color: var(--accent);
}

/* ---------- Página legal ---------- */
.legal {
  padding: clamp(24px, 5vw, 56px) 0 clamp(64px, 9vw, 112px);
}
.legal-card {
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r-lg);
  padding: clamp(24px, 5vw, 56px);
  max-width: 820px;
  margin: 0 auto;
}
.legal-card h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(36px, 6vw, 56px);
  line-height: 1;
  margin: 0 0 8px;
}
.legal-card .updated {
  color: #5b5f78;
  font-size: 15px;
  margin: 0 0 32px;
}
.legal-card h2 {
  font-size: 22px;
  margin: 40px 0 12px;
  padding-top: 24px;
  border-top: 2px solid rgba(37, 41, 68, 0.12);
}
.legal-card h3 {
  font-size: 18px;
  margin: 24px 0 8px;
}
.legal-card p,
.legal-card li {
  max-width: 70ch;
}
.legal-card ul {
  padding-left: 22px;
}
.legal-card li {
  margin-bottom: 6px;
}
.legal-card a {
  color: var(--ink);
  font-weight: 700;
}
.legal-card .summary {
  background: #fff;
  border-radius: var(--r-md);
  padding: 20px 24px;
  border-left: 6px solid var(--accent-press);
}
.legal-card .summary p {
  margin: 0;
}
.legal-card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  margin: 12px 0;
}
.legal-card th,
.legal-card td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(37, 41, 68, 0.15);
  vertical-align: top;
}
.legal-card th {
  background: rgba(37, 41, 68, 0.06);
}
.table-scroll {
  overflow-x: auto;
}
.back-link {
  display: inline-block;
  margin-bottom: 24px;
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}
.back-link:hover {
  color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero .lead {
    margin-left: auto;
    margin-right: auto;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-art {
    max-width: 320px;
    grid-row: 1;
  }
  .decks {
    grid-template-columns: repeat(3, 1fr);
  }
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav {
    display: none;
  }
  .hero-art {
    max-width: 240px;
  }
  .rounds {
    grid-template-columns: 1fr;
  }
  .round:nth-child(n) {
    transform: none;
  }
  .decks {
    grid-template-columns: repeat(2, 1fr);
  }
  .features {
    grid-template-columns: 1fr;
  }
  .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .btn,
  .deck {
    transition: none;
  }
}

.cta-actions {
  justify-content: center;
}
