/* Grafito — estilos compartidos (shell, layout, componentes) */

/* Paleta MenteActiva: slate + cian (lógica) / verde (palabras) / púrpura
   (agilidad), naranja = CTA, verde = acierto, rojo = error. */
:root {
  --bg: #F8F9FA; --surface: #FFFFFF; --surface2: #F1F5F9; --line: #E2E8F0;
  --ink: #0F172A; --ink2: #475569; --ink3: #64748B;
  --primary: #0EA5E9; --accent: #0EA5E9; --link: #0369A1; --on-accent: #FFFFFF; --sel-bg: #E0F2FE;
  --hi: #F59E0B; --hi-soft: #FEF3C7; --on-hi: #0F172A; --on-hi-soft: #0F172A;
  --ok-bg: #D1FAE5; --ok-line: #10B981; --ok-ink: #059669; --err-bg: #FEE2E2; --err-ink: #DC2626;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0B0F17; --surface: #121826; --surface2: #1E293B; --line: #334155;
  --ink: #F8F9FA; --ink2: #94A3B8; --ink3: #64748B;
  --primary: #38BDF8; --accent: #38BDF8; --link: #38BDF8; --on-accent: #FFFFFF; --sel-bg: #0C4A6E;
  --hi: #F59E0B; --hi-soft: #422006; --on-hi: #0F172A; --on-hi-soft: #FBBF24;
  --ok-bg: #064E3B; --ok-line: #10B981; --ok-ink: #6EE7B7;
  --err-bg: #7F1D1D; --err-ink: #FCA5A5;
  color-scheme: dark;
}

/* Acento por juego según categoría (mismo en claro y oscuro):
   lógica = cian, palabras = verde, agilidad = púrpura. */
body[data-accent="sudoku"], body[data-accent="minas"]                          { --accent: #0EA5E9; }
body[data-accent="cruci"], body[data-accent="sopa"], body[data-accent="ahorcado"] { --accent: #10B981; }
body[data-accent="memoria"], body[data-accent="desliza"], body[data-accent="tres"] { --accent: #8B5CF6; }

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  min-height: 100vh; display: flex; flex-direction: column;
  color: var(--ink); font-family: 'Plus Jakarta Sans', Helvetica, sans-serif;
  font-size: 16px; line-height: 1.5;
}
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link); text-decoration: underline; }

/* Accesibilidad: foco visible claro y consistente en todo lo interactivo (WCAG 2.4.7). */
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; border-radius: 6px; }
/* Respeta la preferencia de menos movimiento (WCAG 2.3.3): sin animaciones ni transiciones. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
/* Enlace "saltar al contenido": oculto hasta recibir foco con el teclado (WCAG 2.4.1). */
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--surface); color: var(--link);
  border: 2px solid var(--link); border-radius: 10px; padding: 10px 16px; font-weight: 700; transition: top .15s ease; }
.skip-link:focus { top: 12px; text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }
img { max-width: 100%; display: block; }
.mono { font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1320px; margin: 0 auto; width: 100%; padding: 0 clamp(12px, 3vw, 24px); }

