/* =========================================================
   NOTAZO · "El cuaderno del estudiante"
   Papel cuadriculado + subrayador fluorescente + pegatinas
   ========================================================= */

/* ===== Tokens ===== */
:root {
  --paper: #fbf8f1;
  --grid-line: rgba(27, 27, 58, .055);
  --surface: #ffffff;
  --surface-2: #f4f0e6;
  --text: #1b1b3a;
  --muted: #5f5c78;
  --line: #e7e1d2;
  --edge: #1b1b3a;
  --hard: #1b1b3a;
  --primary: #5b4bff;
  --primary-soft: #ebe8ff;
  --on-primary: #ffffff;
  --on-accent: #1b1b3a;
  --yellow: #ffe14d;
  --mint: #6ef0b8;
  --coral: #ff8f6b;
  --lilac: #c4b3ff;
  --sky: #8fd3ff;
  --ok: #15803d; --ok-soft: #d9f8e6;
  --warn: #a16207; --warn-soft: #fff4c2;
  --bad: #c2410c; --bad-soft: #ffe4d6;
  --tile-absent: #7b7891;
  --tile-present: #e0a800;
  --tile-correct: #16a34a;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 4px 4px 0 var(--hard);
  --shadow-lg: 7px 7px 0 var(--hard);
  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-hand: "Caveat", "Comic Sans MS", cursive;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #11121f; --grid-line: rgba(255, 255, 255, .035);
    --surface: #1b1c2f; --surface-2: #25263e; --text: #f3f1ff; --muted: #aaa8c6; --line: #2f3050;
    --edge: #4b4d7a; --hard: #05050c; --primary: #8f84ff; --primary-soft: #26244d; --on-primary: #0d0d1a;
    --mint: #5ee6aa; --coral: #ff8a65; --lilac: #b3a0ff; --sky: #7cc8ff;
    --ok: #4ade80; --ok-soft: #14301f; --warn: #facc15; --warn-soft: #362c0c; --bad: #fb923c; --bad-soft: #3a1d12;
    --tile-absent: #3d3e5c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #11121f; --grid-line: rgba(255, 255, 255, .035);
  --surface: #1b1c2f; --surface-2: #25263e; --text: #f3f1ff; --muted: #aaa8c6; --line: #2f3050;
  --edge: #4b4d7a; --hard: #05050c; --primary: #8f84ff; --primary-soft: #26244d; --on-primary: #0d0d1a;
  --mint: #5ee6aa; --coral: #ff8a65; --lilac: #b3a0ff; --sky: #7cc8ff;
  --ok: #4ade80; --ok-soft: #14301f; --warn: #facc15; --warn-soft: #362c0c; --bad: #fb923c; --bad-soft: #3a1d12;
  --tile-absent: #3d3e5c;
  color-scheme: dark;
}

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 16.5px/1.65 var(--font-body);
  background-color: var(--paper);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--yellow); color: #1b1b3a; }
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 28px; padding-bottom: 64px; min-height: 60vh; }
html, body { overflow-x: clip; }
a { color: var(--primary); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.08; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 5vw, 3rem); margin: .15em 0 .35em; font-weight: 800; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); margin-top: 2em; font-weight: 800; }
h3 { font-weight: 700; }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.center { text-align: center; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 50; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }

