/* =========================================================================
   Jardín de Giselle · cuaderno de invernadero
   ========================================================================= */
:root {
  --paper: #EDF1E2;
  --paper-2: #E1E8D4;
  --paper-3: #D2DFC4;
  --ink: #17301F;
  --ink-2: #3D5844;
  --ink-3: #5B7361;
  --leaf: #2E6B45;
  --leaf-2: #4F8D5E;
  --leaf-soft: #CFE0C3;
  --red: #C42238;
  --red-deep: #9C1A2C;
  --red-soft: #F6D4D4;
  --rose: #E9A4A9;
  --line: rgba(23, 48, 31, .14);
  --line-2: rgba(23, 48, 31, .24);
  --shadow: 0 1px 2px rgba(23, 48, 31, .06), 0 8px 24px -10px rgba(23, 48, 31, .28);
  --shadow-lg: 0 2px 4px rgba(23, 48, 31, .06), 0 22px 48px -18px rgba(23, 48, 31, .38);
  --r: 14px;
  --r-sm: 9px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", "Segoe UI", system-ui, sans-serif;
  --hand: "Dancing Script", "Segoe Print", cursive;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--leaf-2) var(--paper-2); }
body {
  margin: 0;
  background: var(--paper);
  background-image:
    radial-gradient(circle at 12% -10%, rgba(79, 141, 94, .16), transparent 42%),
    radial-gradient(circle at 110% 30%, rgba(196, 34, 56, .07), transparent 38%);
  background-attachment: fixed;
  color: var(--ink);
  font: 400 1rem/1.55 var(--sans);
  min-height: 100vh;
  overflow-x: hidden;
}
::selection { background: var(--red); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--leaf-2); border-radius: 10px; border: 2px solid var(--paper-2); }
a { color: var(--leaf); text-underline-offset: .2em; text-decoration-thickness: 1.5px; }
input, textarea, select, button { font: inherit; color: inherit; caret-color: var(--red); }
:focus-visible { outline: 2.5px solid var(--red); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { font-family: var(--serif); font-weight: 650; line-height: 1.12; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
.ico { width: 1.25em; height: 1.25em; flex: none; display: inline-block; vertical-align: -.25em; }
.ico.tiny { width: .95em; height: .95em; color: var(--red); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ---------- Barra superior ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px 20px;
  padding: 10px var(--gutter);
  background: rgba(237, 241, 226, .86);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-family: var(--serif); font-size: 1.15rem; font-weight: 600; white-space: nowrap; }
.brand em { font-style: italic; color: var(--red); }
.brand-mark { color: var(--red); display: inline-flex; }
.brand-mark .ico { width: 1.35em; height: 1.35em; animation: beat 2.8s var(--ease) infinite; }
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; justify-self: center; max-width: 100%; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  padding: 7px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2);
  font-weight: 600; font-size: .92rem; white-space: nowrap; transition: background .25s var(--ease), color .25s var(--ease);
}
.nav a:hover { background: var(--paper-3); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--leaf); color: #fff; }
.garland { display: flex; gap: 2px; color: var(--red); }
.g-heart { display: inline-flex; color: var(--ink-3); opacity: .55; }
.g-heart.on { color: var(--red); opacity: 1; }
.g-heart .ico { width: 18px; height: 18px; }
.g-heart.bloom .ico { animation: bloom .9s var(--ease); }
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; padding-block: 8px 6px; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-self: stretch; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .g-heart .ico { width: 15px; height: 15px; }
}