/* header */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.site-header .wrap { padding-top: 12px; padding-bottom: 12px; display: flex; align-items: center; gap: clamp(10px, 2vw, 24px); flex-wrap: nowrap; }
.brand { display: flex; align-items: center; gap: 10px; cursor: pointer; flex: 0 0 auto; }
.brand-mark { position: relative; width: 34px; height: 34px; border-radius: 11px; background: #0F172A; flex: 0 0 auto; overflow: hidden; }
.brand-mark span { position: absolute; inset: 0; }
.brand-mark .tri { background: #F59E0B; clip-path: polygon(23% 14%, 77% 14%, 50% 88%); }
.brand-mark .tri2 { background: #F8F9FA; clip-path: polygon(42% 62%, 58% 62%, 50% 88%); }
.brand-name { display: flex; align-items: baseline; gap: 5px; }
.brand-name b { font-size: 21px; font-weight: 700; letter-spacing: -0.03em; }
.brand-dot { width: 5px; height: 5px; border-radius: 999px; background: var(--hi); }

.main-nav { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: var(--accent) var(--line); padding: 2px 0 4px; -webkit-overflow-scrolling: touch; }
.main-nav::-webkit-scrollbar { height: 6px; }
.main-nav::-webkit-scrollbar-track { background: var(--line); border-radius: 999px; }
.main-nav::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 999px; }
.nav-btn { padding: 8px 14px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; white-space: nowrap; }
.nav-btn:hover, .nav-btn:focus-visible { background: var(--hi); border-color: var(--hi); color: var(--on-hi); }
.nav-btn.active { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.nav-btn.nav-themes { color: var(--link); border-color: var(--primary); font-weight: 700; }
.nav-btn.nav-themes:hover, .nav-btn.nav-themes:focus-visible { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }

.header-tools { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; }
.tool-btn { padding: 8px 10px; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12px; }
.tool-btn:hover { border-color: var(--accent); color: var(--link); }

/* Selector de idioma: combo desplegable con bandera SVG */
.flag-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.flag { width: 21px; height: 14px; border-radius: 2px; flex: 0 0 auto; box-shadow: 0 0 0 1px rgba(0,0,0,.12); display: inline-block; }
.lang-select { position: relative; }
.lang-trigger { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }
.lang-trigger:hover { border-color: var(--accent); color: var(--link); }
.lang-code { letter-spacing: .02em; }
.lang-caret { font-size: 10px; color: var(--ink2); transition: transform .15s ease; }
.lang-select.open .lang-caret { transform: rotate(180deg); }
.lang-menu { position: absolute; top: calc(100% + 6px); right: 0; margin: 0; padding: 4px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 28px rgba(0,0,0,.16); min-width: 156px; z-index: 60; }
.lang-menu[hidden] { display: none; }
.lang-option { display: flex; align-items: center; gap: 9px; padding: 8px 9px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); }
.lang-option:hover { background: var(--sel-bg); }
.lang-option.is-current { font-weight: 800; }
.lang-option.is-current::after { content: "✓"; margin-left: auto; color: var(--link); font-weight: 800; }

/* Banner destacado de "Temáticas" en la home: degradado de marca + chips. */
.themes-banner { display: flex; align-items: center; justify-content: space-between; gap: 22px; flex-wrap: wrap;
  margin-top: clamp(16px, 3vw, 26px); padding: clamp(22px, 3.5vw, 34px); border-radius: 22px;
  background: linear-gradient(135deg, #0369A1 0%, #4F46E5 58%, #7C3AED 100%); color: #fff; text-decoration: none;
  position: relative; overflow: hidden; box-shadow: 0 18px 42px -20px rgba(99, 102, 241, .7);
  transition: transform .15s ease, box-shadow .15s ease; }
.themes-banner::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(130% 130% at 100% 0%, rgba(255, 255, 255, .20), transparent 55%); }
.themes-banner:hover { transform: translateY(-3px); box-shadow: 0 26px 54px -20px rgba(99, 102, 241, .85); text-decoration: none; color: #fff; }
.tb-main { position: relative; min-width: 0; flex: 1 1 320px; }
.tb-kicker { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .92; }
.tb-title { font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: -.02em; margin: 4px 0 6px; }
.tb-desc { font-size: clamp(14px, 1.6vw, 16px); line-height: 1.5; max-width: 62ch; opacity: .95; margin: 0 0 14px; }
.tb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.tb-chip { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
.tb-cta { position: relative; flex: 0 0 auto; background: #fff; color: #4338CA; font-weight: 800; font-size: 15px; padding: 13px 22px; border-radius: 999px; white-space: nowrap; box-shadow: 0 6px 16px -6px rgba(0, 0, 0, .35); }
.themes-banner:hover .tb-cta { filter: brightness(1.03); }
@media (max-width: 640px) { .themes-banner { flex-direction: column; align-items: flex-start; } .tb-cta { align-self: stretch; text-align: center; } }

/* --- Páginas temáticas (sopa/crucigrama/ahorcado por categoría) --- */
.downloads { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.downloads .dl-label { font-size: 13px; font-weight: 700; color: var(--ink2); }
.btn.dl { background: var(--sel-bg); border: 1px solid var(--primary); color: var(--ink); font-weight: 600; font-size: 13px; }
.btn.dl:hover { filter: brightness(1.04); }
.theme-desc { font-size: 14px; color: var(--ink2); margin-top: 14px; line-height: 1.6; max-width: 70ch; }
.clue-list { columns: 2; column-gap: 32px; font-size: 14px; line-height: 1.6; color: var(--ink2); padding-left: 18px; }
.clue-list li { break-inside: avoid; margin-bottom: 4px; }
.clue-list b { color: var(--ink); }
@media (max-width: 560px) { .clue-list { columns: 1; } }

/* --- Blog --- */
.post { max-width: 760px; margin: 0 auto; }
.post-head { margin: 6px 0 18px; }
.post-cat a { color: var(--link); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; text-decoration: none; }
.post-head h1 { font-size: clamp(26px, 5vw, 40px); letter-spacing: -.02em; margin: 8px 0; }
.post-meta { color: var(--ink2); font-size: 13px; }
.post-cover img { width: 100%; border-radius: 16px; margin: 6px 0 22px; }
.post-body { font-size: 17px; line-height: 1.75; color: var(--ink); }
.post-body h2 { font-size: clamp(21px, 3.6vw, 25px); letter-spacing: -.01em; margin: 30px 0 10px; }
.post-body h3 { font-size: clamp(18px, 3vw, 20px); margin: 22px 0 8px; }
.post-body p { margin: 0 0 16px; }
.post-body ul, .post-body ol { margin: 0 0 16px; padding-left: 22px; }
.post-body li { margin-bottom: 6px; }
.post-body a { color: var(--link); text-decoration: underline; }
.post-body strong { color: var(--ink); }
.post-body blockquote { border-left: 4px solid var(--primary); background: var(--sel-bg); margin: 0 0 18px; padding: 10px 16px; border-radius: 0 10px 10px 0; }
.post-body code { background: var(--surface2); padding: 1px 6px; border-radius: 6px; font-size: .92em; }
.post-body .post-figure { margin: 0 0 18px; }
.post-body .post-figure img { width: 100%; border-radius: 12px; }
.post-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 26px 0 6px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface2); }
.post-cta > span { font-weight: 700; }
.post-related { max-width: 1100px; margin: 34px auto 0; }
.post-related h2 { font-size: 18px; margin-bottom: 12px; }
.blog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .12s ease, transform .12s ease; }
.post-card:hover { border-color: var(--primary); transform: translateY(-2px); text-decoration: none; }
.pc-band { height: 140px; background-size: cover; background-position: center; }
.pc-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.pc-cat { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--link); }
.pc-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.pc-desc { font-size: 13px; color: var(--ink2); line-height: 1.5; }
.pc-date { font-size: 12px; color: var(--ink3); margin-top: 2px; }
.crumbs { font-size: 13px; color: var(--ink2); margin: 2px 0 4px; }
.crumbs a { color: var(--link); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.theme-card { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; transition: border-color .12s, transform .12s; }
.theme-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.theme-card-go { color: var(--link); font-size: 13px; font-weight: 700; white-space: nowrap; }

/* Banner de sugerencia de idioma (arriba del todo, descartable) */
.lang-suggest { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--sel-bg); border-bottom: 1px solid var(--primary); font-size: 14px; font-weight: 600; color: var(--ink); }
.lang-suggest-cta { background: var(--primary); color: var(--on-accent); font-weight: 700; padding: 5px 14px; border-radius: 999px; text-decoration: none; }
.lang-suggest-cta:hover { filter: brightness(1.08); text-decoration: none; }
.lang-suggest-x { background: transparent; border: 0; color: var(--ink2); cursor: pointer; font-size: 15px; line-height: 1; padding: 4px 8px; }
.lang-suggest-x:hover { color: var(--ink); }
.tool-btn.on { background: var(--surface2); }

/* layout */
.page-main { flex: 1 1 auto; width: 100%; padding: clamp(8px, 2vw, 16px) 0; }
.layout { display: flex; gap: clamp(16px, 3vw, 24px); align-items: flex-start; flex-wrap: wrap; }
.content { flex: 1 1 660px; min-width: 0; width: 100%; }
.sidebar { flex: 1 1 300px; max-width: 100%; display: flex; flex-direction: column; gap: 16px; align-self: stretch; }

/* ad placeholders / slots */
.ad-slot { border-radius: 12px; overflow: hidden; }
.ad-slot ins { display: block; }
.ad-slot.ad-728 { min-height: 90px; }
.ad-slot.ad-300x250 { min-height: 250px; }
.ad-slot.ad-300x600 { min-height: 600px; }
.ad-placeholder { height: 100%; min-height: inherit; border: 1px dashed var(--line); border-radius: 12px; display: grid; place-items: center; background: var(--surface2); font-family: 'Plus Jakarta Sans', sans-serif; font-size: 11px; color: var(--ink3); letter-spacing: 0.08em; text-align: center; padding: 8px; }

/* cards / panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(16px, 3vw, 24px); }
.panel-game { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(12px, 3vw, 20px); }

.eyebrow { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 11px; letter-spacing: 0.12em; color: var(--link); }

/* buttons */
.btn { padding: 8px 16px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 13px; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--link); }
.btn-primary { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { filter: brightness(0.92); color: var(--on-accent); }
.btn-hi { border-color: #F59E0B; background: #F59E0B; color: #0F172A; font-weight: 600; }
.btn-hi:hover { filter: brightness(1.08); color: #0F172A; }
.btn-ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); background: var(--surface2); color: var(--link); }
.chip { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-size: 12px; }
.chip.active { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.chip:hover { border-color: var(--hi); }

/* hero (home) */
.hero { border-radius: 22px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); padding: clamp(22px, 5vw, 44px); overflow: hidden; box-shadow: 0 18px 44px -30px rgba(15, 23, 42, 0.25); }
.hero-grid { container-type: inline-size; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 268px), 1fr)); gap: clamp(20px, 4vw, 44px); align-items: center; }
.hero-kicker { font-family: 'Plus Jakarta Sans', sans-serif; font-size: clamp(10px, 2.4cqw, 12px); letter-spacing: 0.14em; color: var(--link); margin-bottom: 16px; }
.hero h1 { font-size: clamp(27px, 7.2cqw, 46px); line-height: 1.04; letter-spacing: -0.03em; text-wrap: balance; margin-bottom: 16px; }
.hero h1 .grad { background: linear-gradient(135deg, #0EA5E9, #3B82F6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: #0EA5E9; }
.hero p { font-size: clamp(14px, 2.9cqw, 17px); line-height: 1.55; color: var(--ink2); text-wrap: pretty; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.stat-band { min-width: 0; container-type: inline-size; display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin-top: 12px; }
.stat-band > div { background: var(--surface2); padding: 16px 14px; }
.stat-band .n { font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums; font-size: clamp(17px, 6.6cqw, 26px); font-weight: 700; color: var(--link); letter-spacing: -0.02em; }
.stat-band .label { font-size: 11px; letter-spacing: 0.05em; color: var(--ink3); margin-top: 6px; text-wrap: pretty; }

/* home: game grid */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(226px, 100%), 1fr)); gap: 14px; }
.game-card { text-align: left; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; display: flex; flex-direction: column; font-family: inherit; color: var(--ink); }
.game-card:hover { border-color: var(--hi); transform: translateY(-3px); box-shadow: 0 14px 28px -16px var(--hi); text-decoration: none; }
.game-card .band { height: 108px; background-size: cover; background-position: center; }
.game-card .body { padding: 15px 16px 17px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-card .title { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.game-card .desc { font-size: 13px; line-height: 1.5; color: var(--ink2); flex: 1; text-wrap: pretty; }
.game-card .foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 11px; letter-spacing: 0.07em; }
.game-card .foot .play { color: var(--link); }
.game-card .foot .best { color: var(--ink3); }
.game-card .foot .best.has-record { color: var(--ok-ink); }

/* records panel */
.records-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(228px, 100%), 1fr)); gap: 10px; }
.records-grid.all { grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); }
.record-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; background: var(--surface2); border: 1px solid var(--line); border-radius: 12px; }
.record-row .dot { width: 8px; height: 8px; border-radius: 999px; flex: 0 0 auto; }
.record-row .txt { min-width: 0; flex: 1; }
.record-row .txt .label { font-size: 13px; color: var(--ink); }
.record-row .txt .sub { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 11px; color: var(--ink3); margin-top: 3px; }
.record-row b { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 14px; color: var(--link); }
.record-row.no-record b { color: var(--ink3); font-weight: 500; }

