/* Monopoly Arena, spicy4tuna/analisis.css: the analysis of spicy4tuna's real-money game (spicy4tuna/index.html),
   a sibling of the article (articulo.html / articulo.css): one white sheet on the felt, one reading column, a deed
   band over each section. The whole page is one section of the site, so every band and every mark is the green
   (--g-verde), the group that decided the game. Each play opens with the title deed of the street at stake, in
   its group's colour, beside its clip; its alternatives read like the deed's rent table (escala).
   Variables, faces and colours come from ../theme.css. Static: nothing hidden; the one motion is the strips
   growing as their ladder scrolls in (CSS scroll timeline), with the full strips as the resting state.
   Colour code in every ladder: .is-do = the best for whoever decides (green), .is-real = what they did (ink
   strip), no class = the rest (grey). The clip (figure.clip) belongs to clip.css / clip.js; here only its place. */

html { box-sizing: border-box; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--table); }
*, *::before, *::after { box-sizing: inherit; }

body {
  /* the article's five text sizes and the title */
  --a-h1: clamp(2.75rem, 1.5rem + 4.4vw, 6rem);
  --a-h2: clamp(2rem, 1.35rem + 2.4vw, 3rem);
  --a-lead: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  --a-body: clamp(1.125rem, 1.08rem + 0.2vw, 1.1875rem);
  --a-small: 0.9375rem;
  --measure: 56ch;
  --pad-x: clamp(1.25rem, 6vw, 5.5rem);
  --bar-no: #9a9d98;            /* the grey of the rows that were not the best */
  --c: var(--g-verde); --c-ink: var(--ink);
  margin: 0; color: var(--ink); font-family: var(--text); font-size: var(--a-body); line-height: 1.55;
  font-kerning: normal; font-variant-numeric: lining-nums;
}
.nw { white-space: nowrap; }
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

/* ── links: ink, underlined, the accent on hover ──────────────────────────── */
a { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; text-decoration-color: currentColor; transition: color var(--t-hover) var(--ease-out), text-decoration-color var(--t-hover) var(--ease-out); }
@media (hover: hover) { a:hover { color: var(--accent-2); } }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* ── the quiet ways back, on the felt, on the sheet's column line ─────────── */
.volver { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; width: 100%; max-width: calc(var(--measure) + 2 * var(--pad-x)); margin: 0 auto; padding: 1.1rem var(--pad-x); font-size: var(--a-body); }
.volver a { color: var(--paper); font-size: var(--a-small); font-weight: 600; line-height: 1.4; }
@media (hover: hover) { .volver a:hover { color: var(--board); } }
.volver a:focus-visible { outline-color: var(--paper); }
.volver--fin { padding-top: 1.5rem; padding-bottom: 3rem; }

/* ── the sheet ────────────────────────────────────────────────────────────── */
.hoja {
  display: block; width: 100%; max-width: calc(var(--measure) + 2 * var(--pad-x)); margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) var(--pad-x) clamp(3rem, 7vw, 5rem);
  background: var(--paper); color: var(--ink);
}
@media (min-width: 56rem) { .hoja { border-radius: var(--radius-card); } }

p { margin: 0 0 1em; text-wrap: pretty; }
strong, b { font-weight: 600; }