main { padding: 0 var(--gutter) 72px; max-width: 1180px; margin: 0 auto; outline: none; }
main:focus, main:focus-visible { outline: none; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: 999px; border: 1.5px solid transparent;
  font-weight: 650; font-size: .97rem; cursor: pointer; text-decoration: none; line-height: 1.1;
  transition: transform .2s var(--ease), background .2s var(--ease), box-shadow .25s var(--ease), color .2s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-red { background: var(--red); color: #fff; box-shadow: var(--shadow); }
.btn-red:hover:not(:disabled) { background: var(--red-deep); box-shadow: var(--shadow-lg); }
.btn-green { background: var(--leaf); color: #fff; }
.btn-green:hover:not(:disabled) { background: #245637; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: var(--paper-3); border-color: var(--leaf-2); }
.btn-big { min-height: 52px; padding-inline: 26px; font-size: 1.05rem; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.hint-small { font-size: .86rem; color: var(--ink-3); }

/* ---------- Portada ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 24px; align-items: center; padding: clamp(36px, 7vw, 88px) 0 clamp(28px, 5vw, 56px); }
.hero-title { font-size: clamp(2.6rem, 8vw, 5.4rem); font-weight: 500; letter-spacing: -.035em; line-height: .98; }
.hero-title em { display: block; font-style: italic; font-weight: 700; color: var(--red); }
.hero-msg { margin-top: 22px; font-size: clamp(1.05rem, 2.2vw, 1.22rem); max-width: 56ch; color: var(--ink-2); }
.hero-sign { margin-top: 14px; font-family: var(--hand); font-size: 1.6rem; color: var(--leaf); line-height: 1.2; }
.hero-cta { margin-top: 28px; display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.hero-count { color: var(--ink-2); font-size: .95rem; }
.hero-count strong { color: var(--red); }
.hero-art { color: var(--leaf-2); }
.hero-art svg { width: 100%; max-height: 380px; overflow: visible; }
.hero-art .vine { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 2.4s .2s var(--ease) forwards; }
.hero-art .leaf { fill: var(--leaf-soft); stroke: var(--leaf-2); stroke-width: 1.4; opacity: 0; animation: fadeIn .9s var(--ease) forwards; }
.hero-art .leaf:nth-of-type(2) { animation-delay: .7s; } .hero-art .leaf:nth-of-type(3) { animation-delay: 1s; }
.hero-art .leaf:nth-of-type(4) { animation-delay: 1.3s; } .hero-art .leaf:nth-of-type(5) { animation-delay: 1.6s; } .hero-art .leaf:nth-of-type(6) { animation-delay: .5s; }
.hero-art .hh path { fill: var(--red); }
.hero-art .hh { opacity: 0; animation: fadeIn .8s var(--ease) forwards, float 6s ease-in-out infinite; transform-box: fill-box; }
.hero-art .h1 { animation-delay: 1.2s, 2s; } .hero-art .h2 { animation-delay: 1.8s, 2.4s; }
.hero-art .h3 { animation-delay: 1.5s, 2.2s; } .hero-art .h4 { animation-delay: 2s, 2.8s; }
.hero-art .h2 path, .hero-art .h3 path { fill: var(--rose); }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero-art { position: absolute; right: -16px; top: 0; width: 150px; opacity: .6; pointer-events: none; z-index: -1; }
  .hero-art svg { max-height: 170px; }
  main { position: relative; }
}

.games h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); margin-bottom: 14px; }
.index { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-2); }
.index-item { border-bottom: 1px solid var(--line-2); animation: fadeUp .7s var(--ease) both; animation-delay: calc(var(--i) * 60ms + 150ms); }
.index-item a {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  padding: 18px 8px; text-decoration: none; color: var(--ink);
  transition: background .3s var(--ease), padding .3s var(--ease);
}
.index-item a:hover { background: linear-gradient(90deg, rgba(207, 224, 195, .55), transparent 80%); padding-left: 16px; }
.index-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--leaf); color: #fff; transition: transform .4s var(--ease); }
.index-item a:hover .index-ico { transform: rotate(-8deg) scale(1.05); }
.index-ico .ico { width: 26px; height: 26px; }
.index-text { display: grid; gap: 2px; min-width: 0; }
.index-name { font-family: var(--serif); font-size: clamp(1.25rem, 2.8vw, 1.7rem); font-weight: 600; letter-spacing: -.02em; }
.index-desc { color: var(--ink-2); font-size: .95rem; }
.index-state { color: var(--ink-3); opacity: .6; }
.index-state.on { color: var(--red); opacity: 1; }
.index-state .ico { width: 26px; height: 26px; }
@media (max-width: 520px) { .index-item a { gap: 12px; padding: 14px 2px; } .index-ico { width: 42px; height: 42px; } .index-ico .ico { width: 22px; height: 22px; } }

.letter {
  margin-top: 48px; display: grid; grid-template-columns: auto 1fr; gap: 18px 22px; align-items: start;
  padding: clamp(20px, 4vw, 36px); border-radius: var(--r); background: var(--paper-2);
  border: 1.5px dashed var(--line-2);
}
.letter h2 { font-size: 1.5rem; margin-bottom: 6px; }
.letter-seal { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; box-shadow: var(--shadow); }
.letter-seal .ico { width: 26px; height: 26px; }
.letter.open { background: #F8FAF1; border-style: solid; border-color: var(--line); box-shadow: var(--shadow-lg); }
.letter.open .letter-body { font-family: var(--hand); font-size: 1.55rem; line-height: 1.35; color: var(--ink); display: grid; gap: 10px; max-width: 60ch; }
.letter.open .letter-body p { opacity: 0; animation: fadeUp .9s var(--ease) forwards; }
.letter.open .letter-body p:nth-child(2) { animation-delay: .3s; } .letter.open .letter-body p:nth-child(3) { animation-delay: .6s; }
.letter.open .letter-body p:nth-child(4) { animation-delay: .9s; } .letter.open .letter-body p:nth-child(5) { animation-delay: 1.2s; }
.letter.open .letter-body p:nth-child(6) { animation-delay: 1.5s; } .letter.open .letter-body p:nth-child(7) { animation-delay: 1.8s; }
.letter-hi { font-weight: 700; color: var(--red); }
.letter-sign { color: var(--leaf); text-align: right; }
@media (max-width: 520px) { .letter { grid-template-columns: 1fr; } }

/* ---------- Cabecera de juego ---------- */
.game-head { padding: 22px 0 18px; }
.back { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .92rem; text-decoration: none; color: var(--ink-2); padding: 6px 10px 6px 4px; border-radius: 999px; }
.back:hover { color: var(--red); background: var(--paper-2); }
.game-title { display: flex; align-items: center; gap: 16px; margin-top: 10px; }
.game-ico { display: grid; place-items: center; width: 58px; height: 58px; flex: none; border-radius: 50%; background: var(--leaf); color: #fff; }
.game-ico .ico { width: 30px; height: 30px; }
.game-title h1 { font-size: clamp(2rem, 5vw, 3.1rem); letter-spacing: -.03em; }
.lede { color: var(--ink-2); max-width: 62ch; margin-top: 4px; }
@media (max-width: 520px) {
  .game-head { padding: 12px 0 14px; }
  .game-ico { display: none; }
  .game-title { margin-top: 4px; }
  .lede { font-size: .93rem; }
}

.howto { background: var(--paper-2); border-radius: var(--r-sm); margin-bottom: 18px; }
.howto summary { cursor: pointer; padding: 12px 16px; font-weight: 650; display: flex; align-items: center; gap: 8px; list-style: none; color: var(--leaf); }
.howto summary::-webkit-details-marker { display: none; }
.howto summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .3s var(--ease); }
.howto[open] summary::after { transform: rotate(-135deg); }
.howto > div, .howto > ul { padding: 0 16px 14px; display: grid; gap: 8px; color: var(--ink-2); max-width: 75ch; }

/* Segmentados */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.seg-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: transparent; cursor: pointer; font-weight: 600; color: var(--ink-2);
  transition: background .25s var(--ease), color .25s, border-color .25s;
}
.seg-btn:hover { border-color: var(--leaf-2); color: var(--ink); }
.seg-btn[aria-selected="true"], .seg-btn[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.seg-btn[aria-selected="true"] .ico.tiny { color: var(--rose); }
.seg-small .seg-btn { min-height: 36px; padding: 6px 12px; font-size: .9rem; }

/* ---------- Murdoku ---------- */
.mk-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 22px; align-items: start; }
@media (max-width: 900px) { .mk-layout { grid-template-columns: 1fr; } }
.mk-file, .mk-board, .mk-accuse, .mk-solution { background: #F8FAF1; border-radius: var(--r); padding: clamp(16px, 3vw, 26px); box-shadow: var(--shadow); }
.mk-file h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); color: var(--ink); }
.mk-intro { margin-top: 10px; color: var(--ink-2); }
.mk-file h3, .mk-board h3, .mk-accuse h3, .mk-solution h3 { font-size: 1.2rem; margin: 18px 0 10px; }
.mk-board h3 { margin-top: 0; }
.mk-clues { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.clue { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; background: transparent; border: 0; padding: 8px 8px; border-radius: var(--r-sm); cursor: pointer; transition: background .2s, opacity .3s; }
.clue:hover { background: var(--paper-2); }
.clue-n { flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--leaf); color: #fff; font-size: .78rem; font-weight: 700; margin-top: 1px; }
.mk-clues li:last-child .clue-n { background: var(--red); }
.mk-clues li.used .clue { opacity: .5; }
.mk-clues li.used .clue span:last-child { text-decoration: line-through; text-decoration-color: var(--red); text-decoration-thickness: 2px; }
.mk-board-head { margin-bottom: 12px; display: grid; gap: 4px; }
.mk-grids { display: flex; flex-wrap: wrap; gap: 18px 22px; }
.mk-grid-wrap { overflow-x: auto; max-width: 100%; }
.mk-grid { border-collapse: separate; border-spacing: 3px; }
.mk-grid caption { text-align: left; font-weight: 650; font-size: .85rem; color: var(--leaf); padding-bottom: 4px; }
.mk-grid th { font-size: .78rem; font-weight: 600; color: var(--ink-2); }
.mk-grid thead th { vertical-align: bottom; height: 118px; padding: 0 0 4px; }
.mk-grid thead th span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; display: inline-block; max-height: 116px; overflow: hidden; text-overflow: ellipsis; }
.mk-grid tbody th { text-align: right; padding-right: 6px; white-space: nowrap; }
.mk-grid td { padding: 0; }
.cell {
  width: 40px; height: 40px; border-radius: 8px; border: 1.5px solid var(--line-2); background: var(--paper);
  display: grid; place-items: center; cursor: pointer; padding: 0; transition: background .2s, border-color .2s;
}
.cell:hover { border-color: var(--leaf-2); }
.cell[data-v="1"] { color: var(--ink-3); background: var(--paper-2); }
.cell[data-v="2"] { color: var(--red); background: var(--red-soft); border-color: var(--rose); }
.cell .ico { width: 20px; height: 20px; }
.cell.pop .ico { animation: pop .35s var(--ease); }
@media (max-width: 520px) { .cell { width: 34px; height: 34px; } .cell .ico { width: 17px; height: 17px; } }
.switch { display: flex; align-items: center; gap: 10px; margin: 16px 0; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--leaf); }
.mk-hints { display: grid; gap: 8px; margin-top: 14px; }
.mk-hint { background: var(--leaf-soft); padding: 10px 14px; border-radius: var(--r-sm); animation: fadeUp .5s var(--ease); }
.notes { display: grid; gap: 6px; margin-top: 16px; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
.notes textarea { width: 100%; resize: vertical; border: 1.5px solid var(--line-2); border-radius: var(--r-sm); background: var(--paper); padding: 10px 12px; font-family: var(--hand); font-size: 1.3rem; line-height: 1.3; color: var(--ink); }
.notes textarea::placeholder { color: var(--ink-3); }
.notes textarea:focus { outline: none; border-color: var(--leaf); }
.mk-accuse { margin-top: 22px; }
.mk-accuse h3 { margin-top: 0; }
.accuse-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.accuse-fields label { display: grid; gap: 4px; font-size: .85rem; font-weight: 650; color: var(--ink-2); }
select {
  min-height: 44px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--paper); padding: 8px 34px 8px 12px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--leaf) 50%), linear-gradient(135deg, var(--leaf) 50%, transparent 50%);
  background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat;
}
select:focus { border-color: var(--leaf); }
.mk-feedback { margin-top: 12px; color: var(--red-deep); font-weight: 600; min-height: 1.5em; }
.mk-result { margin-top: 22px; }
.mk-solution { animation: fadeUp .7s var(--ease); scroll-margin-top: 110px; }
.mk-solution h3 { margin-top: 0; font-size: clamp(1.3rem, 3vw, 1.7rem); }
.mk-solution.won h3 { color: var(--red); }
.mk-win { font-family: var(--hand); font-size: 1.5rem; color: var(--leaf); margin-bottom: 12px; }
.mk-solution h4 { font-size: 1.05rem; margin: 18px 0 8px; }
.mk-steps { display: grid; gap: 8px; padding-left: 1.3em; margin: 0 0 16px; color: var(--ink-2); max-width: 75ch; }
.sol-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.sol-table th, .sol-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.sol-table thead th { font-size: .8rem; color: var(--ink-3); font-weight: 650; }
.sol-table tr.culprit { background: var(--red-soft); }
.tag-red { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: .72rem; font-weight: 700; vertical-align: 1px; }
@media (max-width: 520px) { .sol-table { font-size: .84rem; } .sol-table th, .sol-table td { padding: 6px 5px; } .tag-red { display: block; width: max-content; margin: 2px 0 0; } }

