/* The look of the pages to read on how to play: /nonogram/how and the pages under it (src/pages/techniques.ts). */
:root { --bg: #f6f1e8; --ink: #2a2620; --muted: #7a7064; --accent: #2f4a78; --accent-text: #2f4a78; --red: #c44646; --cloth: #f7f0e2; --line: rgb(120 96 64 / 0.3); --surface-2: #f1ebdf; --shadow: 0 1px 2px rgb(60 40 20 / 0.06), 0 6px 18px rgb(60 40 20 / 0.08); }
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg) repeating-linear-gradient(90deg, rgb(255 255 255 / 0.14) 0 2px, transparent 2px 6px); font: 500 16px/1.8 "Lounge Sans", "Noto Sans JP", system-ui, sans-serif; }
main { max-width: 780px; margin: 0 auto; padding: 24px 18px 60px; }
a { color: var(--accent-text); }
nav.crumbs { font-size: 13px; color: var(--muted); }
nav.crumbs a { color: inherit; }
h1, h2, h3 { font-family: "Lounge Round", "M PLUS Rounded 1c", sans-serif; font-weight: 900; line-height: 1.35; }
h1 { font-size: clamp(26px, 5vw, 36px); margin: 12px 0 6px; }
.lead { margin: 0 0 18px; color: #5a5046; }
:lang(ja) { word-break: auto-phrase; }
h1, h2, h3, summary { text-wrap: balance; }
p, li, td, figure { text-wrap: pretty; }
/* The contents: numbered, a tap away. Folded at the top on a phone; on a wide screen open
   beside the page, staying in sight, the section being read lit (how-toc.js). */
.toc { margin: 0 0 8px; padding: 12px 14px; border-radius: 16px; background: #fffaf2; box-shadow: var(--shadow); }
.toc summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 4px; list-style: none; cursor: pointer; font: 900 17px/1.5 "Lounge Round", "M PLUS Rounded 1c", sans-serif; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: "+"; display: grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2); color: var(--accent-text); font-weight: 900; }
.toc[open] summary::after { content: "\2212"; }
.toc ol { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 4px; margin: 8px 0 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; }
.toc a { display: flex; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; color: var(--ink); font-weight: 800; font-size: 14px; text-decoration: none; transition: background 0.15s, color 0.15s; }
.toc a::before { content: counter(toc); display: grid; place-items: center; flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font: 900 12px "Lounge Round", sans-serif; }
.toc a:hover { background: var(--surface-2); }
.toc a[aria-current] { background: #e4eaf4; color: var(--accent-text); }
.to-toc { margin: 14px 0 0; text-align: right; font-size: 13px; }
.to-toc a { color: var(--muted); text-decoration: none; }
.to-toc a::before { content: "\2191  "; }
section { margin-top: 30px; padding: 20px 22px 18px; border-radius: 20px; background: #fffaf2; box-shadow: var(--shadow); scroll-margin-top: 14px; }
section > h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 22px; }
section > h2 .n { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 18px; }
h3 { margin: 18px 0 6px; font-size: 17px; }
p { margin: 0 0 10px; }
.point { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; background: #fdf0d8; font-weight: 700; font-size: 14.5px; }
.point::before { content: "ポイント　"; color: #c27a00; font-weight: 900; }
.muted { color: var(--muted); font-size: 14px; }
/* Little boards: a row of squares with its numbers, stitched where filled. */
.figs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 14px 22px; margin: 8px 0 12px; }
.figs figure { margin: 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.row { display: inline-flex; align-items: center; }
.row b { min-width: 46px; padding-right: 8px; text-align: right; font: 900 16px "Lounge Round", sans-serif; color: #5a4630; }
.row i, .grid i { position: relative; width: 28px; height: 28px; border: 1px solid var(--line); margin-left: -1px; background: var(--cloth); }
.row i.f::after, .grid i.f::after { content: ""; position: absolute; inset: 15%; background: linear-gradient(45deg, transparent 38%, #2f4a78 38% 62%, transparent 62%), linear-gradient(-45deg, transparent 38%, #4a64a0 38% 62%, transparent 62%); }
.row i.x::after, .grid i.x::after { content: ""; position: absolute; inset: 40%; border-radius: 50%; background: #b9a88f; }
.row i.p, .grid i.p { background: #dde6f5; }
.row b.done { opacity: 0.35; }
.arrow { font: 900 26px "Lounge Round", sans-serif; color: var(--accent); }
.nw { white-space: nowrap; }
.figs figcaption { max-width: 340px; margin: 4px auto 0; line-height: 1.55; }
.figs figure.ng figcaption { color: var(--red); }
/* Rows stacked under one another, each with a word above it (the overlap). */
.stack { display: grid; justify-items: start; gap: 2px; }
.stack .lbl { padding-left: 54px; font-size: 12.5px; }
.stack figcaption { margin-top: 8px; }
/* A board before and after: side by side, the arrow pointing on; stacked on a phone, the arrow pointing down. */
.flow { display: flex; align-items: flex-start; justify-content: center; gap: 10px 14px; margin: 8px 0 12px; }
.flow figure { margin: 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.flow figcaption { max-width: 220px; margin: 6px auto 0; line-height: 1.55; }
.flow-arrow { align-self: center; font: 900 24px "Lounge Round", sans-serif; color: var(--accent); }
/* A little whole board: the numbers on top and on the left, the line being looked at lit. */
.grid { display: inline-grid; grid-template-columns: auto repeat(5, 24px); align-items: center; }
.grid i { width: 24px; height: 24px; margin-top: -1px; }
.grid .c, .grid .r { font: 900 14px/1.2 "Lounge Round", sans-serif; color: #5a4630; }
.grid .c { align-self: end; padding-bottom: 4px; text-align: center; }
.grid .r { padding-right: 7px; text-align: right; white-space: nowrap; }
.grid .on { color: var(--red); }
@media (max-width: 640px) {
  .flow { flex-direction: column; align-items: center; }
  .flow-arrow { transform: rotate(90deg); }
}
.rules { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; counter-reset: rule; }
.rules li { counter-increment: rule; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.rules li::before { content: counter(rule); display: grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font: 900 14px "Lounge Round", sans-serif; }
.rules b { display: block; font-size: 16px; }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #ece4d6; text-align: left; vertical-align: top; }
thead th { font-size: 12.5px; color: var(--muted); }
tbody th { white-space: nowrap; font-family: "Lounge Round", sans-serif; font-weight: 900; }
.star { color: #e29b00; margin-right: 4px; }
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode { padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.mode h3 { margin: 0 0 4px; }
.mode ul { margin: 6px 0 0; padding-left: 1.2em; font-size: 14.5px; }
@media (max-width: 600px) { .modes { grid-template-columns: 1fr; } .row i { width: 24px; height: 24px; } }
@media (max-width: 400px) { .row i { width: 22px; height: 22px; } .row b { min-width: 40px; } .stack .lbl { padding-left: 48px; } }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: 10px; }
.steps li { counter-increment: step; position: relative; padding: 12px 14px 12px 54px; border-radius: 14px; border: 2px dashed rgb(196 70 70 / 0.25); }
.steps li::before { content: "STEP " counter(step); position: absolute; left: 10px; top: 14px; width: 38px; font: 900 10px/1.2 "Lounge Round", sans-serif; color: var(--red); text-align: center; }
.steps b { display: block; }
#faq details { border-bottom: 1px solid #ece4d6; padding: 10px 2px; }
#faq summary { cursor: pointer; font-weight: 800; list-style: none; }
#faq summary::before { content: "Q. "; color: var(--red); font-family: "Lounge Round", sans-serif; font-weight: 900; }
#faq details p { margin: 8px 0 0; padding-left: 1.8em; }
.play { display: block; margin: 30px auto 0; max-width: 360px; padding: 15px 20px; border-radius: 16px; background: var(--accent); color: #fff; text-align: center; text-decoration: none; font: 900 19px "Lounge Round", sans-serif; box-shadow: 0 4px 0 #1f3357; }
.practice { margin: 12px 0 0; text-align: center; font-size: 14px; }
.foot { margin-top: 26px; text-align: center; font-size: 13px; color: var(--muted); }
.foot a { color: inherit; margin: 0 6px; }
/* The page's layout. A phone: the contents folded at the top, a way back to them after each
   section. Wider: a figure beside what it says, short parts side by side. Wider still: the
   Lounge's rail beside the page, holding its contents. Every word stays on the page; only the contents fold. */
.guide-head, .guide-main { min-width: 0; }
@media (min-width: 700px) {
  .pair { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 26px; align-items: center; }
  .pair .figs { flex-direction: column; align-items: flex-start; margin: 0; }
  .pair > div > :last-child { margin-bottom: 0; }
  .rules { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (min-width: 960px) {
  /* The Lounge's rail (the hub's frame) stands left of the page, in the same place on every game,
     and holds its contents: the page's own contents, and the ways back to them, are a phone's. */
  main.lounge-body { max-width: none; margin: 0; padding: 28px 0 60px; }
  .guide-side, .to-toc { display: none; }
  /* The table of difficulty and the stars side by side. */
  .level { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 0 26px; align-items: start; }
  .level thead th { white-space: nowrap; }
  .level > p { margin: 0 !important; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
  /* The questions two to a row, each opening in its own column. */
  #faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 22px; align-items: start; }
  #faq > h2, #faq > .to-toc { grid-column: 1 / -1; }
}
.ad-slot { max-width: 728px; margin: 28px auto 0; }
@media print {
  .ad-slot, .guide-side, .to-toc, .lounge-rail { display: none !important; }
  .lounge-cols { display: block !important; max-width: none !important; padding: 0 !important; }
  main { max-width: none; }
  .guide { display: block; }
  section, .steps li, .mode { break-inside: avoid; }
}

/* ---- The pages under /nonogram/how (techniques.ts): a way worked on a board partway through ---- */
/* The board as it stands: the line looked at lit, its numbers red. */
.example { display: grid; gap: 10px 26px; justify-items: center; margin: 12px 0 14px; }
.ex-board { margin: 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--muted); }
.ex-board figcaption { max-width: 300px; margin: 6px auto 0; line-height: 1.55; }
.tb { display: block; width: min(100%, 300px); height: auto; margin: 0 auto; }
.tb-num text { font: 900 6px "Lounge Round", "M PLUS Rounded 1c", sans-serif; fill: #5a4630; text-anchor: middle; }
.tb-num text.on { fill: var(--red); }
.tb-cloth { fill: var(--cloth); }
.tb-lit { fill: #dde6f5; }
.tb-fill { stroke: #2f4a78; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.tb-fill2 { stroke: #4a64a0; stroke-width: 2.2; stroke-linecap: round; fill: none; }
.tb-dot circle { fill: #b9a88f; }
.tb-line { stroke: var(--line); stroke-width: 0.4; fill: none; }
.tb-five { stroke: rgb(120 96 64 / 0.6); stroke-width: 0.7; fill: none; }
.tb-edge { stroke: #8a7660; stroke-width: 0.8; fill: none; }
.tb-ring { stroke: var(--red); stroke-width: 1; fill: none; }
/* A column's squares upright, its numbers on top; before and after side by side even on a phone. */
.row.v { flex-direction: column; }
.row.v b { min-width: 0; padding: 0 0 6px; text-align: center; line-height: 1.15; }
.row.v i { margin-left: 0; margin-top: -1px; }
.flow.v { flex-direction: row; align-items: flex-start; }
.flow.v .flow-arrow { transform: none; align-self: center; }
.flow.v figcaption { max-width: 130px; }
@media (max-width: 640px) { .flow.v { flex-direction: row; align-items: flex-start; } .flow.v .flow-arrow { transform: none; } }
.ex-links { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; font-weight: 700; }
.ways { margin-top: 4px; }
.ways td:last-child { font-weight: 700; }
.ways td:first-child { width: 52%; }
.used { display: grid; gap: 8px; margin: 0 0 12px; padding: 0; list-style: none; }
.used li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); }
.used b { font-family: "Lounge Round", sans-serif; font-weight: 900; }
.used span { flex: 1 1 160px; color: var(--muted); font-size: 14px; }
.used a { font-size: 14px; font-weight: 700; }
/* The squares the way works out ringed in red; they shrink to fit a long line on a phone. */
.row.fit i { width: min(28px, calc((100vw - 150px) / var(--n))); height: min(28px, calc((100vw - 150px) / var(--n))); }
.row.fit i.p { background: var(--cloth); z-index: 1; outline: 2px solid var(--red); outline-offset: -2px; }
/* A row's line under the board, before above after; a column's beside it. */
.example.flat .flow { flex-direction: column; align-items: center; }
.example.flat .flow-arrow { transform: rotate(90deg); }
@media (min-width: 700px) {
  .example.up { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); align-items: center; }
}
.more-link { margin: 10px 0 18px; font-weight: 800; }
.tb-new { stroke: var(--red); stroke-width: 0.9; fill: none; }
.walk-board { margin: 12px 0 10px; text-align: center; }
.walk-board figcaption { max-width: 420px; margin: 6px auto 0; font-size: 13px; font-weight: 700; line-height: 1.55; color: var(--muted); }
.walk-uses { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; font-weight: 700; color: var(--muted); }