/* ── the title, its sentence, the line under it ───────────────────────────── */
.cabecera h1 {
  margin: 0; padding-top: 0.04em;
  font-family: var(--display); font-weight: 700; font-size: var(--a-h1); line-height: 0.92; letter-spacing: -0.02em;
  text-transform: uppercase; text-wrap: balance;
}
.entradilla { margin: clamp(1.25rem, 3vw, 2rem) 0 0; font-size: var(--a-lead); font-weight: 500; line-height: 1.3; text-wrap: pretty; }
.firma { margin: 1.25rem 0 0; font-size: var(--a-small); line-height: 1.4; color: var(--ink-2); }
.accion { margin: clamp(1.5rem, 3.5vw, 2rem) 0 0; }
.boton {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0.55rem 1.25rem; border-radius: var(--radius-btn);
  background: var(--accent); color: var(--accent-ink); font-size: var(--a-body); font-weight: 600; line-height: 1.2; text-decoration: none;
  transition: background-color var(--t-hover) var(--ease-out), transform var(--t-press) var(--ease-out);
}
@media (hover: hover) { .boton:hover { background: var(--accent-2); color: var(--accent-ink); } }
.boton:active { transform: scale(0.98); }
.boton:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ── the summary: a tone step across the sheet ────────────────────────────── */
.resumen { margin: clamp(2rem, 5vw, 3rem) calc(-1 * var(--pad-x)) 0; padding: clamp(1.25rem, 3vw, 1.75rem) var(--pad-x) clamp(0.5rem, 1.5vw, 0.75rem); background: var(--paper-2); }
.resumen h2 { margin: 0 0 0.5rem; font-family: var(--display); font-weight: 700; font-size: var(--a-lead); line-height: 1.05; text-transform: uppercase; }
.nota { margin: 1.25rem 0 0; font-size: var(--a-small); line-height: 1.45; color: var(--ink-2); }

/* ── a section: its green deed band across the sheet ──────────────────────── */
.seccion { margin-top: clamp(3.5rem, 8vw, 5.5rem); }
.seccion--aparte { --c: var(--paper-2); --c-ink: var(--ink); }
.banda {
  margin: 0 calc(-1 * var(--pad-x)) clamp(1.5rem, 3.5vw, 2.25rem);
  padding: clamp(1.1rem, 2.8vw, 1.6rem) var(--pad-x) clamp(0.95rem, 2.4vw, 1.35rem);
  background: var(--c); color: var(--c-ink);
}
.banda h2 { margin: 0; font-family: var(--display); font-weight: 700; font-size: var(--a-h2); line-height: 0.95; letter-spacing: -0.02em; text-transform: uppercase; text-wrap: balance; }
.seccion h3 { margin: clamp(2.25rem, 5vw, 3rem) 0 0.6rem; font-family: var(--display); font-weight: 700; font-size: var(--a-lead); line-height: 1.05; letter-spacing: -0.01em; text-wrap: balance; }
.seccion h4 { margin: 1.75rem 0 0.35rem; font-size: var(--a-body); font-weight: 600; line-height: 1.3; text-wrap: balance; }

/* ── plain lists ──────────────────────────────────────────────────────────── */
.lista { margin: 0 0 1.25rem; padding: 0 0 0 1.1em; }
.lista li { margin: 0 0 0.75em; padding-left: 0.2em; text-wrap: pretty; }
.lista li::marker { color: var(--ink-2); }

/* ── figures ──────────────────────────────────────────────────────────────── */
.fig { margin: clamp(1.75rem, 4.5vw, 2.75rem) 0; min-width: 0; }
.fig figcaption { margin-top: 0.9rem; font-size: var(--a-small); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }

/* the chart, drawn from data/spicy4tuna.json: the wide drawing on the column, a taller one on the phone */
.grafica svg { display: block; width: 100%; height: auto; overflow: visible; font-family: var(--text); font-variant-numeric: tabular-nums; }
.grafica__estrecha { display: none !important; }
@media (max-width: 36rem) {
  .grafica__ancha { display: none !important; }
  .grafica__estrecha { display: block !important; }
}

/* ── a play: the deed of the street at stake, its heading and its clip beside it; then the story and one
   ladder per player. On the phone the heading comes first, then the deed, then the clip ── */
