/* How to Play (interactive) - session 257 component. Everything is scoped under .howto so it cannot clash with the site.
   Uses the site's tokens when present (fallbacks match them) and the site's "Zilla" / "Inter" font families. */
.howto{--ht-ink:var(--ink,#17283c);--ht-red:var(--red,#811c2d);--ht-gold:var(--gold,#e7b853);--ht-paper:var(--paper,#fff9ed);--ht-cream:var(--cream,#f7edda);--ht-white:var(--white,#fffdf8);--ht-muted:var(--muted,#4c5864);--ht-line:var(--line,#cdbda0);--ht-navy:#13233a;
  position:relative;margin:0;padding:clamp(.6rem,2.2vw,2rem);background-color:var(--ht-navy);background-size:cover;background-position:center;color:var(--ht-white);font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:18px;line-height:1.6;overflow:hidden}
.howto *,.howto *::before,.howto *::after{box-sizing:border-box}
.howto [hidden]{display:none!important}
.howto__frame{position:relative;max-width:1240px;margin:0 auto;padding:clamp(.4rem,1.6vw,1.4rem) clamp(.1rem,1.4vw,1.4rem) clamp(.5rem,1.6vw,1.4rem);border-style:solid;border-color:transparent;border-width:clamp(24px,4.2vw,54px);border-image-slice:108;border-image-width:1;border-image-repeat:stretch}

/* Heading: the approved panel's words, set in the site's display face */
.howto__head{text-align:center;margin:0 auto clamp(1.2rem,2.6vw,2rem);max-width:46rem}
.howto .howto__title{font-family:Zilla,Georgia,serif;font-weight:700;font-size:clamp(2.4rem,5.2vw,3.75rem);line-height:1.05;color:#fffdf8;margin:0;letter-spacing:.01em;text-shadow:0 2px 0 rgba(0,0,0,.35),0 0 22px rgba(0,0,0,.55)}
.howto .howto__line{text-wrap:balance;font-family:Zilla,Georgia,serif;font-weight:700;font-style:italic;font-size:clamp(1.2rem,2.3vw,1.6rem);line-height:1.3;color:var(--ht-cream);margin:.55rem 0 0;text-shadow:0 1px 10px rgba(0,0,0,.6)}
.howto .howto__hint{text-wrap:balance;display:inline-block;margin:1rem 0 0;padding:.3rem .9rem;border-top:1px solid rgba(231,184,83,.6);border-bottom:1px solid rgba(231,184,83,.6);color:#f9dc96;font-size:1.125rem;font-weight:700;letter-spacing:.01em;line-height:1.4}

/* Layout: the four pictures as a 2 x 2 chooser (like the panel), the chosen way beside them on wide screens */
.howto__layout{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:clamp(1.25rem,3vw,2.75rem);align-items:start}
.howto__cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(.6rem,1.8vw,1.4rem)}

/* Picture cards (tabs). Resets the site's global button look. */
.howto .howto__card{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:0;width:100%;min-height:44px;margin:0;padding:clamp(.4rem,1vw,.65rem) clamp(.35rem,1vw,.65rem) clamp(.7rem,1.4vw,1rem);background:transparent;border:2px solid transparent;border-radius:8px;color:var(--ht-white);font:inherit;font-weight:400;line-height:1.2;text-align:center;text-decoration:none;cursor:pointer;filter:none;transition:background-color .2s ease,border-color .2s ease,transform .2s ease}
.howto .howto__card:hover{background:rgba(255,255,255,.07);filter:none}
.howto .howto__card:focus-visible{outline:3px solid #fffdf8;outline-offset:3px}
.howto .howto__card[aria-selected="true"]{background:rgba(231,184,83,.16);border-color:var(--ht-gold)}
.howto__pic{position:relative;display:block;width:100%;padding:clamp(5px,.8vw,8px);background:linear-gradient(145deg,#f9e3a3 0%,#c99a3a 34%,#f3d27c 58%,#a97722 100%);border-radius:2px;box-shadow:0 8px 20px rgba(0,0,0,.5)}
.howto__pic::after{content:"";position:absolute;inset:clamp(1px,.25vw,2px);border:clamp(2px,.3vw,3px) dotted rgba(255,248,226,.9);border-radius:1px;pointer-events:none}
.howto__pic img{display:block;width:100%;height:auto;aspect-ratio:3/2;object-fit:cover;background:#f4f1ea;opacity:.82;transition:opacity .2s ease}
.howto .howto__card:hover .howto__pic img,.howto .howto__card[aria-selected="true"] .howto__pic img{opacity:1}
.howto__name{text-wrap:balance;display:block;margin-top:.65rem;font-family:Zilla,Georgia,serif;font-weight:700;font-size:clamp(1.2rem,2vw,1.55rem);line-height:1.15;color:#fffdf8;text-shadow:0 1px 8px rgba(0,0,0,.55)}
.howto__count{display:block;margin-top:.2rem;font-size:1.125rem;line-height:1.3;color:var(--ht-cream)}
.howto__sep{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.howto .howto__card[aria-selected="true"] .howto__count{color:#ffe3a3;font-weight:700}
.howto .howto__card[aria-selected="true"] .howto__name::after{content:"";display:block;width:2.6em;height:4px;margin:.4rem auto 0;border-radius:2px;background:var(--ht-gold)}

/* The chosen way: player count, warm heading, the book's rules in two short paragraphs, and the book's own page */
.howto__detail{position:relative;background:var(--ht-white);color:var(--ht-ink);border-radius:8px;border-top:6px solid var(--ht-gold);padding:clamp(1.15rem,2.8vw,2.1rem) clamp(1.1rem,2.8vw,2.2rem) clamp(1.1rem,2.4vw,1.8rem);box-shadow:0 16px 34px rgba(0,0,0,.42)}
.howto__panel{outline:none}
.howto__panel:focus-visible{outline:3px solid #006e9c;outline-offset:6px;border-radius:4px}
.howto .howto__players{margin:0 0 .45rem;font-size:1.125rem;font-weight:700;line-height:1.35;color:var(--ht-red);letter-spacing:.01em}
.howto .howto__heading{text-wrap:balance;margin:0 0 .9rem;font-family:Zilla,Georgia,serif;font-weight:700;font-size:clamp(1.65rem,2.7vw,2.15rem);line-height:1.13;color:var(--ht-ink)}
.howto__panel p{margin:0 0 1rem;font-size:1.1875rem;line-height:1.62;color:#1d2e42}
.howto .howto__actions{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem 1rem;margin:1.35rem 0 0}
.howto .howto__open{text-wrap:balance;display:inline-block;min-height:48px;padding:.7rem 1.15rem;border:2px solid var(--ht-red);border-radius:5px;background:var(--ht-red);color:#fff;font-weight:700;font-size:1.125rem;line-height:1.35;text-align:center;text-decoration:none;cursor:pointer}
.howto .howto__open:hover{background:#9a2438;border-color:#9a2438}
.howto .howto__open:focus-visible{outline:3px solid #006e9c;outline-offset:3px}
.howto__pageref{font-size:1.125rem;color:var(--ht-muted)}
.howto__noscript{margin:1rem 0 0;font-size:1.125rem}
.howto-signup-slot{margin-top:clamp(1.25rem,3vw,2.25rem)}
.howto-signup-slot:empty{display:none}

/* Gentle change when a new way is chosen */
@keyframes howto-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.howto--js .howto__panel:not([hidden]){animation:howto-in .28s ease-out}

/* The book's own pages, in a dialog */
.howto__dialog{width:min(1180px,96vw);max-width:96vw;max-height:94vh;max-height:94dvh;margin:auto;padding:0;border:0;border-radius:10px;background:var(--ht-paper);color:var(--ht-ink);font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:18px;line-height:1.6;overflow:hidden;box-shadow:0 20px 60px rgba(0,0,0,.5)}
.howto__dialog[open]{display:flex;flex-direction:column}
.howto__dialog::backdrop{background:rgba(7,18,30,.87)}
.howto__dialog-head{flex:none;display:flex;justify-content:space-between;align-items:flex-start;gap:1rem;padding:1rem clamp(1rem,2.4vw,1.5rem);background:var(--ht-paper);border-bottom:1px solid var(--ht-line)}
.howto .howto__dialog-title{margin:0;font-family:Zilla,Georgia,serif;font-weight:700;font-size:clamp(1.45rem,2.6vw,1.95rem);line-height:1.15;color:var(--ht-ink)}
.howto .howto__dialog-sub{margin:.2rem 0 0;font-size:1.0625rem;color:var(--ht-muted)}
.howto .howto__close{flex:none;display:inline-flex;align-items:center;justify-content:center;gap:.4rem;min-height:48px;min-width:48px;margin:0;padding:.55rem 1rem;border:2px solid var(--ht-red);border-radius:5px;background:var(--ht-white);color:var(--ht-red);font:inherit;font-weight:700;line-height:1.2;cursor:pointer;filter:none}
.howto .howto__close:hover{background:var(--ht-red);color:#fff;filter:none}
.howto .howto__close:focus-visible{outline:3px solid #006e9c;outline-offset:3px}
.howto .howto__close span{font-size:1.5rem;line-height:1}
.howto__dialog-body{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.howto__pages{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:clamp(1rem,2.4vw,1.75rem);padding:clamp(1rem,2.4vw,1.75rem)}
.howto__page{flex:1 1 430px;max-width:560px;margin:0}
.howto__page img{display:block;width:100%;height:auto;background:#fff;border:1px solid var(--ht-line);box-shadow:0 4px 16px rgba(23,40,60,.16)}
.howto__page figcaption{margin:.5rem 0 0;text-align:center;font-weight:700;font-size:1.0625rem;color:var(--ht-muted)}
.howto .howto__text{margin:.4rem 0 0;padding:0 .2rem;font-size:1.125rem}
.howto .howto__text summary{display:flex;align-items:center;min-height:44px;cursor:pointer;font-weight:700;color:var(--ht-red)}
.howto .howto__text p,.howto .howto__text li{font-size:1.125rem;line-height:1.6;margin:0 0 .6rem}
.howto .howto__text ol{margin:0 0 .6rem;padding-left:1.6rem}
html:has(.howto__dialog[open]){overflow:hidden}

/* Phones and narrow tablets: pictures as a compact 2 x 2 grid, the chosen way beneath them */
@media (max-width:959px){
  .howto__layout{grid-template-columns:minmax(0,1fr)}
  .howto__cards{max-width:720px;margin:0 auto;width:100%}
  .howto__detail{max-width:720px;margin:0 auto;width:100%}
}
@media (max-width:600px){
  .howto{padding:.45rem}
  .howto__frame{border-width:22px;padding:.35rem 0 .5rem}
  .howto .howto__hint{margin-top:.8rem;padding:.3rem .4rem}
  .howto .howto__card{padding:.35rem .3rem .65rem;border-radius:6px}
  .howto__name{font-size:1.15rem;margin-top:.5rem}
  .howto__panel p{font-size:1.125rem}
  .howto .howto__open{width:100%}
  .howto__pageref{width:100%;text-align:center}
  .howto__dialog{width:100vw;max-width:100vw;height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;border-radius:0}
  .howto__dialog-head{padding:.75rem .9rem}
  .howto__pages{padding:.9rem .75rem 1.5rem}
  .howto__page{flex-basis:100%}
}
@media (prefers-reduced-motion:reduce){
  .howto *,.howto *::before,.howto *::after{animation:none!important;transition:none!important}
}
@media (forced-colors:active){
  .howto .howto__card[aria-selected="true"]{border-color:Highlight}
  .howto .howto__card[aria-selected="true"] .howto__name::after{background:Highlight}
}
