/* =========================================================
   Maggie Games - shared design system
   Two zones on purpose:
   .prose / site chrome = calm and grown-up (the adult reads)
   .play                = chunky and playful (the child uses)
   ========================================================= */

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

:root {
  /* surfaces */
  --bg:           #f5f8fc;
  --surface:      #ffffff;
  --surface-alt:  #e9f1f8;
  --border:       #cfdcea;

  /* text - all pass AA on --surface */
  --ink:          #12233a;
  --ink-soft:     #4c5f79;

  /* brand: calm teal-blue. Trustworthy for parents, not clinical. */
  --brand:        #14607d;
  --brand-dark:   #0d4257;
  --brand-soft:   #dfeef5;

  /* warm accent, used sparingly */
  --accent:       #e08b1e;
  --accent-soft:  #fdf0da;

  --success:      #146f4a;
  --success-soft: #d9f0e5;

  --focus:        #1668d8;

  --radius:   16px;
  --radius-lg: 26px;
  --shadow:   0 1px 2px rgba(18,35,58,.06), 0 6px 20px rgba(18,35,58,.07);
  --speed:    1;              /* 0 = sin movimiento */
  --wrap:     1180px;
}

@media (prefers-reduced-motion: reduce) { :root { --speed: 0; } }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: ui-rounded, "SF Pro Rounded", "Segoe UI Variable", "Segoe UI",
               system-ui, -apple-system, "Helvetica Neue", sans-serif;
  font-size: clamp(1rem, .97rem + .18vw, 1.09rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

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

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

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }

.skip {
  position: absolute; left: 0; top: 0; z-index: 99;
  transform: translateY(-150%);
  background: var(--brand); color: #fff; padding: 12px 20px;
  border-radius: 0 0 12px 0; font-weight: 700;
}
.skip:focus { transform: translateY(0); }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------------- typography ---------------- */
h1, h2, h3 { line-height: 1.15; letter-spacing: -.015em; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.1rem); }
h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); }

.lede { font-size: clamp(1.08rem, 1rem + .5vw, 1.3rem); color: var(--ink-soft); }

