@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,300..700;1,9..144,300..700&family=Inter:wght@300;400;500;700&display=swap');
:root{--sand:#f8f2e7;--paper:#fffaf0;--ink:#2b1a0e;--muted:#6d5945;--teal:#2b1a0e;--teal-soft:#eadfca;--line:#ddd0b6;--gold:#b06a2e;--shadow:0 10px 35px rgba(43,26,14,.10)}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--sand);color:var(--ink);font-family:'Inter',system-ui,sans-serif}
button{font:inherit;color:inherit;-webkit-tap-highlight-color:transparent}
button:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.app{width:min(100%,520px);min-height:100dvh;margin:auto;background:var(--paper);box-shadow:var(--shadow)}
.screen{display:none;min-height:100dvh;padding:calc(22px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom))}.screen.active{display:block}
.hero{text-align:center;padding:2px 8px 7px}.mark{width:52px;height:52px;border-radius:50%;display:grid;place-items:center;margin:0 auto 10px;background:var(--teal);color:white;font-size:40px;line-height:1;transform:rotate(-12deg)}
.eyebrow{margin:0 0 4px;text-transform:uppercase;letter-spacing:.12em;color:var(--teal);font-size:12px;font-weight:700}
h1,h2{font-family:'Fraunces',Georgia,serif}h1{font-size:38px;line-height:1;margin:2px 0 6px}h2{font-size:23px;margin:12px 0 7px}.intro{font-size:17px;line-height:1.45;color:var(--muted);margin:0 auto;max-width:360px}
.how{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line);border-radius:14px;background:#fff;padding:13px 8px;gap:4px}.how>div{display:grid;grid-template-columns:20px 1fr;grid-template-rows:auto auto;column-gap:7px;text-align:left;padding:0 8px}.how>div+div{border-left:1px solid var(--line)}.how .peg{grid-row:1/3;margin-top:4px}.how strong{font-size:14px}.how small{font-size:11px;line-height:1.25;color:var(--muted)}
.peg{display:inline-block;width:14px;height:14px;border-radius:50%;border:2px solid var(--ink);flex:none}.peg.black{background:var(--ink)}.peg.white{background:#fff}
.levels{display:grid;gap:6px}.level{min-height:58px;width:100%;display:grid;grid-template-columns:42px 1fr 20px;align-items:center;gap:11px;text-align:left;border:1px solid var(--line);background:#fff;border-radius:999px;padding:7px 14px;cursor:pointer}.level:active{background:var(--teal-soft);transform:scale(.99)}.level-num{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:var(--teal-soft);color:var(--ink);font-size:18px;font-weight:700}.level strong{display:block;font-size:15px}.level small{display:block;color:var(--muted);font-size:12px;margin-top:2px}.arrow{font-size:28px;color:var(--teal)}
.game-header{display:grid;grid-template-columns:44px 1fr 44px;align-items:center;text-align:center;margin-bottom:8px}.game-header h1{font-size:27px;margin:0}.icon-btn{width:44px;height:44px;border:1px solid var(--line);border-radius:50%;background:#fff;font-size:32px;line-height:1}.help-btn{font-size:20px;font-weight:700}.secret{display:flex;justify-content:center;gap:9px;margin:8px 0}.secret span,.answer span{width:43px;height:43px;border-radius:9px;display:grid;place-items:center;background:var(--ink);color:white;font-size:25px;font-weight:700}.status{text-align:center;margin:5px 0 8px;color:var(--muted);font-size:13px;font-weight:600}
.board-legend{display:flex;justify-content:center;gap:14px;margin:0 0 5px;color:var(--muted);font-size:10px;white-space:nowrap}.board-legend span{display:flex;align-items:center;gap:3px}.board-legend b{color:var(--ink)}.board-legend .peg{width:10px;height:10px;border-width:1.5px}.board{height:205px;display:flex;flex-direction:column-reverse;justify-content:flex-start;gap:5px;overflow:hidden;padding:5px 8px;background:#f1e9d8;border-radius:12px}.attempt{min-height:38px;display:grid;grid-template-columns:1fr 84px;align-items:center;gap:8px;background:white;border-radius:8px;padding:4px 8px;border:1px solid #ece6df}.digits{display:flex;gap:6px}.digits span{width:31px;height:29px;border-radius:6px;display:grid;place-items:center;background:#efe8df;font-size:19px;font-weight:700}.feedback{display:flex;align-items:center;justify-content:flex-end;gap:5px}.feedback .peg{width:13px;height:13px}.none{color:#aaa;font-size:12px}
.composer{display:grid;grid-template-columns:1fr 48px;gap:8px;margin:10px 0 8px}.current{display:flex;justify-content:center;gap:8px}.current span{width:47px;height:47px;border:2px solid var(--line);border-radius:9px;display:grid;place-items:center;font-size:26px;font-weight:700;background:#fff}.current span.filled{border-color:var(--teal);background:var(--teal-soft)}.erase{border:1px solid var(--line);border-radius:9px;background:#fff;font-size:24px}
.keypad{display:flex;justify-content:center;gap:6px;margin-bottom:9px}.key{width:calc((100% - 42px)/8);max-width:49px;min-width:38px;height:45px;border:1px solid var(--line);background:#fff;border-radius:8px;font-size:21px;font-weight:700}.key:active{background:var(--teal-soft)}.key.used{opacity:.28}.primary,.secondary{width:100%;min-height:50px;border-radius:999px;font-weight:700;font-size:17px;cursor:pointer}.primary{border:0;background:var(--teal);color:white}.primary:disabled{background:#bbb;cursor:not-allowed}.secondary{border:1px solid var(--line);background:#fff;margin-top:9px}
dialog{border:0;padding:0;background:transparent;width:min(calc(100% - 32px),420px)}dialog::backdrop{background:rgba(37,32,33,.55);backdrop-filter:blur(2px)}.dialog-card{position:relative;background:var(--paper);border-radius:18px;padding:25px;box-shadow:var(--shadow)}.dialog-card h2{font-size:29px;margin:5px 0 12px}.dialog-card>p{line-height:1.45;color:var(--muted)}.dialog-close{position:absolute;right:14px;top:12px;width:40px;height:40px;border:0;background:transparent;font-size:30px}.rule-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-top:1px solid var(--line)}.rule-row p{margin:0;line-height:1.35}.note{font-size:13px}.dialog-ok{margin-top:10px}.result-card{text-align:center}.result-icon{width:64px;height:64px;margin:0 auto 14px;border-radius:50%;display:grid;place-items:center;background:var(--teal-soft);color:var(--teal);font-size:36px;font-weight:700}.result-card h2{font-size:34px}.answer{display:flex;justify-content:center;gap:8px;margin:18px 0 22px}
@media(max-height:700px){.screen{padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:calc(8px + env(safe-area-inset-bottom))}.hero{padding:0 6px 4px}.hero .mark{width:34px;height:34px;font-size:26px;margin-bottom:3px}.hero h1{font-size:31px;margin-bottom:4px}.hero .eyebrow{font-size:10px}.hero .intro{font-size:13px;line-height:1.3;max-width:330px}#menu h2{font-size:20px;margin:7px 0 5px}.levels{gap:5px}.level{min-height:51px;padding:5px 10px}.level-num{width:33px;height:33px}.level strong{font-size:14px}.level small{font-size:11px}.game-header{margin-bottom:2px}.game-header h1{font-size:24px}.secret{margin:3px 0}.secret span{width:36px;height:36px}.status{margin:3px 0 4px}.board{height:185px}.attempt{min-height:31px}.digits span{height:24px}.composer{margin:6px 0}.current span{width:41px;height:41px}.key{height:39px}.primary{min-height:43px}}
@media(max-width:350px){.screen{padding-left:13px;padding-right:13px}.keypad{gap:4px}.key{min-width:34px}.current span{width:42px}.board{padding-left:5px;padding-right:5px}}

@media(max-height:500px){#menu.screen{padding:4px 14px}.hero{display:grid;grid-template-columns:38px 1fr;grid-template-rows:auto auto auto;text-align:left;column-gap:8px;align-items:center}.hero .mark{grid-row:1/4;margin:0}.hero .eyebrow{grid-column:2;margin:0}.hero h1{grid-column:2;font-size:27px;margin:0}.hero .intro{grid-column:2;font-size:11px;margin:0;max-width:none}.levels{grid-template-columns:1fr 1fr;gap:5px}.level{min-height:58px}.level small{white-space:nowrap}.screen{min-height:100dvh}#game.screen{overflow-y:auto}.board{height:115px}.board-legend{font-size:9px}.secret span{width:30px;height:30px;font-size:20px}.current span{width:36px;height:36px}.key{height:34px}.primary{min-height:38px}}



/* Prueba visual de la suite Gimnasia Mental: cambia solo el envoltorio. */
.app{background:var(--sand);box-shadow:none}
.hero::before{content:'NACHO RUIZ · TÉCNICAS VÉDICAS';display:block;margin:2px 0 15px;color:var(--gold);font-size:10px;font-weight:700;letter-spacing:2px}
.mark{background:transparent;color:var(--gold);width:42px;height:34px;margin-bottom:5px;font-size:31px}
.eyebrow{color:var(--gold)}
h1,h2{font-weight:500}
.level{background:var(--paper);border-color:var(--line)}
.level-num{background:var(--teal-soft);color:var(--ink)}
.arrow{color:var(--gold)}
.icon-btn{background:var(--paper);border-color:var(--line);color:var(--ink)}
.secret span,.answer span{border-radius:999px}
.board{border:1px solid var(--line)}
.current span,.erase,.key{background:var(--paper);border-color:var(--line)}
.current span.filled{border-color:var(--gold);background:var(--teal-soft)}
.primary{background:var(--ink);color:var(--sand)}
.secondary{background:var(--paper);border-color:var(--line)}
.dialog-card{border:1px solid var(--line);border-radius:12px}
.game-header::after{content:'NACHO RUIZ · TÉCNICAS VÉDICAS';position:absolute;left:50%;top:calc(5px + env(safe-area-inset-top));transform:translateX(-50%);width:max-content;color:var(--gold);font-size:8px;font-weight:700;letter-spacing:1.4px}
.game-header{position:relative;padding-top:13px}
@media(max-height:700px){.hero::before{margin-bottom:5px;font-size:8px}.game-header::after{top:calc(1px + env(safe-area-inset-top))}.game-header{padding-top:9px}}

/* ===== Paleta de marca: Burdeos y oro (día) + Negro y oro (noche) ===== */
:root{--sand:#fcf6f1;--paper:#fffdfb;--ink:#2a1320;--muted:#6b5560;--teal:#8c1c40;--teal-soft:#f4e6e2;--line:#e8d6d3;--gold:#8c1c40;--gold-fill:#f2b233;--fill:#8c1c40;--onFill:#fff8f2;--card:#fffdfb;--well:#f7ebe7;--chip:#f4e6e2;--pegDark:#2a1320;--pegLight:#fff;--shadow:0 10px 35px rgba(42,19,32,.10);color-scheme:light}
:root[data-theme="night"]{--sand:#26221d;--paper:#322d27;--ink:#f3ede2;--muted:#c9bfaf;--teal:#d9ae4a;--teal-soft:#403a31;--line:#4d463c;--gold:#d9ae4a;--gold-fill:#d9ae4a;--fill:#d9ae4a;--onFill:#26221d;--card:#322d27;--well:#2a2621;--chip:#3e3830;--pegDark:#050505;--pegLight:#f3ede2;--shadow:0 10px 35px rgba(0,0,0,.4);color-scheme:dark}
.how,.level,.icon-btn,.current span,.erase,.key,.secondary,.attempt{background:var(--card);color:var(--ink)}
.attempt{border-color:var(--line)}
.board{background:var(--well)}
.digits span{background:var(--chip);color:var(--ink)}
.peg{border-color:var(--ink)}.peg.black{background:var(--pegDark)}.peg.white{background:var(--pegLight)}
:root[data-theme="night"] .peg.black{border-color:#c9bfaf}
.secret span,.answer span{background:var(--fill);color:var(--onFill)}
.primary{background:var(--fill);color:var(--onFill)}
:root:not([data-theme="night"]) .primary:not(:disabled){box-shadow:inset 0 0 0 2px var(--gold-fill)}
.primary:disabled{background:var(--line);color:var(--muted);box-shadow:none}
.none{color:var(--muted)}
.mark{color:var(--gold)}
.dialog-close{color:var(--ink)}
.result-icon{background:var(--teal-soft);color:var(--teal)}
dialog::backdrop{background:rgba(20,10,16,.6)}
.theme-btn{position:absolute;top:calc(10px + env(safe-area-inset-top));right:14px;width:40px;height:40px;border-radius:50%;border:1px solid var(--line);background:var(--card);color:var(--ink);font-size:17px;line-height:1;display:grid;place-items:center;cursor:pointer;z-index:5}
#menu{position:relative}
@media(max-height:700px){.theme-btn{top:calc(4px + env(safe-area-inset-top));width:36px;height:36px;font-size:15px}}


/* Gimnasia Mental v2: a wider but restrained desktop canvas. Mobile remains unchanged. */
@media (min-width: 760px) {
  .app { width: min(100%, 760px); }
  #menu.screen { max-width: 700px; margin-inline: auto; padding-top: 42px; }
  #menu .hero { margin-bottom: 22px; }
  #menu .hero .intro { max-width: 540px; }
  #menu .levels { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  #game.screen { max-width: 600px; margin-inline: auto; padding-top: 30px; }
  .board { height: 250px; }
}

/* Memento / Las figuras crecen: typography and quiet navigation, not cards. */
#menu.screen{width:min(100%,620px);min-height:100dvh;margin-inline:auto;padding:34px 20px 32px}
#menu .hero{text-align:left;padding:0;margin:0 0 24px}
#menu .hero::before{margin:0 0 35px;font-size:9px;letter-spacing:2px}
#menu .mark{display:none}
#menu .eyebrow{font-size:10px;letter-spacing:2px;color:var(--muted);margin:0 0 14px}
#menu h1{font-size:clamp(42px,7vw,50px);line-height:1.09;margin:0 0 14px;font-weight:500;color:var(--ink)}
#menu h1 em{color:var(--gold);font-style:italic}
#menu .intro{margin:0;max-width:470px;font-size:14px;line-height:1.6;color:var(--ink)}
#menu h2{display:none}
#menu .levels{display:block;border-top:1px solid var(--line)}
#menu .level{display:grid;grid-template-columns:1fr 24px;gap:8px;width:100%;min-height:75px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;padding:12px 2px;box-shadow:none}
#menu .level-num{display:none}
#menu .level strong{font-family:'Fraunces',Georgia,serif;font-size:21px;font-weight:500;line-height:1.16}
#menu .level small{font-size:12px;line-height:1.35;margin-top:4px}
#menu .arrow{font-size:24px;font-weight:400;justify-self:end}
#menu .level:hover{background:var(--teal-soft)}
@media (min-width:760px){#menu.screen{max-width:620px;padding-top:36px}#menu .hero{margin-bottom:30px}#menu .levels{display:block}}
@media (max-height:700px){#menu.screen{padding-top:20px}#menu .hero::before{margin-bottom:24px}#menu .hero{margin-bottom:18px}#menu .level{min-height:65px;padding-block:9px}#menu h1{font-size:42px}}


/* Internal headings follow the suite Fraunces treatment. */
.game-header h1{font-family:"Fraunces",Georgia,serif;font-weight:500}
.game-header h1 em{font-style:italic;color:var(--gold)}
.dialog-card h2{font-family:"Fraunces",Georgia,serif;font-weight:500}
