/* =====================================================================================================
   The house look (2026-11, docs/research/2026-11-11-identidad-visual.md; sketches on the Design canvas).
   Loaded by every game page after its base styles (shared/base.css, or críptico's own styles.css, which
   maps --accent/--accent-2 to its --def/--ind). Uses the house tokens: --bg --ink --muted --line --well
   --accent --accent-2 --ok --serif --sans --mono, and .link and .stats from the base styles.
   ===================================================================================================== */
:root{
  --paper:#F4F2EC;                                  /* the clipping and the inputs: a shade lighter than the page */
  --band:#1B1915; --band-ink:#CFCAC0; --band-brand:#ECEAE4; --band-mark:#8FB0E6;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){ --paper:#23221E; --band:#0D0C0A; --band-ink:#9B968C; --band-brand:#ECE9E1; --band-mark:#8FB0E6; }
}
:root[data-theme="dark"]{ --paper:#23221E; --band:#0D0C0A; --band-ink:#9B968C; --band-brand:#ECE9E1; --band-mark:#8FB0E6; }

/* game pages: the game area stays hidden until app.js has drawn it (solved: the clipping), so a reload
   never flashes the board and its buttons. An inline script in <head> sets html.booting and clears it
   after 3 s anyway; app.js clears it with ready() from core.js once the page is drawn. */
html.booting main{visibility:hidden;}

.label{font-size:10.5px; letter-spacing:.16em; text-transform:uppercase; color:var(--muted); font-weight:600;}

/* ---------- the topbar: a black band across the top, the house on the left, the day and the number of
   today's puzzle on the right, on every page of the game (topbarToday in core.js off the play page) ----------
   Fixed markup with one hole (.topbar-text) so a page written by the Worker (/dia/) can fill it too:
   <div class="topbar"><div class="topbar-in"><a class="topbar-home" ...>puzzles<span class="mark">.ar</span></a>
   <span class="topbar-text"><span class="long">…</span><span class="short">…</span></span></div></div> */
body:has(> .topbar){display:flex; flex-direction:column; min-height:100%; height:auto;}
body:has(> .topbar) > .page{min-height:0; flex:1 0 auto; width:100%; padding-inline:20px; padding-block:14px 18px; gap:18px;}
body:has(> .topbar) .main{gap:18px;}
.topbar{background:var(--band); color:var(--band-ink); border-bottom:1px solid var(--line);}
.topbar-in{
  max-width:620px; margin:0 auto; padding:7px 20px; min-height:36px;
  display:flex; justify-content:space-between; align-items:center; gap:10px;
  font-size:10.5px; letter-spacing:.12em; text-transform:uppercase;
}
.topbar-home{display:block; font-family:var(--serif); font-weight:600; font-size:18px; line-height:1; letter-spacing:-.02em; text-transform:none; color:var(--band-brand); text-decoration:none;}
/* Centre what is seen, not the boxes: «puzzles» is lowercase and sat lower than the capitals of the date.
   Both are trimmed to cap height and baseline, then centred (Matías, 25/11). */
.topbar-home,.topbar-text{text-box:trim-both cap alphabetic;}
@supports not (text-box:trim-both cap alphabetic){ .topbar-home{transform:translateY(-.1em);} }
.topbar-home .mark{font-family:var(--mono); font-weight:600; font-size:.52em; letter-spacing:0; color:var(--band-mark); margin-left:.12em;}
.topbar-home:hover{color:var(--band-mark);}
.topbar-home:focus-visible{outline:2px solid var(--band-mark); outline-offset:3px; border-radius:2px;}
.topbar-text{text-align:right;}
.topbar-text .long{display:none;}
@media (min-width:900px){
  .topbar-in{max-width:980px; padding:8px 0; font-size:11.5px;}
  .topbar-home{font-size:21px;}
  .topbar-text .long{display:inline;} .topbar-text .short{display:none;}
}
@media (min-width:900px) and (max-width:1020px){ .topbar-in{padding-inline:20px;} }

/* ---------- the gamename: the game's name, with its gesture, over a thin rule ----------
   It is the h1 only on the play page; elsewhere it is a link and the page title is the h1. */
.gamename{
  display:block; margin:0; padding-bottom:10px; border-bottom:1px solid var(--ink);
  font-family:var(--serif); font-weight:600; font-size:34px; letter-spacing:-.015em; line-height:1;
  color:var(--ink); text-decoration:none; white-space:nowrap;
}
a.gamename:hover{color:var(--ink);}
a.gamename:focus-visible{outline:2px solid var(--accent); outline-offset:3px;}
.page-head{margin:4px 0 0; font-family:var(--serif); font-weight:600; font-size:26px; letter-spacing:-.01em; line-height:1.15;}

/* ---------- buttons: ink, square-ish ---------- */
.btn{
  flex:none; display:inline-flex; align-items:center; justify-content:center;
  height:48px; padding:0 22px; border-radius:8px; border:1px solid var(--ink); cursor:pointer;
  background:var(--ink); color:var(--bg); font-family:var(--sans); font-size:15px; font-weight:500; text-decoration:none;
}
.btn:hover:not(:disabled){background:color-mix(in srgb, var(--ink) 86%, var(--bg));}
.btn:active:not(:disabled){transform:translateY(1px);}
.btn:disabled{opacity:.5; cursor:default;}
.btn:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
.btn.quiet{background:none; color:var(--ink);}
.btn.quiet:hover:not(:disabled){background:var(--well);}
.clip-actions{display:flex; flex-wrap:wrap; align-items:center; gap:10px 16px;}
.clip-actions .link{font-size:14px;}

/* ---------- the clipping (el recorte): the result card, the same in every game ---------- */
.clip{display:flex; flex-direction:column; gap:14px; border:1.5px dashed var(--ink); border-radius:4px; padding:14px 16px 16px; background:var(--paper);}
.clip-head{display:flex; justify-content:space-between; align-items:baseline; gap:10px; border-bottom:1px solid var(--ink); padding-bottom:6px; font-size:10.5px; letter-spacing:.12em; text-transform:uppercase;}
.clip-head :first-child{font-weight:600;}
.clip-head :last-child{color:var(--muted); text-align:right;}
.clip-top{display:flex; align-items:flex-start; justify-content:space-between; gap:14px;}
.clip-top > :first-child{flex:1; min-width:0; display:flex; flex-direction:column; gap:2px;}
.clip-title{margin:0; font-family:var(--serif); font-weight:600; font-size:24px; line-height:1.15;}
.clip-sub{margin:0; font-size:14px;}
.clip .stats{margin-top:0;}
/* the words of the day, two by two between thin rules */
.clip-words{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); border-top:1px solid var(--line);}
.clip-words > li{display:flex; flex-direction:column; min-width:0; padding:8px 8px 8px 0; border-bottom:1px solid var(--line); font-family:var(--serif); font-weight:600; font-size:16.5px; overflow-wrap:anywhere;}
.clip-words > li:nth-child(odd){border-right:1px solid var(--line);}
.clip-words > li:nth-child(even){padding:8px 0 8px 12px;}
.clip-words > li:last-child:nth-child(odd){border-right:0;}