/* Subrayador fluorescente */
.hl {
  background: linear-gradient(104deg, transparent .25em, var(--hl, var(--yellow)) .25em, var(--hl, var(--yellow)) calc(100% - .15em), transparent calc(100% - .15em)) 0 78% / 100% 40% no-repeat;
  padding: 0 .08em; -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
:root[data-theme="dark"] .hl { color: inherit; }
.hand { font-family: var(--font-hand); font-weight: 700; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--edge);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 1.45rem/1 var(--font-display); letter-spacing: -.03em; color: var(--text); text-decoration: none; }
.logo-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--yellow); color: #1b1b3a; border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--hard);
  font-size: 1.15rem; transform: rotate(-6deg); transition: transform .2s;
}
.logo:hover .logo-mark { transform: rotate(6deg) scale(1.05); }
.nav { display: flex; align-items: center; gap: 2px; }
.nav a { position: relative; z-index: 0; color: var(--text); text-decoration: none; padding: 8px 12px; font-weight: 600; font-size: .96rem; }
.nav a::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 7px; height: 9px; background: var(--yellow); z-index: -1; transform: scaleX(0); transform-origin: left; transition: transform .2s; border-radius: 2px; }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
:root[data-theme="dark"] .nav a:hover, :root[data-theme="dark"] .nav a[aria-current="page"] { color: #1b1b3a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .nav a:hover, :root:not([data-theme="light"]) .nav a[aria-current="page"] { color: #1b1b3a; } }
.nav a:hover::after, .nav a[aria-current="page"]::after { bottom: 4px; top: 4px; height: auto; border-radius: 8px; }
.theme-btn, .menu-btn {
  background: var(--surface); border: 2px solid var(--edge); color: var(--text); border-radius: 12px;
  width: 40px; height: 40px; cursor: pointer; font-size: 1.1rem; box-shadow: 2px 2px 0 var(--hard); margin-left: 8px;
}
.theme-btn:active, .menu-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.menu-btn { display: none; }
@media (max-width: 820px) {
  .menu-btn { display: block; }
  .nav {
    display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 2px solid var(--edge); padding: 8px 16px 16px;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px 10px; font-size: 1.1rem; }
  .theme-btn { align-self: flex-start; margin: 12px 0 0; }
}

/* ===== Footer ===== */
.site-footer { background: #1b1b3a; color: #e9e7ff; padding: 48px 0 20px; position: relative; overflow: hidden; border-top: 2px solid var(--edge); }
.site-footer::before {
  content: 'NOTAZO'; position: absolute; right: -10px; bottom: -0.18em; font: 800 clamp(5rem, 18vw, 13rem)/1 var(--font-display);
  color: transparent; -webkit-text-stroke: 2px rgba(255, 255, 255, .08); letter-spacing: -.04em; pointer-events: none;
}
.site-footer .logo { color: #fff; }
.site-footer .muted { color: #b7b5d6; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 28px; position: relative; }
.footer-inner > div:first-child { max-width: 380px; }
.footer-cols { display: flex; flex-wrap: wrap; gap: 32px 56px; }
.footer-cols h4 { margin: 0 0 10px; font: 800 .8rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--yellow); }
.footer-nav { display: flex; flex-direction: column; gap: 6px; }
.footer-nav a { color: #e9e7ff; text-decoration: none; font-weight: 600; }
.footer-nav a:hover { color: var(--yellow); }
.site-footer > p { position: relative; margin-top: 28px; border-top: 1px solid rgba(255, 255, 255, .12); padding-top: 16px; }

/* ===== Pegatinas / tarjetas ===== */
.grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid > .card:nth-child(5n+1) { --card: var(--yellow); }
.grid > .card:nth-child(5n+2) { --card: var(--lilac); }
.grid > .card:nth-child(5n+3) { --card: var(--mint); }
.grid > .card:nth-child(5n+4) { --card: var(--coral); }
.grid > .card:nth-child(5n+5) { --card: var(--sky); }
.card {
  --card: var(--yellow);
  position: relative; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
a.card { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; transition: transform .18s cubic-bezier(.3, .7, .4, 1.5), box-shadow .18s; }
a.card:hover { transform: translate(-3px, -3px) rotate(-.6deg); box-shadow: var(--shadow-lg); }
a.card:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--hard); }
a.card::after { content: '→'; position: absolute; right: 18px; bottom: 14px; font: 700 1.2rem var(--font-display); opacity: 0; transform: translateX(-6px); transition: .18s; }
a.card:hover::after { opacity: 1; transform: none; }
.card h3 { margin: 10px 0 2px; font-size: 1.2rem; }
.card p { margin: 0; color: var(--muted); font-size: .95rem; padding-right: 14px; }
.card .emoji {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; font-size: 1.7rem;
  background: var(--card); border: 2px solid var(--edge); transform: rotate(-4deg); transition: transform .2s;
}
a.card:hover .emoji { transform: rotate(4deg) scale(1.06); }
.badge {
  display: inline-block; align-self: flex-start; font: 700 .7rem/1 var(--font-body); text-transform: uppercase; letter-spacing: .06em;
  padding: 6px 10px; border-radius: 99px; background: var(--card, var(--yellow)); color: var(--on-accent); border: 2px solid var(--edge);
}
.section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 60px 0 20px; }
.section-title h2 { margin: 4px 0 0; }
.section-title > a { font-weight: 700; text-decoration: none; white-space: nowrap; padding: 6px 14px; border: 2px solid var(--edge); border-radius: 99px; background: var(--surface); color: var(--text); box-shadow: 2px 2px 0 var(--hard); font-size: .9rem; }
.section-title > a:hover { background: var(--yellow); color: #1b1b3a; }
.kicker { display: inline-flex; align-items: center; gap: 8px; font: 700 .78rem/1 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.kicker b { display: grid; place-items: center; min-width: 30px; height: 26px; padding: 0 6px; border-radius: 8px; background: var(--text); color: var(--paper); font-size: .78rem; }

/* ===== Herramientas ===== */
.tool { max-width: 760px; margin: 0 auto; }
.tool-box {
  background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-lg); margin: 20px 0 28px; position: relative;
}
.tool-box h2 { font-size: 1.25rem; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: .95rem; }
.field label input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); vertical-align: -3px; margin-right: 6px; }
.field .hint { font-size: .84rem; color: var(--muted); }
input, select, button { font: inherit; }
input[type="number"], input[type="text"], input[type="date"], input[type="time"], select {
  width: 100%; padding: 10px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); color: var(--text); min-height: 48px; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus { border-color: var(--edge); outline: none; box-shadow: 3px 3px 0 var(--primary); }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 22px; border-radius: 14px; border: 2px solid var(--edge); cursor: pointer; font-weight: 700;
  background: var(--primary); color: var(--on-primary); text-decoration: none; box-shadow: 3px 3px 0 var(--hard);
  transition: transform .1s, box-shadow .1s, background .15s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--hard); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--hard); }
