/* ══════════════════════════════════════════════════════════════════════
   public/css/how-to-play.css — How to play, take B (#4501, Wray 2026-10-30:
   "lets roll with B"; mock in PR #4590)
   ──────────────────────────────────────────────────────────────────────
   The page is built from Home's own pieces, so this sheet only lays them
   out for a page and does not draw a parallel set:
     .wh-screen / .wh-shell  Home's tokens and its --k step (1 on a landscape
                             phone, 2 from 1400 x 800), world-home.css
     .wh-tiles .wh-tile      Home's door tiles as Home draws them today (a
                             card each: the glyph, the name and its line, its
                             colour underneath), larger here
     .wh-right .wh-ribbon    Home's slate window under the red ribbon
     .wh-go .wh-sc-link .wh-key .wh-pill   Home's buttons, key caps, pills
   The glyphs are the game's own cells: the nav row (nav-icons.png), Home's
   icon row (home/icons.png), the quest marks, Home's cat, the Obol, a house
   sigil. No glass: every surface is solid, nothing is see-through.

   world-home.css lives in @layer corners, so a plain rule here wins over
   it whatever its selector. The few unlayered Home rules that touch a reused
   piece (Home hides .wh-ribbon, and pins .wh-right as a column when narrow)
   are answered below by name.
   ══════════════════════════════════════════════════════════════════════ */
@font-face {
  font-family: 'New Rocker';
  src: url('/assets/fonts/NewRocker-Regular.ttf?v=2026-10-04a') format('truetype');
  font-display: swap;
}