/* control bar (game pages) */
.control-bar { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; margin-bottom: 10px; font-family: 'Plus Jakarta Sans', sans-serif; font-variant-numeric: tabular-nums; }
.control-bar .timer { display: flex; gap: 10px; align-items: center; }
.control-bar .timer-txt { display: flex; gap: 8px; align-items: baseline; }
.control-bar .timer-txt span { color: var(--ink3); letter-spacing: 0.1em; font-size: 11px; }
.control-bar .timer-txt b { font-size: 14px; }
.control-bar .hint-note { font-size: 11px; letter-spacing: 0.06em; color: var(--ink3); }
.control-bar .sep { width: 1px; height: 22px; background: var(--line); }
.control-bar .record { display: flex; gap: 8px; align-items: baseline; }
.control-bar .record span { color: var(--ink3); letter-spacing: 0.1em; font-size: 11px; }
.control-bar .record b { font-size: 14px; color: var(--link); }
.control-bar .win-note { font-size: 12px; letter-spacing: 0.08em; color: var(--link); }
.control-bar .right-group { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }

.game-title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.game-title-row .icon { width: 44px; height: 44px; border-radius: 12px; background-size: cover; background-position: center; flex: 0 0 auto; }
.game-title-row h1 { font-size: clamp(21px, 5.4vw, 30px); letter-spacing: -0.02em; }
.game-title-row .hint-btn { margin-left: auto; }
.game-lede { font-size: 15px; color: var(--ink); margin: 4px 0 6px; max-width: 60ch; }
.game-help { font-size: 14px; color: var(--ink2); margin-bottom: 12px; }
.status-line { margin-top: 14px; font-size: 13px; color: var(--ink2); min-height: 18px; }
.status-line.win { color: var(--ok-ink); font-weight: 600; }
.status-line.bad { color: var(--err-ink); }