.btn.secondary { background: var(--surface); color: var(--text); }
.btn.secondary:hover { background: var(--yellow); color: #1b1b3a; }
.btn.yellow { background: var(--yellow); color: #1b1b3a; }
.btn.small { min-height: 38px; padding: 6px 14px; font-size: .9rem; box-shadow: 2px 2px 0 var(--hard); }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.icon-btn { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.25rem; padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.result {
  margin-top: 20px; padding: 20px; border-radius: var(--radius); background: var(--primary-soft); text-align: center;
  border: 2px solid var(--edge); box-shadow: var(--shadow); animation: stick .35s cubic-bezier(.3, .7, .4, 1.4);
}
.result .big { font: 800 clamp(2.6rem, 9vw, 3.4rem)/1.05 var(--font-display); color: var(--primary); letter-spacing: -.03em; }
.result.ok { background: var(--ok-soft); } .result.ok .big { color: var(--ok); }
.result.bad { background: var(--bad-soft); } .result.bad .big { color: var(--bad); }
.result.warn { background: var(--warn-soft); } .result.warn .big { color: var(--warn); }
.result p { margin: 6px 0 0; }
@keyframes stick { from { transform: scale(.92) rotate(-2deg); opacity: 0; } }

.subject-row { display: grid; grid-template-columns: 1fr 92px 96px 36px; gap: 8px; align-items: center; margin-bottom: 8px; }
.subject-row.two { grid-template-columns: 1fr 100px 36px; }
@media (max-width: 480px) {
  .subject-row { grid-template-columns: 1fr 1fr 32px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
  .subject-row > :first-child { grid-column: 1 / -1; }
  .subject-row[aria-hidden="true"] { display: none; }
}

/* Texto largo (SEO) con aire de apuntes */
.prose { max-width: 760px; margin: 0 auto; }
.prose h2 { font-size: 1.45rem; }
.prose h2::before { content: '§ '; color: var(--primary); }
.prose li { margin: 4px 0; }
.prose li::marker { color: var(--primary); font-weight: 700; }
.prose table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0; font-size: .95rem; display: block; overflow-x: auto; border: 2px solid var(--edge); border-radius: var(--radius-sm); background: var(--surface); }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose tr:last-child td { border-bottom: none; }
.prose th { background: var(--yellow); color: #1b1b3a; }
.formula {
  background: var(--surface); border: 2px dashed var(--edge); padding: 18px 18px 14px; border-radius: var(--radius-sm);
  font: 700 1.02rem/1.5 var(--font-body); overflow-x: auto; position: relative; margin-top: 22px;
}
.formula::before { content: 'fórmula'; position: absolute; top: -13px; left: 14px; background: var(--mint); color: #1b1b3a; font: 700 1.05rem/1 var(--font-hand); padding: 3px 10px; border: 2px solid var(--edge); border-radius: 99px; transform: rotate(-3deg); }
.formula { overflow: visible; }
details { background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); padding: 14px 18px; margin: 10px 0; box-shadow: 2px 2px 0 var(--hard); }
details[open] { box-shadow: var(--shadow); }
details summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; font: 800 1.3rem/1 var(--font-display); transition: transform .2s; }
details[open] summary::after { transform: rotate(45deg); }
.tool-box details { box-shadow: none; }
.breadcrumb { font-size: .86rem; color: var(--muted); font-weight: 600; }
.breadcrumb a { color: var(--muted); text-decoration: none; border-bottom: 3px solid var(--yellow); }

/* Anuncios: siempre lejos de los controles de juego */
.ad-slot { margin: 40px auto; min-height: 100px; max-width: 728px; }
.ad-slot:empty { display: none; }

/* ===== Cuenta atrás ===== */
.countdown { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 24px 0 10px; }
.countdown div { background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius); padding: 16px 4px; text-align: center; box-shadow: var(--shadow); }
.countdown div:nth-child(1) { background: var(--yellow); transform: rotate(-1.5deg); }
.countdown div:nth-child(3) { transform: rotate(1deg); }
.countdown div:nth-child(1) b, .countdown div:nth-child(1) span { color: #1b1b3a; }
.countdown b { display: block; font: 800 clamp(2rem, 8vw, 3.4rem)/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); letter-spacing: -.03em; }
.countdown span { font-size: .74rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.pill-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.pill-list a { display: inline-block; padding: 7px 14px; border-radius: 99px; background: var(--surface); border: 2px solid var(--edge); color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 600; box-shadow: 2px 2px 0 var(--hard); }
.pill-list a:hover { background: var(--yellow); color: #1b1b3a; }

/* ===== Juegos: base ===== */
.game { max-width: 540px; margin: 0 auto; text-align: center; }
.game > h1 { font-size: clamp(1.8rem, 6vw, 2.4rem); }
.game-head { display: flex; align-items: center; justify-content: space-between; }
.game-head h1 { font-size: clamp(1.5rem, 5vw, 1.9rem); margin: 0; }
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stats-row div { text-align: center; background: var(--surface-2); border-radius: var(--radius-sm); padding: 8px 4px; }
.stats-row b { display: block; font: 800 1.6rem/1.1 var(--font-display); }
.stats-row span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.toast {
  position: fixed; top: 80px; left: 50%; transform: translate(-50%, -10px); background: var(--yellow); color: #1b1b3a;
  border: 2px solid #1b1b3a; box-shadow: 3px 3px 0 #1b1b3a; padding: 10px 18px; border-radius: 14px; font-weight: 700;
  z-index: 60; pointer-events: none; opacity: 0; transition: opacity .2s, transform .2s; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Palabra del día */
.board { display: grid; grid-template-rows: repeat(6, 1fr); gap: 7px; width: min(340px, 100%); margin: 18px auto; }
.board-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.tile { aspect-ratio: 1; display: grid; place-items: center; font: 800 1.9rem/1 var(--font-display); text-transform: uppercase; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); }
.tile.filled { border-color: var(--edge); animation: pop .12s; }
.tile.correct, .tile.present, .tile.absent { color: #fff; border-color: var(--edge); box-shadow: 2px 2px 0 var(--hard); animation: flip .45s; }
.tile.correct { background: var(--tile-correct); }
.tile.present { background: var(--tile-present); }
.tile.absent { background: var(--tile-absent); }
.board-row.shake { animation: shake .4s; }
@keyframes pop { 50% { transform: scale(1.1); } }
@keyframes flip { 0% { transform: rotateX(90deg); } 100% { transform: none; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.keyboard { display: flex; flex-direction: column; gap: 7px; margin: 8px auto; max-width: 500px; user-select: none; }
.kb-row { display: flex; gap: 5px; justify-content: center; }
.key { flex: 1; min-width: 0; height: 56px; border: 2px solid var(--edge); border-radius: 9px; background: var(--surface); color: var(--text); font: 700 .98rem var(--font-body); text-transform: uppercase; cursor: pointer; padding: 0; box-shadow: 0 3px 0 var(--hard); }
.key:active { transform: translateY(3px); box-shadow: none; }
.key.wide { flex: 1.6; font-size: .72rem; }
.key.correct { background: var(--tile-correct); color: #fff; }
.key.present { background: var(--tile-present); color: #fff; }
.key.absent { background: var(--tile-absent); color: #fff; opacity: .85; }

/* Cronología */
.timeline { list-style: none; padding: 0; margin: 18px 0; text-align: left; counter-reset: t; }
.timeline li { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 10px; box-shadow: 3px 3px 0 var(--hard); counter-increment: t; }
.timeline li::before { content: counter(t); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--yellow); color: #1b1b3a; font: 800 .9rem var(--font-display); border: 2px solid var(--edge); }
.timeline li.ok { background: var(--ok-soft); }
.timeline li.ok::before { background: var(--mint); }
.timeline li.bad { background: var(--bad-soft); }
.timeline .txt { flex: 1; font-weight: 600; }
.timeline .year { font: 800 1.15rem var(--font-display); color: var(--primary); min-width: 3.5em; text-align: right; }
.timeline .moves { display: flex; flex-direction: column; gap: 3px; }
.timeline .moves button { background: var(--surface-2); border: 2px solid var(--edge); color: var(--text); border-radius: 8px; width: 40px; height: 30px; cursor: pointer; font-size: .8rem; }
.timeline .moves button:hover:not(:disabled) { background: var(--yellow); color: #1b1b3a; }
.timeline .moves button:disabled { opacity: .25; cursor: default; }

/* Cálculo mental */
.math-q { font: 800 clamp(2.6rem, 11vw, 4rem)/1.1 var(--font-display); margin: 22px 0 12px; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.math-input { font-size: 2rem !important; text-align: center; max-width: 230px; margin: 0 auto; display: block; border-color: var(--edge) !important; box-shadow: 4px 4px 0 var(--hard) !important; font-weight: 800; }
.progress { height: 14px; background: var(--surface); border: 2px solid var(--edge); border-radius: 99px; overflow: hidden; margin: 14px 0; }
.progress > div { height: 100%; background: repeating-linear-gradient(-45deg, var(--primary) 0 10px, color-mix(in srgb, var(--primary) 78%, #fff) 10px 20px); width: 0; transition: width .25s; }
.timer { font: 800 1.2rem var(--font-display); font-variant-numeric: tabular-nums; background: var(--yellow); color: #1b1b3a; padding: 2px 10px; border-radius: 8px; border: 2px solid var(--edge); }

/* Pomodoro */
.pomo-clock { font: 800 clamp(4.5rem, 22vw, 8rem)/1 var(--font-display); font-variant-numeric: tabular-nums; margin: 20px auto; letter-spacing: -.04em; background: var(--surface); border: 2px solid var(--edge); border-radius: 28px; box-shadow: var(--shadow-lg); padding: 24px 12px; max-width: 460px; }
.mode-tabs { display: inline-flex; gap: 4px; background: var(--surface); padding: 5px; border-radius: 14px; border: 2px solid var(--edge); max-width: 100%; box-shadow: 2px 2px 0 var(--hard); }
.mode-tabs button { border: none; background: none; color: var(--text); padding: 8px 16px; border-radius: 10px; cursor: pointer; font-weight: 700; }
.mode-tabs button.active { background: var(--coral); color: #1b1b3a; }

/* Modal */
dialog { border: 2px solid var(--edge); border-radius: 22px; background: var(--surface); color: var(--text); padding: 26px; max-width: min(430px, calc(100vw - 32px)); width: 100%; box-shadow: 8px 8px 0 var(--hard); }
dialog::backdrop { background: rgba(17, 18, 31, .55); backdrop-filter: blur(3px); }
dialog h2 { margin-top: 0; }
.dist-bar { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: .9rem; font-weight: 700; }
.dist-bar div { background: var(--tile-absent); color: #fff; padding: 2px 8px; text-align: right; border-radius: 6px; min-width: 24px; font-weight: 800; }
.dist-bar div.hl { background: var(--tile-correct); }

/* ===== Fútbol ===== */
.club-path { list-style: none; padding: 0; margin: 16px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.club-path li { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 2px solid var(--edge); border-radius: 99px; padding: 6px 14px 6px 6px; font-weight: 700; box-shadow: 2px 2px 0 var(--hard); }
.club-path li:nth-child(odd) { transform: rotate(-1deg); }
.club-path li:nth-child(even) { transform: rotate(1deg); }
.club-n { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: #1b1b3a; font-size: .78rem; border: 2px solid var(--edge); }
.hints { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.hint-box { background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); padding: 10px; box-shadow: 2px 2px 0 var(--hard); }
.hint-box span { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.hint-box b { font-family: var(--font-display); font-size: 1.1rem; }
.hint-box.locked { background: var(--surface-2); box-shadow: none; border-style: dashed; opacity: .75; }
.guess-list { list-style: none; padding: 0; text-align: left; }
.guess-list li { padding: 8px 12px; border-radius: 10px; margin-bottom: 6px; font-weight: 600; border: 2px solid var(--edge); }
.guess-list li.ok { background: var(--ok-soft); } .guess-list li.bad { background: var(--bad-soft); }
.guess-form { display: flex; gap: 8px; }
.guess-form input { flex: 1; }
.options { display: grid; gap: 10px; margin: 18px 0; }
.option { text-align: left; padding: 14px 16px; min-height: 52px; border-radius: 14px; border: 2px solid var(--edge); background: var(--surface); color: var(--text); font-weight: 700; cursor: pointer; box-shadow: 3px 3px 0 var(--hard); transition: transform .1s, box-shadow .1s, background .15s; }
.option:hover:not(:disabled) { background: var(--yellow); color: #1b1b3a; transform: translate(-1px, -1px); }
.option:disabled { cursor: default; box-shadow: 1px 1px 0 var(--hard); }
.option.ok { background: var(--mint); color: #1b1b3a; }
.option.bad { background: var(--coral); color: #1b1b3a; }
.quiz-q { font: 800 1.45rem/1.25 var(--font-display); margin: 12px 0 0; }

.pitch { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; margin: 14px 0;
  background: repeating-linear-gradient(180deg, #2f9e44 0 12%, #37b24d 12% 24%); border: 2px solid var(--edge); box-shadow: var(--shadow-lg); }
.pitch::after { content: ''; position: absolute; left: 50%; top: 82%; width: 6px; height: 6px; margin: -3px; border-radius: 50%; background: rgba(255, 255, 255, .8); }
.goal { position: absolute; left: 12%; right: 12%; top: 12%; height: 46%; border: 6px solid #fff; border-bottom: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.18) 0 2px, transparent 2px 12px), repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 2px, transparent 2px 12px), rgba(0,0,0,.12); }
.goal-zones { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); z-index: 3; }
.zone { background: transparent; border: 1px dashed rgba(255, 255, 255, .35); cursor: crosshair; }
.zone:hover, .zone:focus-visible { background: rgba(255, 225, 77, .3); }
.pitch.defending .zone { cursor: pointer; }
.pitch.defending .zone:hover { background: rgba(143, 211, 255, .35); }
.keeper { position: absolute; bottom: 0; left: 50%; width: 15%; height: 62%; transform: translateX(-50%); transform-origin: 50% 100%;
  background: var(--coral); border: 2px solid #1b1b3a; border-radius: 45% 45% 8px 8px; transition: left .45s ease-out, transform .45s ease-out; z-index: 2; }
.keeper::before { content: ''; position: absolute; left: 50%; top: -30%; width: 70%; aspect-ratio: 1; transform: translateX(-50%); border-radius: 50%; background: #f1c9a5; border: 2px solid #1b1b3a; }
.ball { position: absolute; font-size: clamp(1.4rem, 6vw, 2.2rem); line-height: 1; transition: left .5s ease-out, top .5s ease-out, transform .5s ease-out; z-index: 4; pointer-events: none; }
.scoreboard { display: grid; grid-template-columns: auto 1fr auto; gap: 8px 12px; align-items: center; background: #1b1b3a; color: #fff; border: 2px solid var(--edge); border-radius: var(--radius-sm); padding: 12px 16px; text-align: left; box-shadow: var(--shadow); font-weight: 700; }
.scoreboard b { font: 800 1.5rem var(--font-display); color: var(--yellow); }
.dots { display: flex; flex-wrap: wrap; gap: 5px; }
.dot { width: 16px; height: 16px; border-radius: 50%; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .35); }
.dot.g { background: var(--mint); border-color: var(--mint); }
.dot.f { background: var(--coral); border-color: var(--coral); }
.penalty-msg { min-height: 3em; font: 700 1.05rem/1.4 var(--font-body); margin: 10px 0; }

/* ===== Esquiva el tráfico ===== */
.car-hud { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.car-hud div { background: var(--surface); border: 2px solid var(--edge); border-radius: var(--radius-sm); padding: 6px; box-shadow: 2px 2px 0 var(--hard); }
.car-hud div:nth-child(2) { background: var(--yellow); color: #1b1b3a; }
.car-hud div:nth-child(2) span { color: #1b1b3a; opacity: .7; }
.car-hud span { display: block; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.car-hud b { font: 800 1.05rem var(--font-display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.car-hud b span { display: inline; font: inherit; color: inherit; opacity: 1; letter-spacing: 0; text-transform: none; }
.car-wrap { position: relative; width: 100%; max-width: 420px; margin: 0 auto; }
#pista { display: block; width: 100%; height: min(calc(100vh - 300px), 560px); min-height: 360px; border-radius: var(--radius); touch-action: none; border: 2px solid var(--edge); box-shadow: var(--shadow-lg); outline: none; }
.car-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 20px;
  background: rgba(17, 18, 31, .84); color: #fff; border-radius: var(--radius); text-align: center; }
.car-overlay p { margin: 4px 0; }
.ov-title { font: 800 1.8rem/1.1 var(--font-display); }
.ov-big { font: 800 3.6rem/1 var(--font-display); color: var(--yellow); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.ov-sub { color: #d4d4e8; font-size: .95rem; }
.ov-extra { color: var(--mint); font-weight: 700; }
.ov-help { font-size: .82rem; color: #a5a5c0; }
.ov-btns { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; width: min(270px, 100%); }
.car-overlay .btn { box-shadow: 3px 3px 0 #000; border-color: #000; }
.car-overlay .btn.secondary { background: rgba(255, 255, 255, .1); color: #fff; border-color: rgba(255, 255, 255, .35); }
.car-overlay .btn.secondary:hover { background: var(--yellow); color: #1b1b3a; }
.car-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 420px; margin: 14px auto 0; }
.car-controls button { height: 66px; font-size: 1.6rem; border-radius: var(--radius); border: 2px solid var(--edge); background: var(--surface); color: var(--text); cursor: pointer; touch-action: manipulation; user-select: none; box-shadow: 0 4px 0 var(--hard); }
.car-controls button:active { transform: translateY(4px); box-shadow: none; background: var(--yellow); }
@media (hover: hover) and (pointer: fine) { .car-controls { display: none; } }

/* =========================================================
   PORTADA
   ========================================================= */
.home-hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; padding: 20px 0 8px; }
@media (max-width: 880px) { .home-hero { grid-template-columns: 1fr; gap: 12px; } }
.home-hero h1 { font-size: clamp(2.7rem, 7.4vw, 4.8rem); line-height: .97; margin: 18px 0 20px; letter-spacing: -.045em; }
.home-hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 520px; margin: 0 0 26px; }
.home-hero .hand-note { display: inline-block; font-size: 1.6rem; color: var(--primary); transform: rotate(-3deg); margin: 14px 0 0 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: var(--surface); border: 2px solid var(--edge); font-weight: 700; font-size: .85rem; }

/* Collage de pegatinas */
.collage { position: relative; height: 430px; }
@media (max-width: 880px) { .collage { height: 340px; margin: 8px auto 0; width: min(430px, 100%); } }
.sticker { position: absolute; background: var(--surface); border: 2px solid var(--edge); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 14px 16px; animation: float 6s ease-in-out infinite; transform: rotate(var(--r, 0deg)); }
.sticker small { display: block; font-size: .68rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); }
.st-grade { top: 2%; left: 2%; background: var(--yellow); color: #1b1b3a; --r: -6deg; }
.st-grade small, .st-car small { color: #1b1b3a; opacity: .7; }
.st-grade b { font: 800 clamp(2.4rem, 7vw, 3.2rem)/1 var(--font-display); letter-spacing: -.04em; }
.st-grade i { font-style: normal; font-weight: 700; opacity: .6; }
.st-word { top: 12%; right: 0; --r: 5deg; animation-delay: -1.5s; }
.st-word .mini { display: flex; gap: 4px; margin-top: 6px; }
.st-word .mini span { width: clamp(28px, 7vw, 34px); aspect-ratio: 1; display: grid; place-items: center; font: 800 1.05rem var(--font-display); color: #fff; border-radius: 7px; border: 2px solid var(--edge); }
.st-streak { bottom: 30%; left: 0; background: var(--coral); color: #1b1b3a; --r: 4deg; animation-delay: -3s; font: 800 1.3rem var(--font-display); }
.st-car { bottom: 5%; right: 4%; background: var(--mint); color: #1b1b3a; --r: -4deg; animation-delay: -4.5s; }
.st-car b { font: 800 1.7rem var(--font-display); }
.st-ball { top: 42%; left: 42%; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; font-size: 2.5rem; background: var(--lilac); animation-delay: -2s; padding: 0; }
.st-note { position: absolute; bottom: -4px; left: 6%; font-size: 1.45rem; color: var(--muted); transform: rotate(-4deg); }
@keyframes float { 0%, 100% { transform: rotate(var(--r, 0deg)) translateY(0); } 50% { transform: rotate(var(--r, 0deg)) translateY(-8px); } }

/* Cinta de palabras */
.ticker { overflow: hidden; border-block: 2px solid var(--edge); background: var(--yellow); color: #1b1b3a; margin: 44px calc(50% - 50vw) 0; transform: rotate(-1.2deg); box-shadow: 0 4px 0 var(--hard); }
.ticker-track { display: flex; width: max-content; padding: 12px 0; animation: ticker 36s linear infinite; font: 800 1.1rem var(--font-display); text-transform: uppercase; letter-spacing: .02em; white-space: nowrap; }
.ticker-track span { padding: 0 14px; }
.ticker-track span::after { content: '✦'; margin-left: 28px; }
@keyframes ticker { to { transform: translateX(-50%); } }

/* Panel "Tus retos de hoy" */
.today { margin-top: 60px; background: #1b1b3a; color: #fff; border: 2px solid var(--edge); border-radius: 26px; padding: 26px; box-shadow: var(--shadow-lg); position: relative; overflow: hidden; }
.today::after { content: ''; position: absolute; right: -70px; top: -70px; width: 240px; height: 240px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 225, 77, .32), transparent 70%); pointer-events: none; }
.today-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 20px; position: relative; }
.today-head h2 { margin: 0; color: #fff; font-size: clamp(1.6rem, 4vw, 2.1rem); }
.today-head .hand { color: var(--yellow); font-size: 1.45rem; display: block; transform: rotate(-2deg); margin-bottom: 2px; }
.today-meter { min-width: 220px; flex: 1; max-width: 340px; }
.today-meter .bar { height: 16px; border-radius: 99px; background: rgba(255, 255, 255, .1); border: 2px solid rgba(255, 255, 255, .28); overflow: hidden; }
.today-meter .bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--mint), var(--yellow)); transition: width .7s cubic-bezier(.3, .7, .4, 1); border-radius: 99px; }
.today-meter p { margin: 8px 0 0; font-weight: 700; font-size: .92rem; color: #d4d2f0; }
.today-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; position: relative; }
.today-item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 14px; background: rgba(255, 255, 255, .06); border: 2px solid rgba(255, 255, 255, .16); color: #fff; text-decoration: none; font-weight: 700; transition: background .15s, transform .15s; }
.today-item:hover { background: rgba(255, 255, 255, .13); transform: translateY(-2px); }
.today-item .ico { font-size: 1.3rem; }
.today-item .st { margin-left: auto; font-size: .7rem; padding: 3px 8px; border-radius: 99px; background: var(--yellow); color: #1b1b3a; white-space: nowrap; }
.today-item.done { background: rgba(110, 240, 184, .13); border-color: var(--mint); }
.today-item.done .st { background: var(--mint); }

/* Cuenta atrás en directo dentro de tarjetas */
.card .live { font: 800 2rem/1 var(--font-display); letter-spacing: -.03em; color: var(--text); margin: 8px 0 2px; }
.card .live small { font: 600 .9rem var(--font-body); color: var(--muted); letter-spacing: 0; }

/* Bloque "cómo funciona" */
.about { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; align-items: start; margin-top: 70px; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } }
.about .card { transform: rotate(-.6deg); }
.about h2 { margin-top: 0; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; counter-reset: s; }
.steps li { display: flex; gap: 14px; align-items: flex-start; counter-increment: s; }
.steps li::before { content: counter(s); flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--yellow); border: 2px solid var(--edge); font: 800 1rem var(--font-display); color: #1b1b3a; }
.steps li:nth-child(2)::before { background: var(--lilac); }
.steps li:nth-child(3)::before { background: var(--mint); }
.steps b { display: block; }
.steps span { color: var(--muted); }

/* Cabecera de páginas de sección */
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 10px 0 8px; }
.page-head p { color: var(--muted); font-size: 1.08rem; max-width: 620px; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