html, body.htp-page { margin: 0; height: 100%; background: #121822; }

/* the screen: Home's, over the town's art at rest rather than the live world */
.htp {
  z-index: 1;
  background:
    radial-gradient(ellipse 80% 70% at 50% 35%, rgba(26, 34, 50, .55), rgba(10, 14, 22, .96) 78%),
    url('/assets/onboarding/backdrop-3-wide.jpg') center 40% / cover no-repeat,
    #121822;
}
/* Home's print dots, thinning down the page */
.htp::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle, rgba(227, 199, 154, .09) 1.4px, transparent 1.8px) 0 0 / 7px 7px;
  -webkit-mask-image: linear-gradient(170deg, #000, transparent 65%);
  mask-image: linear-gradient(170deg, #000, transparent 65%);
}

.htp .htp-shell {
  display: flex;
  flex-direction: column;
  gap: calc(10px + 8px * var(--k));
  height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* ── the hero plate: the studded plate Home's name sits on ── */
.htp .htp-top {
  flex: none;
  display: flex;
  align-items: center;
  gap: calc(10px + 6px * var(--k));
  padding: calc(2px * var(--k)) calc(6px * var(--k));
  border-style: solid;
  border-width: calc(3px + 3px * var(--k)) calc(5px + 5px * var(--k));
  border-image: url('/assets/ui/kitb/plate.png?v=2026-09-24a') 6 10 6 10 fill / calc(3px + 3px * var(--k)) calc(5px + 5px * var(--k)) stretch;
  image-rendering: pixelated;
  filter: drop-shadow(0 3px 0 #05070b) drop-shadow(0 6px 10px rgba(0, 0, 0, .45));
}
.htp .htp-title {
  margin: 0;
  flex: none;
  font: 400 calc(20px + 9px * var(--k))/1 var(--f-tome);
  color: var(--gold);
  text-shadow: 0 2px 0 var(--line);
  white-space: nowrap;
}
.htp .htp-lead {
  flex: 1;
  min-width: 0;
  margin: 0;
  font: 400 calc(15px + 5px * var(--k))/1.1 var(--f-vt);
  color: var(--ink-2);
}
.htp .htp-play { flex: none; text-decoration: none; }

/* ── the doors: Home's tiles (a card each: the glyph, the name, its line,
   its colour underneath), larger, because here they are the page ── */
.htp .htp-tiles {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(820px + 360px * var(--k));
  margin: 0 auto;
  align-content: center;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: calc(6px + 5px * var(--k));
}
.htp .htp-tiles .wh-tile { text-decoration: none; min-width: 0; align-items: center; }
.htp .htp-tiles .wh-tile[data-tile] .wh-glyph { width: calc(30px + 16px * var(--k)); flex: none; }
.htp .htp-tiles .wh-tile-t { min-width: 0; text-align: left; justify-items: start; }
.htp .htp-tiles .wh-tile-t b { font-size: calc(6px + 3px * var(--k)); line-height: 1.25; white-space: normal; overflow: visible; }
.htp .htp-tiles .wh-tile-t i { font-size: calc(14px + 4px * var(--k)); white-space: normal; line-height: 1; }

/* each door's colour and glyph: the nav row's cells (map, sword, trophy,
   bag, chest, gear, book, question, helm, hall), Home's icon row, the
   quest marks, Home's cat, the Obol and a house sigil */
.htp .wh-tile[data-tile='getting-in']        { --tile: #ff9f5a; }
.htp .wh-tile[data-tile='moving-around']     { --tile: #f3c64a; }
.htp .wh-tile[data-tile='the-stone-town']    { --tile: #6aa8ff; }
.htp .wh-tile[data-tile='out-in-the-wild']   { --tile: #8fd89a; }
.htp .wh-tile[data-tile='fighting']          { --tile: #e0535c; }
.htp .wh-tile[data-tile='spells-and-packs']  { --tile: #b48cff; }
.htp .wh-tile[data-tile='making-gear']       { --tile: #e09a3a; }
.htp .wh-tile[data-tile='the-pit']           { --tile: #f2b81a; }
.htp .wh-tile[data-tile='the-deep']          { --tile: #4fd1b5; }
.htp .wh-tile[data-tile='your-house']        { --tile: #e0535c; }
.htp .wh-tile[data-tile='strong-and-weak']   { --tile: #8fd89a; }
.htp .wh-tile[data-tile='friends-and-guilds'] { --tile: #ff9f5a; }
.htp .wh-tile[data-tile='obols-and-infamy']  { --tile: #e3c79a; }
.htp .wh-tile[data-tile='words-worth-knowing'] { --tile: #8fa3c7; }

.htp .wh-tile[data-tile='getting-in'] .wh-glyph { background-image: url('/assets/ui/home-icon.png?v=2026-10-27a'); background-size: 100% 200%; }
.htp .wh-tile[data-tile='moving-around'] .wh-glyph { background-position-x: 0%; }
.htp .wh-tile[data-tile='the-stone-town'] .wh-glyph { background-position-x: 100%; }
.htp .wh-tile[data-tile='out-in-the-wild'] .wh-glyph { background-image: url('/assets/ui/quest-icons.png'); background-size: 800% 200%; background-position-x: 42.8571%; }
.htp .wh-tile[data-tile='fighting'] .wh-glyph { background-position-x: 11.1111%; }
.htp .wh-tile[data-tile='spells-and-packs'] .wh-glyph { background-position-x: 66.6667%; }
.htp .wh-tile[data-tile='making-gear'] .wh-glyph { background-position-x: 88.8889%; }
.htp .wh-tile[data-tile='the-pit'] .wh-glyph { background-position-x: 22.2222%; }
.htp .wh-tile[data-tile='the-deep'] .wh-glyph { background-position-x: 44.4444%; }
.htp .wh-tile[data-tile='your-house'] .wh-glyph { background-image: url('/assets/images/houses/House-stormrage.png'); background-size: contain; background-position: center; image-rendering: auto; }
.htp .wh-tile[data-tile='strong-and-weak'] .wh-glyph { background-image: url('/assets/images/houses/House-smoulders.png'); background-size: contain; background-position: center; image-rendering: auto; }
.htp .wh-tile[data-tile='friends-and-guilds'] .wh-glyph { background-image: url('/assets/ui/home/icons.png?v=2026-11-08a'); background-size: 2000% 100%; background-position-x: 26.3158%; }
.htp .wh-tile[data-tile='obols-and-infamy'] .wh-glyph { background-image: url('/assets/ui/kitb/obol.png?v=2026-10-04a'); background-size: contain; background-position: center; }
.htp .wh-tile[data-tile='words-worth-knowing'] .wh-glyph { background-position-x: 77.7778%; }

.htp .htp-foot { flex: none; display: flex; justify-content: center; gap: calc(6px + 4px * var(--k)); }
.htp .htp-foot .wh-pill { text-decoration: none; }

/* ── the window: Home's slate window under the red ribbon ── */
.htp .htp-scrim {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: calc(34px + 16px * var(--k)) calc(8px + 8px * var(--k)) calc(6px + 10px * var(--k));
  background: rgba(6, 8, 14, .82);
}
.htp .htp-scrim.is-open { display: flex; }
.htp .htp-win {
  /* Home pins .wh-right as a sticky column when narrow; here it is a window */
  position: relative;
  grid-column: auto;
  grid-row: auto;
  height: auto;
  box-sizing: border-box;
  width: min(calc(560px + 320px * var(--k)), 100%);
  max-height: 100%;
  margin: 0;
  padding: calc(12px + 8px * var(--k)) calc(6px + 8px * var(--k)) calc(4px + 4px * var(--k));
  gap: calc(6px * var(--k));
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, .55));
}
/* Home hides its ribbon (its standings wear a gold head now); a window keeps it */
.wh-screen.htp .htp-win .wh-ribbon {
  display: block;
  top: calc(-9px - 9px * var(--k) - 13px * var(--k));
  min-width: calc(150px + 60px * var(--k));
  font-size: calc(17px + 6px * var(--k));
  padding-top: calc(3px * var(--k));
}
.htp .htp-x {
  position: absolute;
  top: calc(-9px - 9px * var(--k) - 8px * var(--k));
  right: calc(-6px - 4px * var(--k));
  width: calc(26px + 10px * var(--k));
  aspect-ratio: 40 / 43;
  padding: 0;
  border: 0;
  background: url('/assets/ui/kitb/close.png?v=2026-09-24a') center / 100% 100% no-repeat;
  image-rendering: pixelated;
  cursor: pointer;
}
.htp .htp-x:hover { filter: brightness(1.15); }
.htp .htp-body {
  min-height: 0;
  overflow-y: auto;
  padding: 2px calc(4px * var(--k)) 4px 2px;
  scrollbar-width: thin;
}
.htp .htp-nav { flex: none; display: flex; justify-content: space-between; gap: 10px; }
.htp .htp-nav .wh-sc-link { font-size: calc(6px + 3px * var(--k)); padding: calc(4px * var(--k)) calc(10px * var(--k)) calc(6px * var(--k)); min-height: calc(26px + 8px * var(--k)); cursor: pointer; }

/* the copy: the game's VT323, gold for the words that matter */
.htp .htp-sec { font: 400 calc(17px + 5px * var(--k))/1.2 var(--f-vt); color: var(--ink); }
.htp .htp-sec h2 { margin: 0 0 calc(4px * var(--k)); font: 400 calc(16px + 6px * var(--k))/1 var(--f-tome); color: var(--gold); text-shadow: 0 2px 0 var(--line); }
.htp .htp-sec p { margin: 0 0 calc(5px * var(--k)); }
.htp .htp-sec p:last-child { margin-bottom: 0; }
.htp .htp-sec strong { color: var(--gold-hi); font-weight: 400; }
.htp .htp-sec ul { margin: 0 0 calc(5px * var(--k)) 1.1em; padding: 0; }
.htp .htp-sec li { margin: 0 0 calc(2px * var(--k)); }
.htp .htp-sec li::marker { color: var(--gold-btn); }
.htp .htp-sec .wh-key { font-size: calc(7px + 2px * var(--k)); vertical-align: 2px; }
.htp .htp-sec .htp-sigils {
  list-style: none;
  margin: calc(4px * var(--k)) 0 calc(6px * var(--k));
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: calc(3px * var(--k));
}
.htp .htp-sigils li {
  display: flex;
  align-items: center;
  gap: calc(6px * var(--k));
  margin: 0;
  padding: calc(2px * var(--k)) calc(6px * var(--k));
  background: var(--well);
  box-shadow: inset 0 0 0 2px var(--line);
}
.htp .htp-sigils img { width: calc(18px + 8px * var(--k)); height: calc(18px + 8px * var(--k)); object-fit: contain; }

/* ── the house damage table (#4564): drawn by /js/house-table.js from the
   rules. Home's well for an even cell; Strong and Weak take Home's green and
   red. Until it has drawn, only the waiting line shows. ── */
.htp .htp-sec .htp-ht-drawn { display: none; }
.htp .htp-sec.is-drawn .htp-ht-drawn { display: block; }
.htp .htp-sec.is-drawn .htp-ht-wait { display: none; }
.htp .htp-ht-wait { color: var(--dim); }
.htp .htp-ht-wrap { margin: calc(4px * var(--k)) 0 calc(6px * var(--k)); overflow-x: auto; }
.htp .htp-ht {
  width: 100%;
  min-width: 600px;
  border-collapse: separate;
  border-spacing: 2px;
  table-layout: fixed;
  font: 400 calc(15px + 3px * var(--k))/1 var(--f-vt);
}
.htp .htp-ht-cap { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.htp .htp-ht th, .htp .htp-ht td { padding: 0; font-weight: 400; }
.htp .htp-ht-corner { width: calc(108px + 30px * var(--k)); vertical-align: bottom; text-align: left; padding-bottom: 4px; }
.htp .htp-ht-corner span { display: block; font: 400 calc(14px + 3px * var(--k))/1.05 var(--f-vt); color: var(--gold); }
.htp .htp-ht-corner span:first-child::after { content: ' \2193'; }
.htp .htp-ht-corner span:last-child::after { content: ' \2192'; }
.htp .htp-ht-col { vertical-align: bottom; text-align: center; padding-bottom: 2px; }
.htp .htp-ht-col img { display: block; width: calc(18px + 6px * var(--k)); height: calc(18px + 6px * var(--k)); object-fit: contain; margin: 0 auto 2px; }
.htp .htp-ht-col span {
  display: block;
  margin: 0 auto;
  height: calc(58px + 16px * var(--k));
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  text-align: left;
  font-size: calc(13px + 3px * var(--k));
  color: var(--ink);
}
.htp .htp-ht-row { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.htp .htp-ht-row img { width: calc(16px + 6px * var(--k)); height: calc(16px + 6px * var(--k)); object-fit: contain; vertical-align: middle; margin-right: calc(3px + 2px * var(--k)); }
.htp .htp-ht-row span { vertical-align: middle; }
.htp .htp-ht-c {
  height: calc(24px + 12px * var(--k));
  text-align: center;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
}
.htp .htp-ht-c.is-strong { background: #2f6b3a; color: #e9ffe9; }
.htp .htp-ht-c.is-weak { background: #7e2b32; color: #ffe6e8; }
.htp .htp-sec .htp-ht-key { list-style: none; margin-left: 0; flex-wrap: wrap; gap: calc(2px * var(--k)) calc(14px + 6px * var(--k)); }
.htp .htp-sec.is-drawn .htp-ht-key { display: flex; }
.htp .htp-ht-key li { margin: 0; }
.htp .htp-ht-key i { display: inline-block; width: 0.8em; height: 0.8em; margin-right: 0.35em; vertical-align: -0.05em; background: var(--well); box-shadow: inset 0 0 0 1px var(--line); }
.htp .htp-ht-key i.is-strong { background: #2f6b3a; }
.htp .htp-ht-key i.is-weak { background: #7e2b32; }

/* with the script, one section at a time and its heading on the ribbon */
.htp-js .htp .htp-sec { display: none; }
.htp-js .htp .htp-sec.is-on { display: block; }
.htp-js .htp .htp-sec h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* without it, the window is a page under the doors, every section in order */
html:not(.htp-js) .htp { position: static; min-height: 100%; }
html:not(.htp-js) .htp .htp-shell { height: auto; overflow: visible; }
html:not(.htp-js) .htp .htp-scrim { position: static; display: flex; background: none; }
html:not(.htp-js) .htp .htp-ribbon,
html:not(.htp-js) .htp .htp-x,
html:not(.htp-js) .htp .htp-nav { display: none; }
html:not(.htp-js) .htp .htp-sec + .htp-sec { margin-top: 18px; }

/* ── a landscape phone: two rows of doors, the window a full sheet ── */
@container wh (max-width: 1000px) {
  .htp .htp-top { gap: 8px; }
  .htp .htp-lead { font-size: 15px; }
}
@container wh (max-height: 520px) {
  .htp .htp-shell { gap: 6px; }
  .htp .htp-tiles { gap: 5px; }
  .htp .htp-tiles .wh-tile { padding: 5px 6px 8px; }
  .htp .htp-tiles .wh-tile[data-tile] .wh-glyph { width: 34px; }
  .htp .htp-scrim { padding: 30px 6px 4px; }
  .htp .htp-win { width: 100%; }
  /* the table in one look on a landscape phone: the heads lie flat (a cell is
     about 73px across, room for Nighthollow) and the rows close up */
  .htp .htp-ht-wrap { margin: 0 0 4px; }
  .htp .htp-ht { font-size: 16px; line-height: 1; }
  .htp .htp-ht-col img { width: 16px; height: 16px; margin-bottom: 1px; }
  .htp .htp-ht-col span { height: auto; writing-mode: horizontal-tb; transform: none; text-align: center; font-size: 14px; }
  .htp .htp-ht-corner { padding-bottom: 2px; }
  .htp .htp-ht-corner span { font-size: 14px; line-height: 1; }
  .htp .htp-ht-row img { width: 16px; height: 16px; }
  .htp .htp-ht-c { height: 19px; }
}

@media (prefers-reduced-motion: reduce) {
  .htp .htp-win { animation: none !important; }
}

/* THE PIT LIVES ONLY ON 9LV.NET (#5183; Wray 2026-11-11): on the world's own
   domain the Pit's door and its section are not drawn (public/css/flags.css
   explains data-door). Its lines inside other sections carry .not-on-world. */
html[data-door="world"] .htp [data-tile="the-pit"],
html[data-door="world"] .htp #the-pit {
  display: none !important;
}