/* the stamp: printed once, when the game is solved (.now animates it; reduced motion skips that) */
.stamp{flex:none; margin:4px 2px 0 0; transform:rotate(-7deg); border:2px solid var(--accent); border-radius:5px; padding:2px; color:var(--accent); opacity:.85;}
.stamp > span{border:1px solid var(--accent); border-radius:3px; padding:3px 9px 2px; display:flex; flex-direction:column; align-items:center; line-height:1.15; font-family:var(--mono); white-space:nowrap;}
.stamp b{font-weight:600; font-size:14px; letter-spacing:.14em;}
.stamp small{font-weight:500; font-size:9px; letter-spacing:.1em; text-transform:uppercase;}
.stamp.now{animation:stamp .42s cubic-bezier(.2,.9,.3,1.3) both;}
@keyframes stamp{from{opacity:0; transform:rotate(-16deg) scale(1.6);} to{opacity:.85; transform:rotate(-7deg) scale(1);}}
@media (prefers-reduced-motion:reduce){ .stamp.now{animation:none;} }

/* the time it took: a row between two ink rules (renderTime in core.js writes the number) */
.clip-time{display:flex; align-items:baseline; justify-content:space-between; gap:12px; border-block:1px solid var(--ink); padding:6px 0 4px;}
.clip-time-n{font-family:var(--mono); font-weight:600; font-size:32px; line-height:1.1; letter-spacing:-.02em; font-variant-numeric:tabular-nums;}
.clip-time-n .unit{font-family:var(--sans); font-weight:500; font-size:14px; letter-spacing:0; color:var(--muted); margin:0 8px 0 3px;}
.clip-time-n .unit:last-child{margin-right:0;}
/* the time row already closes with an ink rule: whatever comes next opens without its own (Matías, 25/11) */
.clip > .clip-time:not([hidden]) + *{border-top:0; padding-top:0;}

