/* Fredoka variable: fuente libre alojada en nuestra propia web, sin servicios externos. */
@font-face {
  font-family: "Brincurio Rounded";
  src: url("fuentes/fredoka-variable.ttf") format("truetype");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Rubik;
  src: url("fuentes/rubik.woff") format("woff");
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
}
@font-face {
  font-family: Rubik;
  src: url("fuentes/rubik-bold.woff") format("woff");
  font-style: normal;
  font-weight: 600 900;
  font-display: swap;
}

:root {
  font-family: Rubik, system-ui, sans-serif;
  --ink: #211941;
  --muted: #5b536f;
  --page: #f7f4ff;
  --surface: #fff;
  --wash: #f2edfe;
  --border: #e6ddf4;
  --purple: #623ec4;
  --purple-dark: #4d2ba8;
  --nav-active: #eee5ff;
  --nav-text: #4c2b98;
  --yellow: #ffd567;
  --focus: #754bd5;
  --shadow: 0 5px 0 #dcd3ef, 0 13px 26px #33216c12;
  --gutter: clamp(14px, 3.1vw, 38px);
  --heading-scale: 1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { margin: 0; background: #f7f4ff; }
body {
  margin: 0;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 3% 18%, #e9e3ff 0, transparent 35%),
    radial-gradient(ellipse at 95% 36%, #fff0e9 0, transparent 26%),
    var(--page);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
button, a { touch-action: manipulation; }
:where(button, a, input, [tabindex]):focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.svg-sprite { width: 0; height: 0; overflow: hidden; position: absolute; }
.ico {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
  vertical-align: middle;
}
.skip-link {
  position: fixed;
  z-index: 50;
  top: 8px;
  left: var(--gutter);
  transform: translateY(-150%);
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.header {
  position: sticky;
  top: 0;
  z-index: 12;
  padding-top: env(safe-area-inset-top, 0px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  width: min(100%, 1352px);
  margin: 0 auto;
  padding: 11px var(--gutter);
  display: grid;
  grid-template-columns: auto auto minmax(152px, 1fr) auto;
  grid-template-areas: "brand nav search controls";
  align-items: center;
  gap: clamp(12px, 1.65vw, 25px);
}
.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-self: start;
  min-height: 47px;
  border-radius: 9px;
}
.logo-icon {
  display: grid;
  width: 46px;
  height: 43px;
  place-items: center;
  color: #fff6db;
  background: linear-gradient(143deg, #865ff3, #5835b8 74%);
  border: 1px solid #936cff;
  border-radius: 15px;
  box-shadow: 0 3px 0 #412694;
  transform: rotate(-7deg);
}
.logo-icon .ico { width: 29px; height: 29px; stroke-width: 1.8; }
.brand-name { font-size: clamp(27px, 3vw, 38px); line-height: 1; font-weight: 800; letter-spacing: -.055em; }
.brand-name span { color: var(--purple); }
.navigation {
  grid-area: nav;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 11px;
  min-height: 44px;
  white-space: nowrap;
  color: var(--muted);
  border: 1px solid transparent;
  background: transparent;
  border-radius: 14px;
  font-weight: 700;
  font-size: 13px;
  transition: background-color .16s, color .16s;
}
.nav-item .ico { width: 19px; height: 19px; }
.nav-item.is-active { color: var(--nav-text); background: var(--nav-active); border-color: var(--border); }
.nav-item:hover { background: var(--wash); color: var(--ink); }
.mobile-only { display: none; }
.search {
  grid-area: search;
  min-width: 0;
  justify-self: stretch;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 45px;
  padding: 0 12px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--wash);
}
.search:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.search input {
  min-width: 0;
  width: 100%;
  height: 42px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  outline: none;
  font-size: 15px;
}
.search input::placeholder { color: var(--muted); opacity: 1; }
.header-actions { grid-area: controls; display: flex; align-items: center; gap: 6px; }
.header-icon {
  display: grid;
  width: 43px;
  height: 43px;
  padding: 0;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--wash);
}
.header-icon:hover { background: var(--nav-active); }
.header-icon .ico { width: 20px; height: 20px; }
.avatar-button { background: #fff0d5; border-color: #eed6b8; }
.avatar-button span { font-size: 25px; line-height: 1; }
.theme-toggle .theme-sun { display: none; }

.workspace { min-height: calc(100dvh - 70px); }
.content { width: min(100%, 1352px); margin: 0 auto; padding: 22px var(--gutter) 0; }
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(205px, 20vw, 294px);
  overflow: hidden;
  border-radius: clamp(20px, 3vw, 34px);
  background: #25205c;
  box-shadow: 0 6px 0 #cdc0ee, 0 14px 34px #35206b28;
}
.hero-art {
  position: absolute;
  z-index: -2;
  inset: 0 0 0 auto;
  display: block;
  width: 78%;
  height: 100%;
  object-fit: cover;
  object-position: right 25%;
  pointer-events: none;
}
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(90deg, #242059 0%, #242059ea 24%, #24205974 44%, #24205900 67%);
}
.hero-copy {
  width: 63%;
  min-width: 0;
  padding: clamp(20px, 4.3vw, 54px);
  color: #fff7e9;
}
.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(32px, 4.65vw, 66px);
  font-weight: 800;
  letter-spacing: -.052em;
  line-height: 1.015;
  text-wrap: balance;
  text-shadow: 0 4px 0 #21124b, 0 8px 22px #171440bd;
}
.welcome-badge {
  margin: 0 0 9px;
  font-size: 15px;
  font-weight: 700;
  color: #ffe8a5;
  overflow-wrap: anywhere;
}
.hero-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: clamp(12px, 2.15vw, 24px);
  min-height: 47px;
  padding: 8px 17px 8px 12px;
  border: 1px solid #ffeab0;
  border-radius: 13px;
  background: linear-gradient(#ffe494, var(--yellow));
  color: #382a3a;
  box-shadow: 0 4px 0 #c78b36, 0 8px 18px #15103458;
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
  transition: transform .16s, background-color .16s;
}
.hero-action:hover { transform: translateY(-2px); }
.hero-action:focus-visible { outline-color: #fff3b5; }
.hero-action .ico, .card-play .ico { fill: currentColor; stroke-width: 0; }

.content-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: clamp(23px, 3vw, 40px) 0 13px;
  scroll-margin-top: 85px;
}
.hero[hidden] + .content-head { margin-top: 7px; }
.content-head h2 {
  margin: 0;
  font-size: clamp(22px, calc(3vw * var(--heading-scale)), 40px);
  line-height: 1.08;
  letter-spacing: -.045em;
  font-weight: 800;
}
.count { color: var(--muted); font-size: 13px; white-space: nowrap; }

[data-filter], .game-card { --topic: #593c9c; --topic-wash: #eee6ff; --topic-edge: #d7c6f6; }
:is([data-filter="ingles"], [data-category="ingles"]) { --topic: #265396; --topic-wash: #e4eeff; --topic-edge: #bacff4; }
:is([data-filter="matematicas"], [data-category="matematicas"]) { --topic: #69439a; --topic-wash: #f0e5ff; --topic-edge: #dfcbf6; }
:is([data-filter="salud"], [data-category="salud"]) { --topic: #8b2f51; --topic-wash: #ffe9ee; --topic-edge: #f4c3d4; }
:is([data-filter="lengua"], [data-category="lengua"]) { --topic: #166776; --topic-wash: #dcf5f7; --topic-edge: #a8dce1; }
:is([data-filter="geografia"], [data-category="geografia"]) { --topic: #345f35; --topic-wash: #e6f4de; --topic-edge: #bfdeb5; }
:is([data-filter="arte"], [data-category="arte"]) { --topic: #913975; --topic-wash: #fbe7f6; --topic-edge: #efc6e4; }
:is([data-filter="ciencia"], [data-category="ciencia"]) { --topic: #81510d; --topic-wash: #fff0cf; --topic-edge: #ead4a4; }
.filters {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: clamp(14px, 2vw, 23px);
}
.filter {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 49px;
  padding: 6px 3px;
  white-space: nowrap;
  color: var(--topic);
  background: var(--topic-wash);
  border: 1px solid var(--topic-edge);
  border-radius: 14px;
  box-shadow: 0 2px 0 var(--topic-edge);
  font-weight: 700;
  font-size: clamp(11px, 1.15vw, 14px);
  transition: box-shadow .14s, transform .14s;
}
.filter:hover { transform: translateY(-2px); }
.filter.is-selected {
  color: #fff;
  background: linear-gradient(137deg, #7851da, #5836b7);
  border-color: #754ccd;
  box-shadow: 0 3px 0 #45278f;
}
.filter-label { display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.filters[data-mode="acciones"] .filter-topic,
.filters[data-mode="temas"] .filter-action { display: none; }
.filter-icon { display: inline-grid; place-items: center; flex: none; font-size: 19px; line-height: 1; }
.filter-icon .ico { width: 18px; height: 18px; }
.filter-short { display: none; }

.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.8vw, 22px); }
.game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .18s, box-shadow .18s;
}
.game-cover, .upcoming-cover {
  display: block;
  width: 100%;
  aspect-ratio: 8 / 5;
  overflow: hidden;
  border-radius: 16px;
  background: var(--topic-wash);
}
.game-cover img, .upcoming-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card-content { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 11px 10px 9px; }
.card-content h3 {
  margin: 0;
  font-size: clamp(16px, calc(1.62vw * var(--heading-scale)), 24px);
  line-height: 1.14;
  letter-spacing: -.035em;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.card-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  margin-top: auto;
  padding-top: 6px;
}
.card-play {
  display: inline-flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid #6442be;
  border-radius: 13px;
  color: #fff;
  background: #6442be;
  box-shadow: 0 2px 0 #472889;
  font-size: calc(.9rem * var(--heading-scale));
  font-weight: 800;
}
.card-play:hover { background: #5533ab; }
.card-play .ico { width: 19px; height: 19px; }
.card-play::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 22px;
}
.fav-button {
  position: relative;
  z-index: 2;
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  background: var(--wash);
}
.fav-button .ico { width: 21px; height: 21px; }
.fav-button:hover { color: #b52664; border-color: #edbfd3; }
.fav-button[aria-pressed="true"] { color: #bd2668; border-color: #edbfd3; background: #ffe7f1; }
.fav-button[aria-pressed="true"] .ico { fill: currentColor; }
.card-description {
  margin: 0;
  font-size: calc(.875rem * var(--heading-scale));
  color: var(--muted);
  line-height: 1.36;
}
.game-guidance {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.24;
}
.game-age { font-weight: 700; color: var(--ink); }
.game-reading { display: inline-flex; align-items: center; gap: 3px; }
.game-reading svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.subject {
  align-self: flex-start;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 5px 8px;
  border-radius: 9px;
  background: var(--topic-wash);
  color: var(--topic);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.18;
}
.subject-short { display: none; }
.game-grid[data-view="juegos"] :is(.game-guidance, .subject) { display: none; }

.empty-state, .family-panel {
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: clamp(18px, 3.3vw, 35px);
  box-shadow: var(--shadow);
}
.empty-state { text-align: center; margin: 13px 0; }
.empty-state > span { display: inline-block; color: var(--purple); font-size: 39px; }
.empty-state h3, .family-panel h2, .family-panel h3 { margin: 8px 0; }
.empty-state p, .family-panel p { color: var(--muted); line-height: 1.52; }
.family-panel > p:first-of-type { margin-top: 0; }
.family-game-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0;
  list-style: none;
  margin: 13px 0 24px;
}
.family-game-guide li { min-width: 0; border-radius: 14px; background: var(--wash); border: 1px solid var(--border); padding: 13px; }
.family-game-link { color: var(--nav-text); font-size: 15px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.family-game-guide span { display: block; margin-top: 4px; font-size: 12px; color: var(--nav-text); font-weight: 700; }
.family-game-guide p { margin: 5px 0 0; font-size: 13px; }
.site-footer { padding: 28px 1px 22px; color: var(--muted); font-size: 13px; }

.modal {
  max-height: min(83dvh, 740px);
  width: min(510px, calc(100vw - 24px));
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 23px;
  box-shadow: 0 22px 56px #1712396b;
}
.modal::backdrop { background: #1c16477f; backdrop-filter: blur(4px); }
.dialog-wrap { padding: clamp(14px, 3.9vw, 24px); }
.dialog-title { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.dialog-title small { color: var(--muted); font-size: 12px; }
.dialog-title h2 { margin: 3px 0 0; font-size: clamp(22px, 4.8vw, 31px); letter-spacing: -.03em; }
.close-button {
  display: grid;
  place-items: center;
  min-width: 43px;
  min-height: 43px;
  border-radius: 14px;
  background: var(--wash);
  border: 1px solid var(--border);
}
.dialog-sub { color: var(--muted); margin: 11px 0 16px; line-height: 1.42; }
.profiles-list { display: grid; gap: 7px; }
.profile-entry {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}
.profile-entry.active { background: var(--nav-active); border-color: var(--focus); }
.profile-select {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 47px;
  padding: 5px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  font-weight: 700;
  overflow-wrap: anywhere;
}
.profile-avatar { font-size: 24px; flex: none; }
.profile-delete { min-height: 42px; border: 0; background: transparent; color: #b02356; font-size: 12px; padding: 5px 10px; border-radius: 10px; }
.profile-corner-action { margin: 12px 0; }
.profile-corner-action .soft-button { width: 100%; }
.profile-form { display: grid; gap: 8px; margin-top: 12px; }
.profile-form label { font-size: 14px; font-weight: 700; }
.profile-form > input {
  min-height: 46px;
  padding: 7px 11px;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
}
.avatar-options { display: flex; flex-wrap: wrap; gap: 5px; }
.avatar-choice {
  width: 43px;
  height: 43px;
  padding: 0;
  background: var(--wash);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 22px;
}
.avatar-choice[aria-pressed="true"] { border: 2px solid var(--focus); background: var(--nav-active); }
.form-message { margin: 0; color: var(--muted); font-size: 12px; }
.soft-button, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 45px;
  padding: 7px 12px;
  font-weight: 700;
  color: var(--nav-text);
  background: var(--wash);
  border: 1px solid var(--border);
  border-radius: 13px;
  text-align: center;
}
.primary-button { background: #6340c5; color: #fff; border-color: #6340c5; }
.soft-button:hover { background: var(--nav-active); }
.primary-button:hover { background: #4e2ba8; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.setting-row p, .settings-foot p { color: var(--muted); font-size: 13px; margin: 5px 0; line-height: 1.45; }
.settings-foot { padding-top: 11px; }
.settings-foot .soft-button { margin-top: 7px; }
.switch { position: relative; display: grid; place-items: center; width: 51px; height: 45px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { display: block; width: 48px; height: 27px; border: 1px solid var(--border); border-radius: 20px; background: var(--wash); }
.switch span::before { display: block; content: ""; width: 19px; height: 19px; margin: 3px; border-radius: 50%; background: var(--muted); transition: transform .16s; }
.switch input:checked + span { background: #6944cc; border-color: #6944cc; }
.switch input:checked + span::before { transform: translateX(21px); background: #fff; }
.switch input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 3px; }
.corner-dialog { width: min(795px, calc(100vw - 24px)); }
.corner-intro { display: flex; align-items: center; gap: 11px; padding: 15px 0; }
.corner-avatar { display: grid; place-items: center; width: 53px; height: 53px; border-radius: 16px; font-size: 30px; background: var(--wash); flex: none; }
.corner-intro strong { font-size: 19px; overflow-wrap: anywhere; }
.corner-intro p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.corner-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.corner-stat { display: grid; gap: 5px; min-width: 0; padding: 9px; border: 1px solid var(--border); border-radius: 14px; background: var(--wash); }
.corner-stat span { color: var(--muted); font-size: 12px; font-weight: 700; }
.corner-stat strong { font-size: clamp(17px, 4.6vw, 24px); }
.corner-heading { margin: 20px 0 9px; }
.corner-games { display: grid; gap: 8px; }
.corner-game { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 13px; }
.corner-game-img { flex: none; width: clamp(70px, 16vw, 115px); aspect-ratio: 8 / 5; object-fit: cover; border-radius: 9px; background: var(--wash); }
.corner-game-body { flex: 1; min-width: 0; }
.corner-game-body strong { font-size: 14px; overflow-wrap: anywhere; }
.corner-progress-text, .corner-small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.corner-progress-text { margin: 4px 0 5px; }
.corner-bar { height: 6px; background: var(--wash); border-radius: 10px; overflow: hidden; }
.corner-bar span { display: block; height: 100%; border-radius: 10px; background: #8054e0; }
.corner-play { min-width: 63px; min-height: 42px; font-size: 12px; flex: none; }
.corner-medals { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.corner-medal { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px; border: 1px solid var(--border); border-radius: 13px; background: var(--wash); }
.corner-medal-icon { flex: none; font-size: 24px; }
.corner-medal strong, .corner-medal small { display: block; }
.corner-medal strong { font-size: 13px; }
.corner-medal small, .corner-footnote { color: var(--muted); font-size: 12px; line-height: 1.36; }
.corner-medal.is-locked .corner-medal-icon { filter: grayscale(1); }
.corner-footnote { margin: 15px 0 0; }

body.dark {
  color-scheme: dark;
  --ink: #fff1ff;
  --muted: #d5cce9;
  --page: #211938;
  --surface: #30264a;
  --wash: #3b2f5a;
  --border: #53406d;
  --purple: #c4a4ff;
  --nav-active: #52377f;
  --nav-text: #f0e3ff;
  --focus: #d1b5ff;
  --shadow: 0 5px 0 #160f29, 0 12px 24px #100a244f;
  background: radial-gradient(ellipse at 78% 0, #372552, transparent 42%), var(--page);
}
body.dark .hero { box-shadow: 0 5px 0 #1a122e; }
body.dark .theme-toggle .theme-moon { display: none; }
body.dark .theme-toggle .theme-sun { display: block; }
body.dark .avatar-button { background: #554263; border-color: var(--border); }
body.dark .profile-delete { color: #ffaacb; }
body.large-text { --heading-scale: 1.16; }

@media (hover: hover) and (pointer: fine) {
  .game-card:not(.is-upcoming):hover { transform: translateY(-4px); box-shadow: 0 6px 0 var(--border), 0 17px 32px #35206b23; }
}
@media (max-width: 1100px) {
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav-item { padding-inline: 8px; }
}
@media (max-width: 1000px) {
  .filter-full { display: none; }
  .filter-short { display: inline; }
}
@media (min-width: 761px) and (max-width: 949px) {
  .header-inner {
    grid-template-columns: auto minmax(146px, 1fr) auto;
    grid-template-areas: "brand search controls" "nav nav nav";
    gap: 6px 15px;
    padding-top: 8px;
    padding-bottom: 7px;
  }
  .nav-item { min-height: 39px; padding-inline: 14px; }
  .content-head { scroll-margin-top: 125px; }
}
@media (max-width: 850px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
  .filter { font-size: 13px; min-height: 45px; }
  .family-game-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  :root { --gutter: max(11px, env(safe-area-inset-left, 0px), env(safe-area-inset-right, 0px)); }
  .header { position: relative; }
  .header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "brand controls" "search search";
    gap: 8px 10px;
    padding: 8px var(--gutter) 10px;
  }
  .brand { gap: 7px; min-height: 42px; }
  .brand-name { font-size: clamp(24px, 7.25vw, 34px); }
  .logo-icon { width: 35px; height: 34px; border-radius: 12px; }
  .logo-icon .ico { width: 24px; height: 24px; }
  .header-actions { gap: 4px; }
  .header-icon { width: 42px; height: 42px; }
  .header-icon .ico { width: 19px; height: 19px; }
  .search { min-height: 44px; }
  .search input { height: 42px; font-size: 16px; }
  .navigation {
    position: fixed;
    z-index: 14;
    inset: auto 0 0;
    padding: 6px var(--gutter) max(6px, env(safe-area-inset-bottom, 0px));
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    box-shadow: 0 -5px 20px #2a18461a;
  }
  .nav-item { flex-direction: column; min-height: 48px; gap: 3px; padding: 4px 2px; font-size: clamp(10px, 2.8vw, 11px); }
  .nav-item .ico { width: 20px; height: 20px; }
  .mobile-only { display: inline-flex; }
  .content { padding-top: 11px; padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  .hero { min-height: clamp(153px, 41vw, 208px); }
  .hero-art { left: auto; width: 88%; object-position: 84% 52%; }
  .hero::before { background: linear-gradient(90deg, #272260 0%, #272260f7 22%, #2722608f 47%, #27226000 77%); }
  .hero-copy { width: 64%; padding: 14px 12px 14px 16px; }
  .hero h1 { font-size: clamp(26px, 8.15vw, 46px); text-wrap: wrap; }
  .welcome-badge { font-size: 12px; margin-bottom: 5px; }
  .hero-action { margin-top: 11px; min-height: 43px; padding: 6px 10px 6px 7px; font-size: 13px; border-radius: 11px; }
  .hero-action .ico { width: 19px; height: 19px; }
  .content-head { scroll-margin-top: 8px; margin-top: 20px; margin-bottom: 9px; }
  .content-head h2 { font-size: calc(24px * var(--heading-scale)); }
  .count { font-size: 12px; }
  .filter { min-height: 44px; padding: 4px 2px; font-size: clamp(10.5px, 3.4vw, 13px); }
  .filter-icon { font-size: 16px; }
  .filter-icon .ico { width: 15px; height: 15px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-card { border-radius: 17px; padding: 4px; }
  .game-cover, .upcoming-cover { border-radius: 12px; }
  .card-content { padding: 8px 5px 5px; gap: 5px; }
  .card-content h3 { font-size: calc(15px * var(--heading-scale)); }
  .card-actions { gap: 5px; }
  .card-play { border-radius: 11px; font-size: calc(.8rem * var(--heading-scale)); padding-inline: 4px; }
  .card-play .ico { width: 16px; height: 16px; }
  .card-play::after { border-radius: 17px; }
  .fav-button { border-radius: 11px; }
  .fav-button .ico { width: 18px; height: 18px; }
  .card-description { font-size: calc(.79rem * var(--heading-scale)); line-height: 1.32; }
  .game-guidance { gap: 4px 6px; font-size: 10.5px; padding-top: 4px; }
  .subject { font-size: 10px; }
  .subject-full { display: none; }
  .subject-short { display: inline; }
}
@media (max-width: 450px) {
  .filter { min-height: 48px; }
  .filter-label { flex-direction: column; gap: 4px; }
  .family-game-guide, .corner-medals { grid-template-columns: minmax(0, 1fr); }
  .corner-game { flex-wrap: wrap; }
  .corner-play { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::after, *::before { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
body.less-motion *, body.less-motion *::after, body.less-motion *::before {
  animation-duration: .01ms !important;
  transition-duration: .01ms !important;
  scroll-behavior: auto !important;
}

/* Identidad Brincurio: logotipo legible en móvil y escritorio. */
.brand-logo{display:block;width:clamp(165px,16.2vw,220px);height:auto;max-height:64px;object-fit:contain;object-position:left center;flex:none;filter:drop-shadow(0 2px 2px #0b285f0d)}
@media(max-width:760px){.brand-logo{width:clamp(128px,42vw,184px);max-height:57px}.brand{min-width:0}}


/* BRINCURIO · Edición tipográfica. La retícula, portada, juegos y perfiles se conservan.
   Fredoka es la voz gráfica de la marca; Rubik sigue siendo la fuente de lectura. */
:root {
  --font-play: "Brincurio Rounded", ui-rounded, "Trebuchet MS", Rubik, sans-serif;
  --brand-blue: #1678d8;
  --brand-turquoise: #12b6c0;
  --brand-sun: #ffd45a;
  --brand-coral: #ed6574;
}

:is(.hero h1, .content-head h2, .card-content h3, .empty-state h3,
    .family-panel h2, .family-panel h3, .dialog-title h2,
    .corner-heading, .corner-intro strong, .corner-stat strong,
    .corner-game-body strong, .corner-medal strong) {
  font-family: var(--font-play);
  font-weight: 700;
  letter-spacing: -.018em;
  font-synthesis: none;
}
:is(.nav-item, .filter, .hero-action, .card-play, .soft-button,
    .primary-button, .family-game-link, .subject, .game-age, .count,
    .site-footer, .profile-select, .profile-form label,
    .frame-notice, .setting-row strong) {
  font-family: var(--font-play);
  font-weight: 600;
  letter-spacing: .002em;
}
.header {
  border-bottom: 2px solid #d7e9fc;
  box-shadow: 0 2px 0 #e9dfff;
}
.brand-logo { width: clamp(170px, 16.8vw, 224px); }
.nav-item { border-radius: 16px; font-size: clamp(12px, 1.07vw, 14px); }
.nav-item.is-active {
  color: #184f9b;
  background: #e5f3ff;
  border-color: #bde2fc;
}
.nav-item:hover { color: #19519d; background: #eef8ff; }
.search { border-radius: 17px; }
.hero h1 {
  color: #fffaf3;
  font-size: clamp(34px, 4.7vw, 67px);
  line-height: 1.04;
  letter-spacing: -.025em;
  text-shadow: 0 3px 0 #1a174d, 0 7px 16px #140f49b8;
}
.welcome-badge {
  font-family: var(--font-play);
  font-weight: 600;
  color: #ffe49a;
}
.hero-action {
  color: #37244e;
  border-radius: 16px;
  border-color: #fff1b7;
  background: linear-gradient(180deg, #fff0ae 0%, #ffda60 55%, #ffc645 100%);
  box-shadow: 0 4px 0 #bd822b, 0 8px 17px #15103458;
  font-size: 17px;
  font-weight: 700;
}
.hero-action:hover { transform: translateY(-2px); }
.hero-action:active { transform: translateY(2px); box-shadow: 0 2px 0 #bd822b; }
.content-head h2 {
  font-size: clamp(24px, calc(3.05vw * var(--heading-scale)), 41px);
  line-height: 1.12;
  color: var(--ink);
}
.content-head h2::after {
  content: "✦";
  display: inline-block;
  margin-left: .22em;
  font: 700 .5em/1 Rubik, sans-serif;
  color: #e9ad22;
  vertical-align: top;
  transform: rotate(-13deg);
}
.count {
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--wash);
  font-size: 12px;
}
.filter {
  border-radius: 16px;
  font-size: clamp(11px, 1.10vw, 14px);
  box-shadow: 0 3px 0 var(--topic-edge);
}
.filter.is-selected {
  background: linear-gradient(140deg, #168ddd, #6956ce);
  border-color: #356fcb;
  box-shadow: 0 3px 0 #3556a4;
}
.game-card {
  border-radius: 23px;
  border-color: #e3d9f1;
}
.card-content { gap: 8px; }
.card-content h3 {
  font-size: clamp(17px, calc(1.72vw * var(--heading-scale)), 25px);
  line-height: 1.13;
  color: var(--topic);
}
.card-description {
  font-family: Rubik, system-ui, sans-serif;
  line-height: 1.43;
}
.card-play {
  min-height: 45px;
  border-radius: 15px;
  font-size: calc(.95rem * var(--heading-scale));
  font-weight: 700;
  color: #fff;
  border-color: #1972bd;
  background: linear-gradient(180deg, #379deb 0%, #197bd1 55%, #1565b4 100%);
  box-shadow: 0 3px 0 #10518e;
}
.card-play:hover {
  background: linear-gradient(180deg, #4eacf3, #1a78c9);
}
.card-play:active { box-shadow: 0 1px 0 #10518e; }
.card-play::after { border-radius: 23px; }
.subject { border-radius: 11px; }
.family-game-link { font-size: 16px; }
.dialog-title h2 { letter-spacing: -.018em; }
.primary-button {
  color: #fff;
  background: linear-gradient(#318fe4, #176ebd);
  border-color: #176ab4;
  box-shadow: 0 3px 0 #0c5094;
}
.primary-button:hover { background: #176dc2; }
.corner-bar span { background: linear-gradient(90deg, #198de2, #19c4bc); }
.site-footer { font-size: 14px; color: var(--muted); }

body.dark .header { border-bottom-color: #465b85; box-shadow: none; }
body.dark .nav-item.is-active {
  color: #e7f7ff;
  background: #274c80;
  border-color: #4369a0;
}
body.dark .nav-item:hover { color: #f4ecff; background: #3f396e; }
body.dark .game-card { border-color: var(--border); }
body.dark .card-content h3 { color: #f7e5ae; }
body.dark .count { background: var(--wash); }
body.dark .hero h1 { color: #fffaf3; }

@media (min-width: 761px) and (max-width: 1180px) {
  .nav-item { padding-inline: 6px; font-size: 12.5px; }
}
@media (max-width: 760px) {
  .brand-logo { width: clamp(132px, 42vw, 188px); }
  .hero h1 { font-size: clamp(26px, 7.5vw, 44px); line-height: 1.04; }
  .hero-action { font-size: 14px; }
  .content-head h2 { font-size: calc(25px * var(--heading-scale)); }
  .filter { font-size: clamp(10.5px, 3.35vw, 13px); }
  .card-content { gap: 6px; }
  .card-content h3 { font-size: calc(16px * var(--heading-scale)); }
  .card-play { font-size: calc(.85rem * var(--heading-scale)); border-radius: 12px; }
  .card-play::after { border-radius: 17px; }
  .nav-item { font-size: clamp(10px, 2.85vw, 11.5px); }
}
@media (max-width: 360px) {
  .brand-logo { width: 128px; }
  .hero h1 { font-size: 26px; }
  .filter { font-size: 10px; }
  .card-content h3 { font-size: calc(15px * var(--heading-scale)); }
}