.jugada { margin-top: clamp(3.5rem, 8vw, 5rem); scroll-margin-top: 1.5rem; }
.jugada__cabeza {
  display: grid; grid-template-columns: minmax(0, 12.5rem) minmax(0, 1fr); grid-template-rows: auto 1fr;
  grid-template-areas: "deed head" "deed clip"; column-gap: 1.25rem; row-gap: 0.8rem; align-items: start; margin: 0 0 1.4rem;
}
.jugada__cabeza > h3 { grid-area: head; margin: 0; }
.jugada__cabeza > .escritura { grid-area: deed; }
.jugada__cabeza > .clip { grid-area: clip; margin: 0; min-width: 0; }
.jugada__cabeza > .clip figcaption { margin-top: 0.4rem; font-size: var(--a-small); line-height: 1.45; color: var(--ink-2); text-wrap: pretty; }
@media (max-width: 34rem) {
  .jugada__cabeza { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: "head" "deed" "clip"; }
  .escritura { max-width: 17rem; }
}

/* the title deed of the street at stake: the board's mini deed (board.css .board-deed) set in the column,
   with the printed ink frame, the group's band and the price row */
.escritura { --band: var(--ink); --band-ink: var(--white); border: var(--frame-w) solid var(--board-edge); background: var(--paper); }
.escritura--marron { --band: var(--g-marron); --band-ink: var(--white); }
.escritura--celeste { --band: var(--g-celeste); --band-ink: var(--ink); }
.escritura--rosa { --band: var(--g-rosa); --band-ink: var(--ink); }
.escritura--naranja { --band: var(--g-naranja); --band-ink: var(--ink); }
.escritura--rojo { --band: var(--g-rojo); --band-ink: var(--white); }
.escritura--amarillo { --band: var(--g-amarillo); --band-ink: var(--ink); }
.escritura--verde { --band: var(--g-verde); --band-ink: var(--ink); }
.escritura--azul { --band: var(--g-azul); --band-ink: var(--white); }
.escritura__banda {
  margin: 0; padding: 0.65rem 0.7rem 0.6rem; text-align: center;
  background: var(--band); color: var(--band-ink); border-bottom: var(--frame-w) solid var(--board-edge);
  font-family: var(--display); font-weight: 700; font-size: var(--a-lead); line-height: 0.92; letter-spacing: -0.02em;
  text-transform: uppercase; text-wrap: balance; overflow-wrap: break-word;
}
.escritura__cuerpo { padding: 0.6rem 0.75rem 0.15rem; font-size: var(--a-small); line-height: 1.4; }
.escritura__precio { display: flex; justify-content: space-between; gap: 1rem; margin: 0 0 0.5rem; font-size: var(--a-body); font-weight: 600; font-variant-numeric: tabular-nums; }
.escritura__linea { margin: 0 0 0.6rem; text-wrap: pretty; }

/* one verdict per player: a heading, a sentence, the ladder */
.veredicto { margin-top: 1.5rem; }
.veredicto > p { margin-bottom: 0.8rem; }

/* the ladder: the deed's rent rows, label left, the win rate big on the right, the fair-trades figure beside it,
   a strip under the row on a 0–100 % scale; rows are tone steps, the best filled green */
.escala { display: grid; row-gap: 3px; margin: 0 0 0.5rem; font-variant-numeric: tabular-nums; line-height: 1.3; }
.escala__fila { display: grid; grid-template-columns: minmax(0, 1fr) 5.25rem 6.5rem; grid-template-areas: "k v w" "t t t"; column-gap: 1rem; row-gap: 0.4rem; align-items: baseline; padding: 0.6rem 0.75rem 0.65rem; background: var(--paper-2); }
.escala__fila--cab { grid-template-areas: "k v w"; align-items: end; padding-top: 0; padding-bottom: 0.25rem; background: none; font-size: var(--a-small); font-weight: 600; line-height: 1.2; }
.escala__fila--cab .escala__v, .escala__fila--cab .escala__w { font-family: var(--text); font-size: var(--a-small); font-weight: 600; }
.escala__k { grid-area: k; text-wrap: pretty; }
.escala__v { grid-area: v; text-align: right; font-family: var(--display); font-weight: 700; font-size: var(--a-lead); line-height: 1; white-space: nowrap; }
.escala__w { grid-area: w; text-align: right; font-weight: 500; white-space: nowrap; }
.escala__fila--cab .escala__w { white-space: normal; text-wrap: balance; }
.escala__tira { grid-area: t; display: block; height: 0.6rem; width: max(3px, calc(var(--v) / 100 * 100%)); background: var(--bar-no); transform-origin: 0 50%; }
.escala__fila.is-real .escala__k { font-weight: 600; }
.escala__fila.is-real .escala__tira { background: var(--ink); }
.escala__fila.is-do { background: var(--c); color: var(--c-ink); }
.escala__fila.is-do .escala__k { font-weight: 600; }
.escala__fila.is-do .escala__tira { background: var(--ink); }