/* internal links / related games */
.related { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }

/* Enlaces internos al blog desde las páginas de juego (títulos largos: lista que
   ajusta el texto, a diferencia de los .btn que no envuelven). */
.blog-links { margin-top: 24px; }
.blog-links ul { list-style: none; margin: 0; padding: 0; }
.blog-links li { margin: 0; border-top: 1px solid var(--line); }
.blog-links li:first-child { border-top: 0; }
.blog-links a { display: block; padding: 10px 0 10px 18px; position: relative; color: var(--link); text-decoration: none; font-size: 14px; line-height: 1.45; }
.blog-links a::before { content: "›"; position: absolute; left: 2px; color: var(--ink2); }
.blog-links a:hover { text-decoration: underline; }
.blog-links li.all a { font-weight: 600; }

/* chips de dificultad renderizados como enlaces (navegan a la página del nivel) */
a.chip, a.chip:hover { text-decoration: none; }

/* FAQ (content depth + FAQPage schema) */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.faq-item > summary { cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 15px; color: var(--ink); list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary::after { content: "+"; font-size: 20px; line-height: 1; color: var(--ink3); font-weight: 400; flex: 0 0 auto; }
.faq-item[open] > summary::after { content: "–"; }
.faq-a { padding: 0 16px 14px; }
.faq-a p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--ink2); }