.prose p, .prose ul, .prose ol { margin-bottom: 1em; max-width: 68ch; }
.prose li { margin-bottom: .4em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose h2 { margin: 2.2em 0 .6em; }
.prose h3 { margin: 1.6em 0 .4em; }
.prose h2:first-child { margin-top: 0; }
.prose a { color: var(--brand-dark); text-underline-offset: 3px; }
.prose strong { font-weight: 800; }

/* ---------------- header ---------------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex; align-items: center; gap: 16px;
  min-height: 74px; flex-wrap: wrap; padding-block: 10px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 900; font-size: 1.3rem; color: var(--ink); text-decoration: none;
  letter-spacing: -.02em;
}
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand span i { color: var(--brand); font-style: normal; }

.site-nav { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.site-nav a {
  color: var(--ink-soft); text-decoration: none; font-weight: 700;
  padding: 9px 14px; border-radius: 999px; font-size: .98rem;
}
.site-nav a:hover { background: var(--surface-alt); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-dark); }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer;
  padding: 13px 24px; min-height: 52px; border-radius: 999px;
  border: 2px solid transparent; background: var(--brand); color: #fff;
  transition: transform calc(.12s * var(--speed)) ease, background .15s, box-shadow .15s;
  box-shadow: var(--shadow);
}
.btn:hover { background: var(--brand-dark); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: var(--surface); color: var(--brand-dark); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-alt); }
.btn.accent { background: var(--accent); color: #3a2405; }
.btn.accent:hover { background: #c9780f; color: #fff; }

/* ---------------- sections ---------------- */
.section { padding-block: clamp(44px, 7vw, 80px); }
.section.alt { background: var(--surface); border-block: 1px solid var(--border); }
.section-head { max-width: 62ch; margin-bottom: clamp(24px, 4vw, 40px); }
.section-head p { color: var(--ink-soft); margin-top: .5em; }

/* ---------------- hero ---------------- */
.hero { background: linear-gradient(170deg, var(--surface) 0%, var(--surface-alt) 100%); }
.hero .wrap {
  display: grid; gap: clamp(24px, 4vw, 48px); align-items: center;
  grid-template-columns: 1.15fr .85fr;
  padding-block: clamp(40px, 6vw, 76px);
}
.hero p { margin-top: .8em; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
/* Maggie es angosta y alta: se limita por ALTURA, si no domina la pantalla */
.hero-art { justify-self: center; }
.hero-art img {
  height: clamp(190px, 26vw, 380px); width: auto; margin-inline: auto;
  filter: drop-shadow(0 14px 22px rgba(18,35,58,.18));
}
@media (max-width: 800px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { order: -1; }
  .hero-art img { height: clamp(130px, 26vw, 170px); }
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; list-style: none; padding: 0; }
.badge {
  background: var(--surface); border: 1px solid var(--border);
  color: var(--ink-soft); font-size: .88rem; font-weight: 700;
  padding: 6px 13px; border-radius: 999px;
}

/* ---------------- game cards ---------------- */
.game-grid {
  display: grid; gap: clamp(18px, 2.5vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}
.game-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow); text-decoration: none; color: inherit;
  transition: transform calc(.16s * var(--speed)) ease, box-shadow .16s;
}
.game-card:hover { transform: translateY(-4px); box-shadow: 0 14px 34px rgba(18,35,58,.14); }
.game-card .thumb {
  background: var(--brand-soft); padding: 22px;
  display: flex; align-items: center; justify-content: center; gap: 14px;
  min-height: 190px;
}
.game-card .thumb img { height: clamp(96px, 15vw, 132px); width: auto; object-fit: contain; }
.game-card .thumb .sil { filter: brightness(0); }
.game-card .body { padding: 20px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.game-card h3 { margin-bottom: .3em; }
.game-card p { color: var(--ink-soft); font-size: .98rem; margin-bottom: 1em; }
.game-card .go { margin-top: auto; font-weight: 800; color: var(--brand-dark); }
.game-card .tag {
  align-self: flex-start; background: var(--accent-soft); color: #7a4b06;
  font-size: .8rem; font-weight: 800; padding: 4px 11px; border-radius: 999px;
  margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em;
}

/* ---------------- feature list ---------------- */
.features { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.feature {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
}
.feature .ico {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: var(--brand-soft); font-size: 1.4rem; margin-bottom: 12px;
}
.feature h3 { margin-bottom: .3em; }
.feature p { color: var(--ink-soft); font-size: .96rem; }

/* ---------------- faq ---------------- */
.faq { max-width: 70ch; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 17px 20px; font-weight: 800; list-style: none;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-size: 1.5rem; color: var(--brand); line-height: 1; flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > div { padding: 0 20px 18px; color: var(--ink-soft); }
.faq details > div p + p { margin-top: .7em; }

/* ---------------- breadcrumb ---------------- */
.crumb { font-size: .92rem; color: var(--ink-soft); padding-top: 20px; }
.crumb a { color: var(--brand-dark); }
.crumb span { margin-inline: 6px; opacity: .6; }

/* ---------------- footer ---------------- */
.site-footer {
  background: var(--ink); color: #c3d0e0; padding-block: 44px; margin-top: 0;
  font-size: .95rem;
}
.site-footer .wrap { display: grid; gap: 26px; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 700px) { .site-footer .wrap { grid-template-columns: 1fr 1fr; } }
.site-footer h4 { color: #fff; font-size: 1rem; margin-bottom: .7em; }
.site-footer a { color: #c3d0e0; text-decoration: none; display: block; padding: 4px 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .about { grid-column: 1 / -1; }
@media (min-width: 701px) { .site-footer .about { grid-column: auto; } }
.site-footer .fine {
  grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.16);
  padding-top: 18px; color: #93a4ba; font-size: .88rem;
}
.site-footer .fine a { display: inline; color: #93a4ba; text-decoration: underline; }

/* =========================================================
   PLAY ZONE - lo que usa el chico
   Bordes gruesos, targets grandes, foco enorme.
   ========================================================= */
.play {
  --line: #12233a;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(14px, 2.5vw, 24px);
  box-shadow: var(--shadow);
}
.play :focus-visible { outline: 6px solid var(--focus); outline-offset: 4px; }

.play .ctrl {
  font: inherit; font-weight: 800; font-size: .98rem; color: var(--ink);
  background: var(--surface); border: 3px solid var(--line); border-radius: 999px;
  padding: 9px 16px; min-height: 48px; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  box-shadow: 0 4px 0 rgba(18,35,58,.2);
  transition: transform .1s, box-shadow .1s, background .15s;
}
.play .ctrl:hover  { background: var(--surface-alt); }
.play .ctrl:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(18,35,58,.2); }
.play .ctrl[aria-pressed="false"] { background: #e5e9f0; color: #6a7a91; border-color: #8794a8; }
.play .ctrl.primary { background: var(--accent); border-color: #8a5a10; color: #3a2405; }

.play .bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}

.play .spacer { margin-left: auto; }
@media (max-width: 700px) {
  /* en el celu los controles se aprietan y el separador se va, si no ocupan 3 filas */
  .play .spacer { margin-left: 0; }
  .play .ctrl { font-size: .9rem; padding: 8px 13px; min-height: 46px; }
  .play .bar { gap: 8px; }
}

/* ---------------- moviles: cabecera compacta ---------------- */
@media (max-width: 620px) {
  .site-header .wrap { min-height: 0; gap: 8px; padding-block: 8px; }
  .brand { font-size: 1.12rem; }
  .brand img { width: 34px; height: 34px; }
  /* nav en una sola fila con scroll lateral, no en tres renglones */
  .site-nav {
    margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .site-nav a { white-space: nowrap; padding: 7px 12px; font-size: .93rem; }

  /* que el juego suba: menos aire arriba */
  .crumb { padding-top: 10px; font-size: .85rem; }
  .section { padding-block: clamp(30px, 6vw, 44px); }
}

@media (max-width: 620px) {
  /* el juego tiene que entrar: menos aire en el encabezado de la pagina */
  h1 { font-size: clamp(1.6rem, 1.2rem + 3vw, 2rem); }
  .lede { font-size: 1.02rem; }
  main > section:first-of-type { padding-block: 14px 10px !important; }
}
