/* v9: calmer controls, readable clues and an optional paper theme. */
body{margin:0;background:var(--ink)}
:root{--smoke:#b8b1a5;--faint:#aaa293;--panel2:#25231e}
.topnav{border-top:3px solid var(--amber)}
.topnav .page{gap:8px 16px;padding-block:15px}
.topnav .vtab{border-radius:8px;letter-spacing:.04em}
.topnav .vtab[aria-current=true]{background:var(--amber-soft);color:var(--amber)}
.v9-tools{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding:12px 20px;max-width:1080px;margin:auto;border-bottom:1px solid var(--rule);font:13px/1.5 var(--disp);color:var(--smoke)}
.v9-tools button,.v9-tools a{font:inherit}
.v9-tools .v9-options{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.v9-save{display:flex;align-items:center;gap:8px;max-width:60ch}
.v9-save::before{content:'';width:7px;height:7px;border-radius:50%;background:var(--ok);flex-shrink:0}
.v9-save.error{color:var(--err)}
.v9-save.error::before{background:var(--err)}
.btn{border-radius:8px;min-height:44px;line-height:1.3;padding:11px 16px;letter-spacing:.02em}
.btn:hover{filter:brightness(1.12)}
.btn.cta-compartir{box-shadow:0 3px 12px #0002}
.bandeja{gap:8px}
.bandeja button{border-radius:10px;min-height:56px}
.zona-pistas{padding:22px;background:var(--panel);border:1px solid var(--rule);border-radius:14px}
.zona-pistas h2{font-size:1.3rem;letter-spacing:-.02em}
.frases{margin:4px 0;padding:0;list-style:none}
.frases li{border-radius:8px;padding-block:12px;line-height:1.6}
.frases li.usada{opacity:1;color:var(--smoke)}
.frases li:hover:not(.usada),.frases li:focus-visible{color:var(--chalk);background:var(--panel2)}
.frases li:focus-visible{outline:2px solid var(--amber);outline-offset:3px}
/* Pelusa has its own calm colours, independent of the interface accent. */
html[data-theme] .cc.gato,html[data-theme] .cc.gato:hover{background:#f6e9c9;box-shadow:inset 0 0 0 2px #80917b}
html[data-theme] .cc.gato .fig{fill:#35443b}
html[data-theme] .cc.gato em{color:#283a30}
html[data-theme] .leyenda .caja.esgato{background:#f6e9c9;color:#35443b}
html:is([data-theme=mono],[data-theme=night]) #cat-casa .cc.gato,html:is([data-theme=mono],[data-theme=night]) #cat-casa .cc.gato:hover{background:#e6e6e6;box-shadow:inset 0 0 0 2px #555}
html:is([data-theme=mono],[data-theme=night]) .cc.gato .fig{fill:#222}
html:is([data-theme=mono],[data-theme=night]) .cc.gato em{color:#222}
html[data-theme] .avatar.ganado,html[data-theme] .trofeo.ganado{background:var(--panel2);border-color:var(--edge)}
html[data-theme] .avatar.ganado .caja{background:#f8f5ee}
html[data-theme] .avatar.avatar-cat .caja{background:#f6e9c9!important;border-color:#80917b;color:#35443b;box-shadow:none}
html[data-theme] .avatar.avatar-cat .caja .fig{fill:#35443b}
html[data-theme] .avatar.avatar-cat .caja svg{width:80%;height:80%}
.pista-viva{border-radius:10px;padding:13px 15px;background:var(--panel)}
.pista-viva p{line-height:1.5}
.marco{border-radius:8px;overflow:hidden;box-shadow:0 8px 28px #0003}
.fecha{letter-spacing:.06em;font-size:.86rem}
.dias .dia{border-radius:8px}
.primera-vez{padding:14px 18px;background:var(--amber-soft);border-left:3px solid var(--amber);border-radius:0 10px 10px 0;line-height:1.6}
.zona-acts .acts{gap:8px}
#cat-limpiar,#cat-imprimir{background:transparent;color:var(--smoke)}
.book{border-radius:14px;overflow:hidden}
.codigo{border-radius:14px}
#pg-codigo{overflow-wrap:anywhere;word-break:break-all;display:block;max-height:100px;overflow:auto;font-size:.75rem;line-height:1.5;flex:1;min-width:0}
.v9-backup{margin-top:22px;padding:22px;border:1px solid var(--edge);border-radius:14px;background:var(--panel)}
.v9-backup h3{font-size:1.2rem;margin-bottom:12px}
.v9-backup p{color:var(--smoke);margin-bottom:16px;max-width:65ch}
.v9-backup .actions{display:flex;flex-wrap:wrap;gap:10px}
.v9-backup label{cursor:pointer;display:inline-flex;align-items:center}
.v9-backup input{position:absolute;width:1px;height:1px;opacity:0}
.v9-backup label:focus-within{outline:2px solid var(--amber);outline-offset:3px}
.v9-zoom{margin:0 0 12px}
.v9-sample{display:inline-block;margin:8px 0 14px;font-family:var(--disp);font-size:.9rem}
.v9-dialog{background:var(--panel);color:var(--chalk);border:1px solid var(--edge);border-radius:18px;padding:28px;max-width:min(92vw,520px);box-shadow:0 20px 80px #0006}
.v9-dialog::backdrop{background:#0009}
.v9-dialog h2{font-size:1.7rem;margin:12px 0 18px}
.v9-dialog p{line-height:1.7;margin-bottom:20px}
.v9-dialog .actions{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap}
html[data-font=large]{font-size:19px}
html[data-theme=paper]{color-scheme:light dark;--ink:#faf7f0;--panel:#fffdf8;--panel2:#efe9dd;--rule:#d9d1c2;--edge:#b9ae99;--grid:#8d816d;--mueble:#918473;--chalk:#25241e;--smoke:#625c51;--faint:#6b6357;--amber:#925007;--ember:#aa6e21;--amber-soft:#ad6a1110;--ok:#317343;--err:#b12e2e}
html[data-theme=paper] #hoy,html[data-theme=paper] #v-hoy{background:var(--ink)}
html[data-theme=paper] .topnav,html[data-theme=paper] footer,html[data-theme=paper] .vista{background:var(--ink)}
html[data-theme=paper] .side,html[data-theme=paper] .rulecard{background:var(--panel);color:var(--chalk)}
html[data-theme=paper] .btn{color:var(--chalk);background:var(--panel2);border-color:var(--edge)}
html[data-theme=paper] .btn.cta-compartir{background:#925007;color:#fff}
html[data-theme=paper] .topnav .vtab[aria-current=true]{color:var(--amber);background:var(--amber-soft)}
html[data-theme=paper] .cell,html[data-theme=paper] .key{color:var(--amber);background:var(--panel)}
html[data-theme=paper] .cell.fixed{color:var(--chalk)}
body.v9-focused .topnav,body.v9-focused .v9-tools,body.v9-focused footer{display:none}
body.v9-focused .vista>.page{max-width:1200px}
body.v9-focused #v-hoy .zona-tablero,body.v9-focused #v-hoy .tablero{max-width:620px;width:100%}
body.v9-focused #v-hoy .hoy-wrap{grid-template-columns:minmax(0,620px) minmax(260px,1fr)}
body.v9-focused .play.v9-expanded{grid-template-columns:minmax(0,720px) minmax(220px,1fr)}
body.v9-focused .play.v9-expanded .board{width:100%;max-width:720px}
@media(max-width:860px){
  .v9-tools{padding:10px 16px;gap:8px}
  .v9-tools .v9-save{font-size:12px}
  .v9-tools .btn{padding:8px 10px;min-height:38px}
  .page{padding-inline:16px}
  .zona-pistas{padding:16px}
  .hoy-wrap{row-gap:16px}
  body.v9-focused #v-hoy .hoy-wrap,body.v9-focused .play.v9-expanded{grid-template-columns:minmax(0,1fr)}
  body.v9-focused .play.v9-expanded .board{min-width:0}
  .v9-zoom{position:sticky;top:8px;z-index:10;background:var(--panel);box-shadow:0 2px 12px #0002}
}
@media print{.v9-tools,.v9-zoom,.v9-backup,.v9-sample,.v9-dialog{display:none!important}}

/* Colour choices retain their selection throughout the site. */
.v10-theme{display:inline-flex;align-items:center;gap:8px;font:13px var(--disp);color:var(--smoke)}
.v10-theme select{font:inherit;color:var(--chalk);background:var(--panel2);border:1px solid var(--edge);border-radius:8px;min-height:44px;padding:9px 30px 9px 12px;max-width:100%;cursor:pointer;color-scheme:inherit}
.v9-options button[aria-pressed=true]{border-color:var(--amber);box-shadow:inset 0 -2px 0 var(--amber)}
html[data-theme=mono]{color-scheme:light dark;--ink:#fff;--panel:#f7f7f7;--panel2:#ededed;--rule:#d4d4d4;--edge:#777;--grid:#777;--mueble:#888;--chalk:#111;--smoke:#444;--faint:#555;--amber:#111;--ember:#444;--amber-soft:#0000000b;--ok:#333;--err:#a51d1d}
html[data-theme=night]{color-scheme:dark;--ink:#101010;--panel:#191919;--panel2:#242424;--rule:#3d3d3d;--edge:#777;--grid:#888;--mueble:#888;--chalk:#fff;--smoke:#ccc;--faint:#bbb;--amber:#fff;--ember:#aaa;--amber-soft:#ffffff10;--ok:#ddd;--err:#ff9696}
html:is([data-theme=mono],[data-theme=night],[data-theme=paper]) :is(.vista,.topnav,footer,#hoy){background:var(--ink)}
html:is([data-theme=mono],[data-theme=night]) :is(.side,.rulecard,.book,.codigo){background:var(--panel);color:var(--chalk)}
html:is([data-theme=mono],[data-theme=night]) .btn{color:var(--chalk);background:var(--panel2);border-color:var(--edge)}
html:is([data-theme=mono],[data-theme=night]) .btn.cta-compartir{color:var(--ink);background:var(--amber)}
html:is([data-theme=mono],[data-theme=night]) .topnav .vtab[aria-current=true]{color:var(--chalk);background:var(--amber-soft)}
html:is([data-theme=mono],[data-theme=night]) :is(.hoy-wrap,.tablero,.play){--papel:#fff;--papel2:#efefef;--margen:#eee;--luz:#ddd;--solido:#888;--tinta:#111;--lapiz:#555;--raya:#bbb}
html:is([data-theme=mono],[data-theme=night]) .cc .fig{fill:var(--tinta)}
html:is([data-theme=mono],[data-theme=night]) .cc.lapiz .fig{fill:none}
html:is([data-theme=mono],[data-theme=night]) .cc.gato{background:#bbb}
html:is([data-theme=mono],[data-theme=night]) .cc.visto:hover{background:#ccc}
html:is([data-theme=mono],[data-theme=night]) .pers[aria-pressed=true]{background:var(--amber);color:var(--ink)}
html:is([data-theme=mono],[data-theme=night]) .pers[aria-pressed=true] .nom{color:var(--ink)}
html:is([data-theme=mono],[data-theme=night]) :is(.cell.sel,.cell.peer){background:#ddd}
html:is([data-theme=mono],[data-theme=night]) .key{background:var(--panel2);color:var(--chalk)}
html:is([data-theme=mono],[data-theme=night]) .cell{color:#111}
html:is([data-theme=mono],[data-theme=night]) .cc .caja{background:#eee}
html:is([data-theme=mono],[data-theme=night]) .redes{background:var(--panel);border-color:var(--edge)}
.v10-placement{margin-top:12px;display:flex;align-items:center;gap:14px;font:12px/1.5 var(--disp);color:var(--smoke)}
.v10-track{height:4px;flex:1;min-width:35px;background:var(--rule);border-radius:10px;overflow:hidden}
.v10-track>span{height:100%;display:block;background:var(--amber);border-radius:10px;transition:width .25s ease}
.marco{position:relative}
.v10-celebration{position:absolute;inset:0;pointer-events:none;z-index:5;display:block!important;overflow:hidden}
.v10-celebration i{position:absolute;top:50%;left:50%;width:7px;height:11px;background:var(--amber);border:1px solid var(--ink);border-radius:2px;animation:v10-burst 1.2s ease-out both}
.v10-celebration i:nth-child(even){background:var(--chalk);width:6px;height:6px;border-radius:50%}
@keyframes v10-burst{0%{opacity:0;transform:translate(0,0) scale(.2)}15%{opacity:1}100%{opacity:0;transform:translate(var(--x),var(--y)) rotate(var(--r)) scale(.8)}}
@media(prefers-reduced-motion:no-preference){
 html:not([data-motion=off]) :is(body,.topnav,.vista,.zona-pistas,.pista-viva,.btn){transition:background-color .2s ease,color .2s ease,border-color .2s ease}
 html:not([data-motion=off]) .bandeja .pers{transition:transform .18s ease,background-color .18s ease}
 html:not([data-motion=off]) .bandeja .pers[aria-pressed=true]{transform:translateY(-3px)}
}
html[data-motion=off] *,html[data-motion=off] *::before,html[data-motion=off] *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(max-width:500px){.v10-theme{width:100%;justify-content:space-between}.v10-theme select{flex:1;min-width:0}.v9-tools .v9-options{width:100%}.v10-placement{font-size:11px}}
@media print{
 *,*::before,*::after{animation:none!important;transition:none!important}
 html[data-theme]{--ink:#fff!important;--panel:#fff!important;--panel2:#fff!important;--chalk:#000!important;--smoke:#333!important;--faint:#555!important;--rule:#bbb!important;--edge:#999!important;--amber:#000!important;--ember:#999!important;color-scheme:light}
 body,.vista,.zona-pistas{background:#fff!important;color:#000!important;box-shadow:none!important}
 .v10-placement,.v10-celebration{display:none!important}
}

/* A persistent inset outline distinguishes the active cell from its peers,
   even after focus moves to the keypad. Do not replace cage/grid shadows. */
@media screen {
html {--cell-active:#f2d18c;--cell-peer:#eee9df;--cell-ring:#704000}
html:is([data-theme=mono],[data-theme=night]) {--cell-active:#c4c4c4;--cell-peer:#ededed;--cell-ring:#111}
html[data-theme] .cell.peer {background:var(--cell-peer)}
html[data-theme] :is(.cell.sel,.kc.sel) {background:var(--cell-active);outline:3px solid var(--cell-ring);outline-offset:-3px}
html[data-theme] :is(.cell.sel:not(.fixed),.kc.sel) {color:#633b00}
html:is([data-theme=mono],[data-theme=night]) :is(.cell.sel,.kc.sel) {color:#111}
html[data-theme] :is(.cell.dup,.cell.wrong,.kc.dup,.kc.wrong) {color:#a02020}
html[data-theme] :is(.cell,.kc,.ncell):focus-visible {outline:3px solid var(--cell-ring);outline-offset:-3px}
html[data-theme] .ncell[data-s="1"]:focus-visible {outline-color:#fff}
}