/* ---------- Pasapalabra ---------- */
.pp-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; }
@media (max-width: 820px) { .pp-layout { grid-template-columns: 1fr; } }
.pp-wheel-wrap { display: grid; place-items: center; }
.rosco { --size: min(88vw, 440px); --lsize: calc(var(--size) * .1); position: relative; width: var(--size); height: var(--size); }
.rosco::before { content: ""; position: absolute; inset: calc(var(--lsize) / 2); border-radius: 50%; border: 1.5px dashed var(--line-2); }
.rl {
  position: absolute; left: 50%; top: 50%; width: var(--lsize); height: var(--lsize); border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: calc(var(--lsize) * .44); color: var(--leaf); background: #F8FAF1; border: 2px solid var(--leaf-2);
  transform: translate(-50%, -50%) translate(calc(var(--x) * (var(--size) / 2 - var(--lsize) / 2)), calc(var(--y) * (var(--size) / 2 - var(--lsize) / 2)));
  transition: background .3s, box-shadow .3s, transform .4s var(--ease);
  animation: fadeIn .5s var(--ease) both; animation-delay: var(--d);
  box-shadow: 0 2px 6px -2px rgba(23, 48, 31, .4);
}
.rl.ok, .rl.bad, .rl.current { color: #fff; }
.rl.current { background: var(--ink); border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper), 0 0 0 5.5px var(--red); transform: translate(-50%, -50%) translate(calc(var(--x) * (var(--size) / 2 - var(--lsize) / 2)), calc(var(--y) * (var(--size) / 2 - var(--lsize) / 2))) scale(1.18); z-index: 2; }
.rl.ok { background: #1F7A44; border-color: #1F7A44; }
.rl.ok::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 2px solid #1F7A44; animation: ring .7s var(--ease) forwards; }
.rl.bad { background: var(--red); border-color: var(--red); }
.pp-mini { display: none; margin-left: auto; align-items: center; gap: 4px; font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 700; }
.pp-mini.low { color: var(--red); }
@media (max-width: 820px) {
  .pp-mini { display: inline-flex; }
  .rosco { --size: min(80vw, 340px); }
  .pp-side { scroll-margin-top: 120px; }
  .pp-layout.playing .pp-rules { display: none; }
}
.rl.passed { animation: wiggle .5s var(--ease); }
.rosco-center { position: absolute; inset: 22%; border-radius: 50%; display: grid; place-content: center; gap: 10px; text-align: center; background: #F8FAF1; box-shadow: var(--shadow); }
.pp-clock { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-family: var(--serif); font-size: calc(var(--size) * .1); font-weight: 600; font-variant-numeric: tabular-nums; color: var(--ink); }
.pp-clock .ico { width: .7em; height: .7em; color: var(--leaf); }
.pp-clock.low { color: var(--red); animation: beat 1s ease-in-out infinite; }
.pp-score { display: flex; gap: 16px; justify-content: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.pp-score-item { display: inline-flex; align-items: center; gap: 4px; }
.pp-score-item:first-child { color: #1F7A44; } .pp-score-item:last-child { color: var(--red); }
.pp-side { display: grid; gap: 18px; }
.pp-rules { color: var(--ink-2); font-size: .95rem; }
.pp-prompt { min-height: 150px; background: #F8FAF1; border-radius: var(--r); padding: 18px 20px; box-shadow: var(--shadow); display: grid; align-content: center; gap: 10px; }
.pp-letter { display: flex; align-items: center; gap: 12px; font-weight: 650; color: var(--leaf); }
.pp-big { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; font-family: var(--serif); font-size: 1.4rem; }
.pp-def { font-family: var(--serif); font-size: clamp(1.15rem, 2.5vw, 1.4rem); line-height: 1.3; animation: fadeUp .45s var(--ease); }
.pp-wait { color: var(--ink-2); }
.pp-end { font-family: var(--serif); font-size: 1.5rem; font-weight: 650; color: var(--red); }
.pp-form { display: grid; gap: 10px; }
.pp-input, .field {
  width: 100%; min-height: 50px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: #F8FAF1; padding: 10px 14px; font-size: 1.1rem;
}
.pp-input:focus { outline: none; border-color: var(--leaf); box-shadow: 0 0 0 3px var(--leaf-soft); }
.pp-input::placeholder { color: var(--ink-3); }
.pp-input:disabled { opacity: .55; }
.pp-summary { margin-top: 28px; }
.pp-list { list-style: none; display: grid !important; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 16px !important; }
.pp-list li { padding: 4px 0; }
.pp-list strong { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; background: var(--ink-3); font-size: .8rem; margin-right: 4px; }
.pp-list li.acierto strong { background: #1F7A44; } .pp-list li.fallo strong { background: var(--red); }

/* ---------- Wordle ---------- */
.wd-head, .mm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; }
.wd-stats, .mm-stats, .sp-status { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wd-stats strong, .mm-stats strong, .sp-status strong { color: var(--ink); }
.mm-stats span, .sp-status span { display: inline-flex; align-items: center; gap: 5px; }
.wd-board { display: grid; gap: 6px; justify-content: center; margin: 0 auto; }
.wd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.wd-tile {
  --t: clamp(42px, min(14vw, calc((100svh - 430px) / 6.5)), 60px); width: var(--t); height: var(--t); border-radius: 10px; border: 2px solid var(--line-2); background: #F8FAF1;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: calc(var(--t) * .5); text-transform: uppercase; position: relative;
}
.wd-tile.filled { border-color: var(--ink-3); animation: pop .18s var(--ease); }
.wd-tile.flip { animation: flip .5s var(--ease) both; }
.wd-tile.correct { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.wd-tile.present { background: var(--red-soft); border-color: var(--red); color: var(--red-deep); }
.wd-tile.absent { background: #C9CEC0; border-color: #C9CEC0; color: var(--ink-2); }
.wd-tile .mark { position: absolute; top: 3px; right: 4px; color: var(--red); display: flex; }
.wd-tile .mark .ico { width: 12px; height: 12px; }
.wd-row.shake { animation: shake .4s; }
.wd-row.win .wd-tile { animation: hop .6s var(--ease) both; }
.wd-row.win .wd-tile:nth-child(2) { animation-delay: .08s; } .wd-row.win .wd-tile:nth-child(3) { animation-delay: .16s; }
.wd-row.win .wd-tile:nth-child(4) { animation-delay: .24s; } .wd-row.win .wd-tile:nth-child(5) { animation-delay: .32s; }
.wd-msg { text-align: center; min-height: 1.6em; margin: 14px 0; font-weight: 600; color: var(--ink-2); }
.wd-kb { display: grid; gap: 6px; max-width: 560px; margin: 0 auto; }
.wd-kb-row { display: flex; gap: 5px; justify-content: center; }
.key {
  flex: 1 1 0; min-width: 0; height: 54px; border-radius: 8px; border: 0; background: var(--paper-3); font-weight: 700; font-size: 1rem; cursor: pointer;
  display: grid; place-items: center; transition: background .2s, transform .1s; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.key:active { transform: scale(.94); }
.key:hover { background: var(--leaf-soft); }
.key.wide { flex: 1.6 1 0; font-size: .82rem; }
.key.correct { background: var(--leaf); color: #fff; }
.key.present { background: var(--red-soft); color: var(--red-deep); box-shadow: inset 0 0 0 2px var(--red); }
.key.absent { background: #C9CEC0; color: var(--ink-3); }
@media (max-width: 400px) { .key { height: 48px; font-size: .9rem; } .wd-kb-row { gap: 3px; } }
.wd-legend { list-style: none; padding: 0; margin: 22px auto 0; display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: center; font-size: .88rem; color: var(--ink-2); }
.wd-legend li { display: inline-flex; align-items: center; gap: 6px; }
.wd-legend .t { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; }
.wd-legend .t .ico { width: 10px; height: 10px; color: var(--red); }
.wd-legend .correct { background: var(--leaf); } .wd-legend .present { background: var(--red-soft); box-shadow: inset 0 0 0 1.5px var(--red); } .wd-legend .absent { background: #C9CEC0; }

/* ---------- Sopa ---------- */
.sp-top { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.sp-top .seg { margin-bottom: 0; }
.sp-top-r { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sp-top-r .seg { margin: 0; }
.sp-layout { display: grid; grid-template-columns: minmax(0, 540px) minmax(220px, 1fr); gap: clamp(18px, 4vw, 40px); margin-top: 20px; align-items: start; }
@media (max-width: 820px) { .sp-layout { grid-template-columns: 1fr; } }
.sp-board { position: relative; width: 100%; max-width: 540px; aspect-ratio: 1; touch-action: none; user-select: none; -webkit-user-select: none; background: #F8FAF1; border-radius: var(--r); box-shadow: var(--shadow); padding: 2.5%; }
.sp-board.nope { animation: shake .35s; }
@media (min-width: 821px) { .sp-board { max-width: max(340px, min(540px, calc(100svh - 300px))); } }
.sp-grid, .sp-svg { position: absolute; inset: 2.5%; width: 95%; height: 95%; }
.sp-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); grid-template-rows: repeat(var(--n), 1fr); z-index: 2; }
.sp-cell { display: grid; place-items: center; font-weight: 700; font-size: clamp(.95rem, 3.6vw, 1.35rem); color: var(--ink); cursor: pointer; border-radius: 50%; transition: background .2s; }
.sp-cell.anchor { background: var(--red); color: #fff; }
.sp-svg { z-index: 1; overflow: visible; }
.sp-svg line { stroke-linecap: round; stroke-width: .74; }
.sp-svg .sel { stroke: var(--red); opacity: .32; }
.sp-svg .found { opacity: .38; stroke-dasharray: var(--len) 99; stroke-dashoffset: var(--len); animation: dash .5s var(--ease) forwards; }
.sp-svg .c0 { stroke: var(--leaf-2); } .sp-svg .c1 { stroke: var(--red); } .sp-svg .c2 { stroke: #7FA36B; } .sp-svg .c3 { stroke: var(--rose); }
.sp-side h3 { font-size: 1.15rem; margin: 18px 0 10px; }
.sp-words { list-style: none; padding: 0; margin: 0 0 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 6px 14px; }
.sp-words li { font-weight: 650; letter-spacing: .04em; position: relative; width: max-content; transition: color .3s; }
.sp-words li::after { content: ""; position: absolute; left: -2px; right: -2px; top: 52%; height: 2px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .45s var(--ease); }
.sp-words li.done { color: var(--ink-3); }
.sp-words li.done::after { transform: scaleX(1); }
.sp-msg { font-family: var(--serif); font-size: 1.2rem; color: var(--leaf); min-height: 1.4em; margin-bottom: 8px; }
.sp-msg strong { color: var(--red); }

/* ---------- Memoria ---------- */
.mm-board { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(8px, 2vw, 14px); max-width: 520px; margin: 0 auto; perspective: 900px; }
.mm-card { aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; animation: fadeUp .5s var(--ease) both; animation-delay: calc(var(--i) * 30ms); }
.mm-inner { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .55s var(--ease); }
.mm-card.up .mm-inner { transform: rotateY(180deg); }
.mm-face { position: absolute; inset: 0; border-radius: var(--r); display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; box-shadow: var(--shadow); }
.mm-back { background: var(--leaf); color: rgba(255, 255, 255, .5); background-image: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .14), transparent 55%); }
.mm-back .ico { width: 38%; height: 38%; }
.mm-front { background: #F8FAF1; color: var(--red); transform: rotateY(180deg); border: 2px solid var(--line); }
.mm-front .ico { width: 52%; height: 52%; }
.mm-card.match .mm-front { border-color: var(--leaf-2); background: var(--leaf-soft); color: var(--red-deep); animation: hop .6s var(--ease); }
.mm-card:disabled { cursor: default; }
.mm-msg { text-align: center; margin-top: 20px; color: var(--ink-2); font-weight: 600; max-width: 60ch; margin-inline: auto; }

/* ---------- Quiz ---------- */
.qz-bar { height: 8px; border-radius: 99px; background: var(--paper-3); overflow: hidden; max-width: 720px; margin: 0 auto 22px; }
.qz-bar span { display: block; height: 100%; width: 0; background: var(--red); border-radius: 99px; transition: width .6s var(--ease); }
.qz-card { max-width: 720px; margin: 0 auto; background: #F8FAF1; border-radius: var(--r); padding: clamp(20px, 4vw, 34px); box-shadow: var(--shadow); display: grid; gap: 16px; animation: fadeUp .5s var(--ease); }
.qz-count { font-size: .88rem; color: var(--ink-3); font-weight: 600; }
.qz-q { font-size: clamp(1.35rem, 3.2vw, 1.85rem); }
.qz-opts { display: grid; gap: 10px; }
.qz-opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; min-height: 52px; border-radius: var(--r-sm); border: 1.5px solid var(--line-2); background: var(--paper); cursor: pointer; font-weight: 550; transition: border-color .2s, background .2s, transform .2s var(--ease); }
.qz-opt:hover:not(:disabled) { border-color: var(--leaf-2); transform: translateX(3px); }
.qz-opt:disabled { cursor: default; }
.qz-k { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-3); font-weight: 700; font-size: .85rem; }
.qz-opt.right { border-color: var(--leaf); background: var(--leaf-soft); }
.qz-opt.right .qz-k { background: var(--leaf); color: #fff; }
.qz-opt.wrong { border-color: var(--red); background: var(--red-soft); animation: shake .35s; }
.qz-opt.wrong .qz-k { background: var(--red); color: #fff; }
.qz-note { font-family: var(--hand); font-size: 1.45rem; line-height: 1.25; color: var(--leaf); min-height: 1.2em; }
.qz-card .btn { justify-self: start; }
.qz-end { text-align: center; justify-items: center; }
.qz-end .btn { justify-self: center; }
.qz-score { font-family: var(--serif); font-size: 1.4rem; color: var(--ink-2); }
.qz-score strong { font-size: 4.2rem; color: var(--red); line-height: 1; }

/* ---------- Toast y partículas ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 60; max-width: min(92vw, 460px);
  transform: translate(-50%, 140%); opacity: 0;
  background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: var(--shadow-lg);
  transition: transform .5s var(--ease), opacity .4s var(--ease); pointer-events: none; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.particle { position: absolute; color: var(--red); display: block; will-change: transform, opacity; }
.particle.leaf { color: var(--leaf-2); }
.particle .ico { width: 100%; height: 100%; }
.shake { animation: shake .4s; }

/* ---------- Transición entre vistas ---------- */
::view-transition-old(root) { animation: vtOut .28s var(--ease) both; }
::view-transition-new(root) { animation: vtIn .5s var(--ease) both; }
@keyframes vtOut { to { opacity: 0; filter: blur(4px); transform: translateY(-6px); } }
@keyframes vtIn { from { opacity: 0; filter: blur(6px); transform: translateY(12px); } }

/* ---------- Keyframes ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes dash { to { stroke-dashoffset: 0; } }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.14); } 30% { transform: scale(1); } 45% { transform: scale(1.08); } }
@keyframes bloom { 0% { transform: scale(.3) rotate(-20deg); } 60% { transform: scale(1.4) rotate(6deg); } 100% { transform: scale(1); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-10px); } }
@keyframes flip { 0% { transform: rotateX(90deg); } 100% { transform: rotateX(0); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
@keyframes wiggle { 30% { rotate: -14deg; } 60% { rotate: 10deg; } }
@keyframes ring { from { transform: scale(1); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .hero-art .vine { stroke-dashoffset: 0; }
}

/* Instrument Serif solo tiene un peso: sin negritas sintéticas. */
h1, h2, h3, h4, .brand, .index-name, .pp-clock, .pp-def, .pp-end, .pp-big, .qz-score, .wd-tile, .sp-msg { font-weight: 400; }
.hero-title em, .brand em { font-family: var(--hand); font-style: normal; font-weight: 700; }
.hero-title em { font-size: 1.3em; line-height: .9; letter-spacing: 0; }
.brand em { font-size: 1.3em; line-height: 1; }