/* ---------- the foot: links, what the game is (written for search, keep it), and the fine print ---------- */
.foot{margin-top:auto; border-top:3px double var(--ink); padding-top:4px; display:flex; flex-direction:column; gap:6px; color:var(--muted);}
.foot-nav{display:flex; justify-content:space-between; gap:12px; font-size:13.5px;}
.foot-nav a{padding:10px 0; color:var(--ink); text-decoration:none;}
.foot-nav a:hover{color:var(--accent);}
.foot-nav a:focus-visible,.foot p a:focus-visible{outline:2px solid var(--accent); outline-offset:2px; border-radius:2px;}
.foot p{margin:0;}
.foot-about{padding-top:8px; border-top:1px solid var(--line); font-size:13px; line-height:1.55;}
.foot-about strong{color:var(--ink); font-weight:600;}
.foot-fine{font-size:12.5px;}
.foot p a{color:var(--muted); text-decoration:underline; text-decoration-color:var(--line); text-underline-offset:3px;}
.foot p a:hover{color:var(--ink); text-decoration-color:var(--muted);}
@media (min-width:900px){
  .foot-nav{justify-content:flex-start; gap:34px; font-size:14px;}
  .foot-about{max-width:720px;}
}

/* ---------- text pages in the house look: numbered steps and ruled lists ---------- */
.ruled,.prose .ruled{margin:0; padding:0; list-style:none; gap:0; border-top:1px solid var(--ink);}
.ruled > li,.prose .ruled > li{padding:10px 0; border-bottom:1px solid var(--line); max-width:none;}
.steps-ruled{counter-reset:step;}
.steps-ruled > li{counter-increment:step; display:grid; grid-template-columns:26px minmax(0,1fr); gap:8px;}
.steps-ruled > li::before{content:counter(step); font-family:var(--mono); font-weight:600; font-size:14px; color:var(--accent); padding-top:1px;}
.prose h3.sub{margin:8px 0 0; font-family:var(--serif); font-weight:600; font-size:18px; letter-spacing:0; text-transform:none; color:var(--ink);}
.prose .lede{max-width:none; font-family:var(--serif); font-size:18px; line-height:1.35; border-top:1px solid var(--ink); padding-top:12px;}   /* the rule runs the full width, like the ruled lists (Matías, 26/11) */

/* the archive as a ruled list: title, then number and day; the state on the right */
.archive-list{display:flex; flex-direction:column; border-top:1px solid var(--ink); list-style:none; margin:0; padding:0;}
.archive-row{display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:58px; padding:6px 0; border-bottom:1px solid var(--line); color:var(--ink); text-decoration:none;}
.archive-row:hover .archive-title{color:var(--accent);}
.archive-row:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
.archive-row > span:first-child{display:flex; flex-direction:column; min-width:0;}
.archive-title{font-family:var(--serif); font-size:17px; line-height:1.25;}
.archive-meta{font-size:12.5px; color:var(--muted);}
.archive-state{flex:none; font-family:var(--mono); font-size:12.5px; color:var(--accent-2); white-space:nowrap;}
.archive-state.done{color:var(--ok);}

/* the 404 */
.lost{display:flex; flex-direction:column; align-items:flex-start; gap:14px; padding-top:40px;}
.lost h1{margin:0; font-family:var(--serif); font-weight:600; font-size:30px; letter-spacing:-.01em; line-height:1.15;}
.lost p{margin:0; font-family:var(--serif); font-size:18px;}

/* ---------- a wide screen (900 px and up): the page as wide as the topbar, the game in two columns
   (each game's styles.css places its pieces); text pages keep a reading column ---------- */
@media (min-width:900px){
  body:has(> .topbar) > .page{max-width:1020px; padding-inline:20px; padding-top:12px; gap:24px;}   /* the name close under the topbar (Matías, 30/11) */
  .gamename{font-size:48px; letter-spacing:-.02em; padding-bottom:16px;}
  body:has(> .topbar) main:is(.prose, .archive, .lost, .lata, .ideas){max-width:680px; width:100%;}
  .end{max-width:620px;}
}