/* the way into the viewer at this moment */
.seguir { margin: 1.25rem 0 0; font-weight: 600; }

/* ── the scorecard: the recipe's steps down, the players across; rows as tone steps, steps kept in green ── */
.tarjeta { width: 100%; border-collapse: separate; border-spacing: 3px; margin: 0 -3px; font-size: var(--a-small); line-height: 1.35; table-layout: fixed; }
.tarjeta th, .tarjeta td { padding: 0.55rem 0.6rem; text-align: left; vertical-align: top; text-wrap: pretty; }
.tarjeta thead th { padding-top: 0; padding-bottom: 0.3rem; font-family: var(--display); font-size: var(--a-lead); font-weight: 700; line-height: 1; vertical-align: bottom; }
.tarjeta thead th:first-child { width: 24%; }
.tarjeta__gano { display: block; margin-top: 0.2rem; font-size: var(--a-small); font-weight: 700; }
.tarjeta tbody th { font-weight: 600; background: var(--paper-2); }
.tarjeta tbody td { background: var(--paper-2); }
.tarjeta tbody td.is-do { background: var(--c); color: var(--c-ink); }
.tarjeta tr.tarjeta__decision th, .tarjeta tr.tarjeta__decision td { background: none; padding-top: 0.75rem; }
.tarjeta tr.tarjeta__decision + tr.tarjeta__decision th, .tarjeta tr.tarjeta__decision + tr.tarjeta__decision td { padding-top: 0.2rem; }

/* ── the best each could have done: the name in the deed's caps, the moves beside it ── */
.mejor { margin: 0; display: grid; row-gap: 1.25rem; }
.mejor > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: 1.25rem; align-items: baseline; }
.mejor dt { font-family: var(--display); font-weight: 700; font-size: var(--a-lead); line-height: 1; text-transform: uppercase; letter-spacing: -0.01em; }
.mejor dd { margin: 0; text-wrap: pretty; }

/* ── the three lessons: each a statement at the lead size, its reason under it ── */
.lecciones { list-style: none; margin: 0; padding: 0; display: grid; row-gap: 2rem; }
.leccion { margin: 0 0 0.5rem; font-size: var(--a-lead); font-weight: 600; line-height: 1.25; text-wrap: balance; }
.lecciones li p:last-child { margin-bottom: 0; }

/* ── the way into the whole game: one green field, the link at the band's size ── */
.banda--todo { margin-bottom: 0; padding-top: clamp(1.75rem, 4vw, 2.5rem); padding-bottom: clamp(1.5rem, 3.5vw, 2.25rem); }
.banda--todo h2 { font-size: var(--a-h1); line-height: 0.92; }
.banda--todo h2 a { text-decoration-thickness: 0.07em; text-underline-offset: 0.12em; }
@media (hover: hover) { .banda--todo h2 a:hover { color: var(--paper); } }
.banda--todo h2 a:focus-visible { outline-color: var(--ink); }
.banda--todo p { margin: 0.75rem 0 0; font-size: var(--a-body); font-weight: 500; line-height: 1.4; }

/* ── the credit line: a quiet close under the green field ─────────────────── */
.creditos { margin-top: clamp(2rem, 5vw, 3rem); }
.creditos h2 { margin: 0 0 0.5rem; font-family: var(--display); font-weight: 700; font-size: var(--a-lead); line-height: 1.05; text-transform: uppercase; }
.creditos p { font-size: var(--a-small); line-height: 1.5; }
.creditos .nota { margin-top: 0; }