/* footer */
.site-footer { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface); }
.site-footer .wrap { padding: clamp(16px, 3vw, 24px) clamp(12px, 3vw, 24px); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink2); }
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-brand .brand-mark { width: 24px; height: 24px; border-radius: 8px; }
.footer-tech { font-family: 'Plus Jakarta Sans', sans-serif; font-size: 11px; letter-spacing: 0.06em; }
.footer-links { display: flex; gap: 14px; flex-wrap: wrap; }

/* consent banner */
.consent-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 100; background: var(--surface); border-top: 1px solid var(--line); padding: 14px clamp(12px, 3vw, 24px); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; box-shadow: 0 -12px 30px -20px rgba(0,0,0,0.4); }
.consent-banner p { font-size: 13px; color: var(--ink2); flex: 1 1 260px; margin: 0; }
.consent-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* simple content pages (privacidad/terminos/404) */
.doc { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.doc h1 { font-size: clamp(24px, 5vw, 34px); letter-spacing: -0.02em; }
.doc h2 { font-size: 19px; margin-top: 12px; }
.doc p, .doc li { font-size: 15px; line-height: 1.65; color: var(--ink2); }
.doc ul { padding-left: 20px; }

/* contact form */
.contact-form { display: flex; flex-direction: column; gap: 20px; margin-top: 24px; max-width: 560px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 4vw, 32px); box-shadow: 0 18px 40px -32px rgba(15, 23, 42, 0.55); }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field label { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: 0.01em; }
.form-field input, .form-field textarea { font-family: inherit; font-size: 15px; line-height: 1.5; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s; }
.form-field input::placeholder, .form-field textarea::placeholder { color: var(--ink3); opacity: 1; }
.form-field input:focus, .form-field textarea:focus { outline: none; border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.form-field textarea { min-height: 150px; resize: vertical; }
.form-hp { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.form-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 2px; }
.form-actions .btn { padding: 12px 26px; min-height: 48px; font-size: 15px; }
.form-status { font-size: 14px; line-height: 1.45; min-height: 20px; flex: 1 1 180px; }
.form-status.ok { color: var(--ok-ink); font-weight: 500; }
.form-status.err { color: var(--err-ink); }
.form-note { font-size: 13px; color: var(--ink3); margin: 0; }

@media (max-width: 720px) {
  .sidebar { display: none; }
  /* Header: marca + herramientas arriba, nav como tira deslizable debajo */
  .site-header .wrap { flex-wrap: wrap; gap: 10px; }
  .brand { order: 1; }
  .header-tools { order: 2; margin-left: auto; }
  .main-nav { order: 3; flex-basis: 100%; width: 100%; }
}