/* ── the phone: one column, smaller ladder columns, the scorecard one step per block ── */
@media (max-width: 40rem) {
  .escala__fila { grid-template-columns: minmax(0, 1fr) 4.25rem 4.75rem; column-gap: 0.6rem; padding-inline: 0.6rem; }
  .escala__w { font-size: var(--a-small); }
  .mejor > div { grid-template-columns: minmax(0, 1fr); row-gap: 0.3rem; }
  /* the scorecard: each step on its own line, its four players two by two under it, named in each cell */
  .tarjeta, .tarjeta tbody { display: block; margin: 0; }
  .tarjeta thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .tarjeta tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; margin-bottom: 0.9rem; }
  .tarjeta tbody th { grid-column: 1 / -1; background: none; padding: 0 0 0.1rem; font-family: var(--display); font-size: var(--a-lead); font-weight: 700; line-height: 1.1; }
  .tarjeta td { display: block; }
  .tarjeta td::before { content: attr(data-p); display: block; margin-bottom: 0.15rem; font-weight: 600; }
  .tarjeta tr.tarjeta__decision th, .tarjeta tr.tarjeta__decision td { padding-top: 0.55rem; }
  .tarjeta tr.tarjeta__decision td { background: var(--paper-2); }
  .tarjeta tr.tarjeta__decision th { padding-top: 0; }
}

/* ── motion: the strips grow as their ladder comes up the screen; at rest, and outside that range, full ── */
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: view()) {
    .escala { view-timeline: --escala block; }
    .escala__tira { animation: an-crece linear both; animation-timeline: --escala; animation-range: entry 0% cover 36%; }
    .escala__fila:nth-child(3) .escala__tira { animation-range: entry 0% cover 39%; }
    .escala__fila:nth-child(4) .escala__tira { animation-range: entry 0% cover 42%; }
    .escala__fila:nth-child(n + 5) .escala__tira { animation-range: entry 0% cover 45%; }
  }
}
@keyframes an-crece { from { transform: scaleX(0.04); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { a, .boton { transition: none; } .boton:active { transform: none; } }

/* ── print: ink on white, no felt, no link chrome, every block kept whole ── */
@media print {
  @page { margin: 16mm 15mm; }
  html, body { background: #fff; }
  body { --a-h1: 30pt; --a-h2: 20pt; --a-lead: 13pt; --a-body: 10.5pt; --a-small: 8.5pt; line-height: 1.45; }
  .volver, .accion { display: none; }
  .hoja { max-width: 170mm; margin: 0; padding: 0; border-radius: 0; }
  a { color: inherit; text-decoration: none; }
  .resumen { margin-inline: 0; padding: 8pt 10pt 2pt; }
  .banda { margin-inline: 0; padding: 6pt 0 0; background: none; color: var(--ink); border-top: 5pt solid var(--c); }
  .banda--todo h2 { font-size: var(--a-h2); }
  .banda--todo h2 a::after { content: " (spicy4tuna/partida.html)"; font-family: var(--text); font-size: var(--a-small); font-weight: 400; text-transform: none; }
  .seccion { margin-top: 20pt; }
  .jugada { margin-top: 16pt; }
  .grafica__ancha { display: block !important; }
  .grafica__estrecha { display: none !important; }
  .clip iframe, .clip button { display: none; }
  .clip__open::after { content: " (youtube.com/watch?v=EWIQywHC4E8)"; font-weight: 400; }
  .seguir { display: none; }
  .resumen, .banda, .escala__fila, .escala__tira, .escritura__banda, .tarjeta th, .tarjeta td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .escala__tira { animation: none; }
  .fig, .veredicto, .jugada__cabeza, .escala, .tarjeta tr, .lecciones li, .mejor > div { break-inside: avoid; }
  h2, h3, h4 { break-after: avoid; }
}
