@font-face{font-family:"Loops Serif";src:url(/assets/loops-serif.f3b4893a63.woff2) format("woff2");font-weight:400 700;font-display:swap}
@font-face{font-family:"Loops Serif KO";src:url(/assets/loops-serif-ko.54f347f7b4.woff2) format("woff2");font-weight:400 700;font-display:swap}
@font-face{font-family:"Loops Serif TC";src:url(/assets/loops-serif-zhtw.f8c23f6d1f.woff2) format("woff2");font-weight:400 700;font-display:swap}
@font-face{font-family:"Loops Serif JA";src:url(/assets/loops-serif-ja.1b06a9ba65.woff2) format("woff2");font-weight:400 700;font-display:swap}
/* loops-slitherlink.com — two-colour print: vermilion field, ink line, washi paper. */

:root {
  --shu: #CE3522;
  --shu-deep: #B72B1C;
  --shu-text: #A82618;
  --sumi: #161310;
  --paper: #FBF7EE;
  --paper-2: #F3EAD8;
  --washi: #F6ECD6;
  --on-shu: #FFF8EC;
  --muted: #5C554B;
  --rule: rgba(22, 19, 16, 0.14);
  --board-bg: #FFFCF5;
  --board-ink: #161310;
  --board-dot: #161310;
  --board-clue: #161310;
  --board-cross: #8E8576;
  --board-in: rgba(206, 53, 34, 0.16);
  --focus: #1F5FBF;
  --serif: "Loops Serif", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 72rem;
  --gutter: 1rem;
  --radius: 14px;
  color-scheme: light;
}

:lang(ko) {
  --serif: "Loops Serif", "Loops Serif KO", "AppleMyungjo", "Nanum Myeongjo", "Batang", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
}
:lang(zh-Hant) {
  --serif: "Loops Serif", "Loops Serif TC", "Songti TC", "PMingLiU", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", system-ui, sans-serif;
}
:lang(ja) {
  --serif: "Loops Serif", "Loops Serif JA", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --shu-text: #F0664F;
    --sumi: #EDE3CF;
    --paper: #17140F;
    --paper-2: #201B15;
    --muted: #A69C8C;
    --rule: rgba(237, 227, 207, 0.16);
    --board-bg: #201B15;
    --board-ink: #F6ECD6;
    --board-dot: #EDE3CF;
    --board-clue: #EDE3CF;
    --board-cross: #8D8476;
    --board-in: rgba(206, 53, 34, 0.30);
    --focus: #8DB4FF;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--sumi);
  font: 400 1.0625rem/1.65 var(--sans);
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
:lang(ko) body, :lang(zh-Hant) body, :lang(ja) body { line-height: 1.8; word-break: keep-all; overflow-wrap: anywhere; }
:lang(ja) body { word-break: normal; line-break: strict; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--shu-text); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.2em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.18; margin: 0 0 0.6em; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 1.35rem + 3.4vw, 3.6rem); letter-spacing: -0.015em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); }
h3 { font-size: 1.25rem; }
:lang(ko) h1, :lang(zh-Hant) h1, :lang(ja) h1 { letter-spacing: -0.02em; line-height: 1.25; }
:lang(ko) h2, :lang(zh-Hant) h2, :lang(ja) h2, :lang(ko) h3, :lang(zh-Hant) h3, :lang(ja) h3 { line-height: 1.35; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--sumi); color: var(--paper); padding: 0.6rem 1rem; border-radius: 8px; }
.skip:focus { top: 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
@media (min-width: 48rem) { :root { --gutter: 2rem; } }

/* ---------------------------------------------------------------- header */

.head { border-bottom: 1px solid var(--rule); background: var(--paper); }
.head__in { display: flex; align-items: center; gap: 0.75rem 1.25rem; flex-wrap: wrap; padding-block: 0.7rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: inherit; text-decoration: none; font: 600 1.45rem/1 var(--serif); letter-spacing: -0.01em; }
.brand svg { width: 30px; height: 30px; border-radius: 7px; }
.nav { order: 3; flex: 1 1 100%; display: flex; gap: 0.25rem 1.1rem; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--sumi); text-decoration: none; white-space: nowrap; padding-block: 0.35rem; font-size: 0.95rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { border-bottom-color: var(--shu); }
.head__end { margin-left: auto; display: flex; align-items: center; gap: 0.6rem; }
@media (min-width: 60rem) {
  .nav { order: 0; flex: 0 1 auto; margin: 0 0 0 1rem; padding: 0; }
}

.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.45rem 0.7rem; border: 1px solid var(--rule); border-radius: 999px; font-size: 0.9rem; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary svg { width: 16px; height: 16px; }
.lang ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; list-style: none; margin: 0; padding: 0.4rem; min-width: 11rem; background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 12px 30px rgba(22, 19, 16, 0.12); }
.lang li a { display: block; padding: 0.45rem 0.7rem; border-radius: 8px; color: var(--sumi); text-decoration: none; }
.lang li a:hover, .lang li a[aria-current="true"] { background: var(--paper-2); }

/* ---------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; gap: 0.7rem;
  padding: 0.7rem 1.15rem 0.7rem 0.7rem; border-radius: 16px;
  background: var(--sumi); color: var(--paper); text-decoration: none; line-height: 1.2;
  border: 0; cursor: pointer;
}
.btn:hover { text-decoration: none; filter: brightness(1.12); }
.btn img, .btn svg { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.btn__txt { display: grid; }
.btn__txt small { font-size: 0.78rem; opacity: 0.8; }
.btn__txt strong { font-size: 1.05rem; font-weight: 650; }
.btn--sm { padding: 0.45rem 0.85rem; border-radius: 999px; font-size: 0.9rem; font-weight: 600; }
.btn--light { background: var(--on-shu); color: #161310; }
.btn--line { background: transparent; color: inherit; border: 1.5px solid currentColor; padding: 0.7rem 1.2rem; border-radius: 16px; font-weight: 600; }
@media (prefers-color-scheme: dark) {
  .btn { background: #F6ECD6; color: #161310; }
  .btn--light { background: #FFF8EC; }
  .btn--line { background: transparent; color: inherit; }
}

/* ---------------------------------------------------------------- hero */

.hero { background: var(--shu); color: var(--on-shu); position: relative; overflow: hidden; }
.hero a:not(.btn) { color: var(--on-shu); }
.hero__in { display: grid; gap: 2rem; padding-block: clamp(2.4rem, 6vw, 5rem); align-items: center; }
@media (min-width: 56rem) { .hero__in { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 3.5rem; } }
.hero h1 { color: var(--on-shu); margin-bottom: 0.45em; }
.hero__lede { font-size: clamp(1.06rem, 1rem + 0.35vw, 1.22rem); max-width: 34em; }
.hero__ctas { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; align-items: center; }
.hero__note { margin-top: 1rem; font-size: 0.92rem; opacity: 0.92; }
.hero__board { justify-self: center; width: min(100%, 26rem); }
.hero__board .puzzle__hint { color: var(--on-shu); }

/* ---------------------------------------------------------------- claims strip */

.claims { border-bottom: 1px solid var(--rule); }
.claims ul { list-style: none; margin: 0; padding: 1.4rem 0; display: grid; gap: 1rem 2rem; grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr)); }
.claims li { display: grid; gap: 0.15rem; }
.claims strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; }
.claims span { color: var(--muted); font-size: 0.95rem; }

/* ---------------------------------------------------------------- sections */

.sec { padding-block: clamp(3.2rem, 7vw, 6rem); }
.sec--paper2 { background: var(--paper-2); }
.sec--ink { background: #161310; color: #F6ECD6; }
.sec--ink a { color: #F6ECD6; }
.sec--shu { background: var(--shu); color: var(--on-shu); }
.sec--shu a:not(.btn) { color: var(--on-shu); }
.sec__head { max-width: 42rem; margin-bottom: 2.2rem; }
.sec__head p { color: var(--muted); font-size: 1.08rem; }
.sec--ink .sec__head p, .sec--shu .sec__head p { color: inherit; opacity: 0.9; }
.more { font-weight: 600; }

/* rules: three figures */
.rules { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); counter-reset: rule; }
.rule { margin: 0; }
.rule svg { width: 100%; max-width: 13rem; height: auto; margin-bottom: 1rem; }
.rule svg.wide { max-width: 19rem; }
.rule h3 { display: flex; gap: 0.6rem; align-items: baseline; }
.rule h3::before { counter-increment: rule; content: counter(rule); font: 600 1rem/1 var(--serif); color: var(--shu-text); border: 1.5px solid currentColor; border-radius: 50%; width: 1.7rem; height: 1.7rem; display: inline-grid; place-items: center; flex: none; transform: translateY(-0.1em); }
.rule p { color: var(--muted); }

/* play previews */
.levels { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.level { display: grid; gap: 0.9rem; color: inherit; text-decoration: none; }
.level svg { width: 100%; height: auto; border-radius: var(--radius); background: var(--board-bg); border: 1px solid var(--rule); transition: transform 0.2s ease; }
.level:hover svg { transform: translateY(-3px); }
.level strong { font: 600 1.2rem/1.25 var(--serif); }
.level span { color: var(--muted); }

/* screenshots */
.shots { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 1rem; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: thin; }
.shots figure { margin: 0; flex: 0 0 auto; width: clamp(11rem, 42vw, 15rem); scroll-snap-align: start; }
.shots img { border-radius: 18px; border: 1px solid var(--rule); aspect-ratio: 1320 / 2868; object-fit: cover; width: 100%; background: var(--paper-2); }
.shots figcaption { font-size: 0.9rem; color: var(--muted); margin-top: 0.5rem; }

.features { display: grid; gap: 1.6rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 2.5rem 0 0; }
.features div { border-top: 2px solid var(--sumi); padding-top: 0.8rem; }
.features dt { font: 600 1.15rem/1.3 var(--serif); margin-bottom: 0.35rem; }
.features dd { margin: 0; color: var(--muted); }

/* music band */
.music { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 56rem) { .music { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.music h2 { color: #F6ECD6; }
.music__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.6rem; }
.music__list li { display: flex; gap: 0.8rem; align-items: baseline; border-bottom: 1px solid rgba(246, 236, 214, 0.18); padding-bottom: 0.6rem; }
.music__list b { font-family: var(--serif); font-weight: 600; min-width: 7.5rem; }
.music__list span { opacity: 0.85; }

/* pictures teaser */
.pics { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 56rem) { .pics { grid-template-columns: 1fr 1fr; gap: 4rem; } }
.pics img { border-radius: var(--radius); border: 1px solid var(--rule); background: var(--board-bg); }

/* free vs full */
.offer { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.offer section { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.4rem 1.5rem; background: var(--paper); }
.offer section:last-child { border: 2px solid var(--sumi); }
.offer h3 { margin-bottom: 0.4rem; }
.offer ul { margin: 0.8rem 0 0; color: var(--muted); }

/* faq */
.faq { max-width: 46rem; }
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary { cursor: pointer; list-style: none; padding: 1.05rem 2.2rem 1.05rem 0; position: relative; font: 600 1.12rem/1.4 var(--serif); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; position: absolute; right: 0.4rem; top: 1.35rem; width: 0.7rem; height: 0.7rem; border-right: 2px solid var(--sumi); border-bottom: 2px solid var(--sumi); transform: rotate(45deg); transition: transform 0.2s ease; }
.faq details[open] summary::after { transform: rotate(-135deg); top: 1.6rem; }
.faq details p { color: var(--muted); padding-right: 1rem; }

/* final call to action */
.final { display: grid; gap: 1.6rem; justify-items: start; }
@media (min-width: 56rem) { .final { grid-template-columns: auto 1fr; align-items: center; gap: 2.5rem; } }
.final__icon { width: 120px; height: 120px; border-radius: 27px; box-shadow: 0 18px 40px rgba(60, 10, 4, 0.35); }
.final h2 { color: var(--on-shu); margin-bottom: 0.3em; }

/* ---------------------------------------------------------------- long pages */

.crumbs { font-size: 0.9rem; color: var(--muted); padding-top: 1.2rem; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.crumbs li + li::before { content: "/"; margin-right: 0.4rem; opacity: 0.6; }
.crumbs a { color: inherit; }
.page-head { padding-block: 1.4rem clamp(2rem, 5vw, 3.5rem); max-width: 48rem; }
.page-head p { font-size: clamp(1.06rem, 1rem + 0.35vw, 1.22rem); color: var(--muted); }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 2.4em; }
.prose h3 { margin-top: 1.8em; }
.prose li { margin-bottom: 0.4em; }
.toc { border: 1px solid var(--rule); border-radius: var(--radius); padding: 1.1rem 1.4rem; margin: 0 0 2.5rem; max-width: 44rem; background: var(--paper); }
.toc h2 { font-size: 1.1rem; margin: 0 0 0.6rem; }
.toc ol { columns: 2 14rem; column-gap: 2rem; margin: 0; }
.toc li { break-inside: avoid; margin-bottom: 0.25rem; }

.tech { display: grid; gap: 1.2rem 2rem; padding-block: 2rem; border-top: 1px solid var(--rule); align-items: start; }
@media (min-width: 44rem) { .tech { grid-template-columns: 12.5rem 1fr; } }
.tech svg { width: 100%; max-width: 12.5rem; height: auto; }
.tech h2 { font-size: clamp(1.35rem, 1.15rem + 0.8vw, 1.7rem); margin-top: 0; }
.tech p { margin-bottom: 0.8em; }
.tech .why { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1.4rem; font-size: 0.92rem; color: var(--muted); margin: 0 0 1.5rem; padding: 0; list-style: none; }
.legend li { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend svg { width: 26px; height: 14px; }

.steps { display: grid; gap: 1.6rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { margin: 0; }
.steps svg { width: 100%; max-width: 11rem; height: auto; margin-bottom: 0.8rem; }
.steps h3 { font-size: 1.08rem; margin-bottom: 0.35rem; }
.steps p { color: var(--muted); font-size: 0.98rem; }

.names { width: 100%; border-collapse: collapse; margin: 1rem 0 2rem; font-size: 0.98rem; }
.names th, .names td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.names th { font-weight: 600; color: var(--muted); font-size: 0.9rem; }

.aside-cta { display: grid; gap: 1rem; border: 2px solid var(--sumi); border-radius: var(--radius); padding: 1.4rem 1.5rem; margin: 3rem 0 0; max-width: 44rem; }
@media (min-width: 40rem) { .aside-cta { grid-template-columns: 1fr auto; align-items: center; } }
.aside-cta p { margin: 0; }
.aside-cta strong { font-family: var(--serif); font-size: 1.2rem; display: block; margin-bottom: 0.2rem; }

/* ---------------------------------------------------------------- boards */

.puzzle { display: grid; gap: 0.9rem; }
.puzzle__board { position: relative; }
.board-svg { width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; cursor: pointer; border-radius: var(--radius); background: var(--board-bg); border: 1px solid var(--rule); }
.board-svg:focus { outline: none; }
.board-svg:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.b-clue { font: 600 22px var(--serif); fill: var(--board-clue); transition: opacity 0.2s ease, fill 0.2s ease; }
.b-clue.done { opacity: 0.32; }
.b-clue.over { fill: var(--shu); opacity: 1; }
.is-solved .b-clue, .is-solved .b-clue.done { opacity: 1; }
.b-dot { fill: var(--board-dot); transform-box: fill-box; transform-origin: center; transition: transform 0.15s ease; }
.b-dot.bad { fill: var(--shu); transform: scale(1.9); }
.b-line { stroke: var(--board-ink); stroke-width: 6; stroke-linecap: round; opacity: 0; transition: opacity 0.08s linear; }
.b-line.on { opacity: 1; }
.b-cross { stroke: var(--board-cross); stroke-width: 2.2; stroke-linecap: round; fill: none; opacity: 0; }
.b-cross.on { opacity: 1; }
.b-line.is-wrong, .b-cross.is-wrong { opacity: 1; stroke: var(--shu); animation: fade-out 1.4s ease forwards; }
.b-line.is-hint { stroke: var(--shu); animation: settle 1.4s ease forwards; }
.b-in { fill: var(--board-in); animation: wash 0.5s ease both; }
.b-cursor { fill: none; stroke: var(--focus); stroke-width: 2.5; opacity: 0; pointer-events: none; }
.board-svg:focus-visible .b-cursor { opacity: 1; }
@keyframes fade-out { 0%, 55% { opacity: 1; } 100% { opacity: 0; } }
@keyframes settle { 0%, 50% { stroke: var(--shu); } 100% { stroke: var(--board-ink); } }
@keyframes wash { from { opacity: 0; } to { opacity: 1; } }

/* the hero board is the app icon: washi dots and numbers on vermilion, ink loop */
.puzzle--shu .board-svg { background: transparent; border: 2px solid rgba(255, 248, 236, 0.35); }
.puzzle--shu .b-clue { fill: var(--washi); font-size: 24px; }
.puzzle--shu .b-clue.done { opacity: 0.45; }
.puzzle--shu .b-clue.over { fill: #161310; }
.puzzle--shu .b-dot { fill: var(--washi); }
.puzzle--shu .b-dot.bad { fill: #161310; }
.puzzle--shu .b-line { stroke: #161310; stroke-width: 11; }
.puzzle--shu .b-cross { stroke: rgba(255, 248, 236, 0.7); }
.puzzle--shu .b-line.is-hint { stroke: var(--washi); }
.puzzle--shu .b-line.is-wrong, .puzzle--shu .b-cross.is-wrong { stroke: var(--washi); }
.puzzle--shu .b-in { fill: var(--shu-deep); }
.puzzle--shu.is-solved .board-svg { border-color: transparent; }
.puzzle--shu.is-solved .b-clue, .puzzle--shu.is-solved .b-clue.done { opacity: 1; }
.puzzle--shu .puzzle__bar button { color: var(--on-shu); border-color: rgba(255, 248, 236, 0.55); }

.puzzle__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.puzzle__bar button { background: transparent; color: var(--sumi); border: 1.5px solid var(--rule); border-radius: 999px; padding: 0.45rem 0.95rem; cursor: pointer; font-size: 0.92rem; }
.puzzle__bar button:hover { border-color: currentColor; }
.puzzle__time { margin-left: auto; font: 600 1.05rem/1 var(--serif); font-variant-numeric: tabular-nums; }
.puzzle__hint { font-size: 0.92rem; color: var(--muted); margin: 0; }
.puzzle__status { min-height: 1.5em; font-size: 0.95rem; margin: 0; }
.puzzle.is-solved .puzzle__bar [data-action="hint"], .puzzle.is-solved .puzzle__bar [data-action="undo"] { display: none; }
.puzzle.is-solved .puzzle__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.puzzle:not(.is-live) .puzzle__bar { display: none; }

.win { border-radius: var(--radius); padding: 1.2rem 1.3rem; background: var(--sumi); color: var(--paper); display: grid; gap: 0.8rem; }
.win[hidden] { display: none; }
.win h3 { color: inherit; margin: 0; }
.win p { margin: 0; opacity: 0.9; }
.win .btn { background: var(--shu); color: #FFF8EC; }
.win__row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.win__row button, .win__row a.next { background: transparent; color: inherit; border: 1.5px solid rgba(251, 247, 238, 0.45); border-radius: 999px; padding: 0.5rem 1rem; cursor: pointer; text-decoration: none; font-size: 0.95rem; }
@media (prefers-color-scheme: dark) {
  .win { background: #F6ECD6; color: #161310; }
  .win__row button, .win__row a.next { border-color: rgba(22, 19, 16, 0.4); }
}
.puzzle--shu .win { background: #161310; color: #FFF8EC; }

/* play page */
.tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tabs button { cursor: pointer; border: 1.5px solid var(--rule); background: var(--paper); color: var(--sumi); border-radius: 999px; padding: 0.55rem 1.1rem; display: grid; text-align: left; line-height: 1.25; }
.tabs button small { color: var(--muted); font-size: 0.8rem; }
.tabs button[aria-selected="true"] { border-color: var(--sumi); background: var(--sumi); color: var(--paper); }
.tabs button[aria-selected="true"] small { color: inherit; opacity: 0.8; }
.play { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 60rem) { .play { grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); gap: 3.5rem; } }
.play__side h2 { font-size: 1.35rem; }
.play__side ol { color: var(--muted); }
.kbd { font-size: 0.88rem; color: var(--muted); }

/* language hint */
.lang-hint { background: var(--sumi); color: var(--paper); font-size: 0.92rem; }
.lang-hint[hidden] { display: none; }
.lang-hint .wrap { display: flex; gap: 1rem; align-items: center; justify-content: center; padding-block: 0.5rem; }
.lang-hint a { color: inherit; font-weight: 600; }
.lang-hint button { background: transparent; color: inherit; border: 0; cursor: pointer; font-size: 1.2rem; line-height: 1; padding: 0.2rem 0.4rem; }

/* ---------------------------------------------------------------- footer */

.foot { border-top: 1px solid var(--rule); padding-block: 2.5rem 3rem; font-size: 0.92rem; color: var(--muted); }
.foot__grid { display: grid; gap: 1.8rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.foot h2 { font: 600 1rem/1.3 var(--serif); color: var(--sumi); margin-bottom: 0.6rem; }
.foot ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.35rem; }
.foot a { color: inherit; }
.foot__small { margin-top: 2rem; font-size: 0.85rem; }

/* ---------------------------------------------------------------- 404 */
.nf { padding-block: 5rem; max-width: 40rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .head, .foot, .hero__ctas, .puzzle__bar, .win, .lang-hint { display: none !important; }
  .hero { background: none; color: #000; }
}

/* ---------------------------------------------------------------- articles */

.article { max-width: 46rem; }
.article .page-head { max-width: none; }
.article__meta { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; font-size: 0.92rem; color: var(--muted); }
.article__figure, .article__fig { margin: 0 0 2rem; }
.article__figure svg, .article__fig svg { max-width: 15rem; height: auto; }
.article__fig .pics__pair svg { max-width: none; }
.article__fig figcaption { font-size: 0.92rem; color: var(--muted); margin-top: 0.6rem; }
.article__body h2 { margin-top: 2.2em; scroll-margin-top: 1rem; }
.article__body h3 { margin-top: 1.6em; }
.article__body table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.article__body th, .article__body td { text-align: left; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.article__body th { color: var(--muted); font-weight: 600; font-size: 0.9rem; }
.table-wrap { overflow-x: auto; margin: 1.2rem 0 1.6rem; }
.related { margin-top: 3rem; }
.related h2 { font-size: 1.35rem; }

.cards { list-style: none; padding: 0; margin: 0 0 2.5rem; display: grid; gap: 1.2rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.related ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.cards a, .related a { display: grid; gap: 0.5rem; height: 100%; padding: 1.2rem 1.3rem; border: 1px solid var(--rule); border-radius: var(--radius); color: inherit; text-decoration: none; background: var(--paper); }
.cards a:hover, .related a:hover { border-color: var(--sumi); }
.cards svg { width: 100%; max-width: 9rem; height: auto; }
.cards strong, .related strong { font: 600 1.18rem/1.3 var(--serif); }
.cards span, .related span { color: var(--muted); font-size: 0.95rem; }
.cards em { font-style: normal; color: var(--shu-text); font-weight: 600; font-size: 0.95rem; }
.cards--tools a { background: var(--paper-2); }

/* ---------------------------------------------------------------- solver */

.solver { display: grid; gap: 0.9rem; }
.solver__bar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.solver__bar label { display: inline-flex; gap: 0.4rem; align-items: center; font-size: 0.95rem; color: var(--muted); }
.solver__bar select { font: inherit; padding: 0.35rem 0.5rem; border-radius: 8px; border: 1.5px solid var(--rule); background: var(--paper); color: var(--sumi); }
.btn--ghost { background: transparent; color: var(--sumi); border: 1.5px solid var(--rule); border-radius: 999px; padding: 0.45rem 0.95rem; cursor: pointer; font-size: 0.92rem; }
.btn--ghost:hover { border-color: currentColor; }
.solver .btn--sm[disabled] { opacity: 0.5; cursor: progress; }
.solver-svg { cursor: pointer; }
.s-cell { fill: transparent; }
.s-cell:hover { fill: rgba(206, 53, 34, 0.08); }
.s-cell.sel { fill: rgba(31, 95, 191, 0.10); stroke: var(--focus); stroke-width: 1.5; }

/* ---------------------------------------------------------------- printable */

.sheet { display: grid; gap: 2rem 2.5rem; grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); margin: 2rem 0 1rem; }
.sheet__item { margin: 0; break-inside: avoid; }
.sheet__item figcaption { margin-bottom: 0.6rem; display: flex; gap: 0.6rem; align-items: baseline; }
.sheet__item figcaption strong { font: 600 1.1rem/1.2 var(--serif); }
.sheet__item figcaption span { color: var(--muted); font-size: 0.92rem; }
.sheet__item svg { width: 100%; height: auto; }
.sheet__url { font-size: 0.85rem; color: var(--muted); }
.answers { margin: 2rem 0; border-top: 1px solid var(--rule); padding-top: 1rem; }
.answers summary { cursor: pointer; font: 600 1.15rem/1.4 var(--serif); }
.answers h2 { font-size: 1.4rem; margin-top: 1.2rem; }
.sheet--answers svg { max-width: 14rem; }

@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000 !important; }
  .no-print, .crumbs, .aside-cta, .answers summary { display: none !important; }
  .page-head p { color: #333 !important; }
  .sheet { grid-template-columns: 1fr 1fr; gap: 10mm; }
  .print-board .d-bg { fill: #fff; stroke: #999; }
  .print-board .d-dot, .print-board .d-clue { fill: #000; }
  .print-board .d-line { stroke: #000; }
  .answers { display: block; break-before: page; border: 0; }
  .answers > h2 { display: block; }
  .answers .sheet--answers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; }
}

.more-row { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; margin-top: 1.8rem; }

/* ---------------------------------------------------------------- QR codes */

.qr { display: block; width: 100%; height: auto; image-rendering: pixelated; }
.print-promo { display: grid; grid-template-columns: 7.5rem 1fr auto; gap: 1.2rem; align-items: center; border: 2px solid var(--sumi); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.5rem 0 2.5rem; background: var(--paper); break-inside: avoid; }
.print-promo .qr { border-radius: 6px; }
.print-promo__txt { display: grid; gap: 0.3rem; }
.print-promo__txt strong { font: 600 1.25rem/1.25 var(--serif); }
.print-promo__txt span { color: var(--muted); }
.print-promo__url { font-size: 0.85rem; }
.print-promo__icon { width: 64px; height: 64px; border-radius: 15px; }
.print-only { display: none; }
@media (max-width: 40rem) { .print-promo { grid-template-columns: 6rem 1fr; } .print-promo__icon { display: none; } }

.qr-desk { display: none; }
@media (min-width: 64rem) and (hover: hover) {
  .qr-desk { display: flex; gap: 0.9rem; align-items: center; max-width: 22rem; font-size: 0.9rem; color: var(--muted); }
  .qr-desk .qr { width: 96px; flex: none; border-radius: 6px; }
  .aside-cta .qr-desk { grid-column: 1 / -1; }
  .qr-desk--shu { color: var(--on-shu); }
  .final { grid-template-columns: auto 1fr auto; }
}

@media print {
  .print-only { display: grid !important; }
  .print-promo { grid-template-columns: 30mm 1fr 18mm; border: 1.5px solid #000; background: #fff; margin: 6mm 0 0; padding: 4mm 5mm; }
  .print-promo .qr { width: 30mm; }
  .print-promo__txt strong { font-size: 13pt; color: #000; }
  .print-promo__txt span { color: #333; font-size: 9.5pt; }
  .print-promo__icon { width: 18mm; height: 18mm; }
  .print-promo--small { grid-template-columns: 22mm 1fr 14mm; }
  .print-promo--small .qr { width: 22mm; }
  .sheet--next { break-before: page; gap: 5mm 10mm; margin-top: 0; }
  .sheet--next .sheet__item svg { width: auto; max-width: 100%; max-height: 92mm; margin: 0 auto; display: block; }
  .sheet--next + .print-promo { margin-top: 4mm; }
  .qr-desk { display: none !important; }
}

/* Static figures: rule diagrams, steps, patterns, previews, the picture puzzle. */

.diag, .pic { width: 100%; height: auto; }
.d-bg { fill: var(--board-bg); stroke: var(--rule); stroke-width: 1; }
.d-clue { font: 600 22px var(--serif); fill: var(--board-clue); }
.d-dot { fill: var(--board-dot); }
.d-line { stroke: var(--board-ink); stroke-width: 5; stroke-linecap: round; }
.d-new { stroke: var(--shu); stroke-width: 5; stroke-linecap: round; }
.d-x { stroke: var(--board-cross); stroke-width: 2.2; stroke-linecap: round; fill: none; }
.d-newx { stroke: var(--shu); stroke-width: 2.8; stroke-linecap: round; fill: none; }
.d-in { fill: var(--board-in); }
.d-hot { fill: none; stroke: var(--shu); stroke-width: 2; }
.d-ray { stroke: var(--shu); stroke-width: 2; stroke-dasharray: 5 5; fill: none; }
.d-ray-dot { fill: var(--shu); }
.d-ok { stroke: #2E7D4F; stroke-width: 3.5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-bad { stroke: var(--shu); stroke-width: 3.5; fill: none; stroke-linecap: round; }
@media (prefers-color-scheme: dark) { .d-ok { stroke: #7BC79A; } }

.preview .d-clue { font-size: 21px; }
.levels .diag { max-width: none; }

.p-clue { font: 600 11px var(--serif); fill: var(--board-clue); }
.p-faint { opacity: 0.28; }
.p-dot { fill: var(--board-dot); opacity: 0.55; }
.p-in { fill: var(--shu); opacity: 0.9; }
.p-loop { stroke: var(--board-ink); stroke-width: 2.6; stroke-linecap: round; fill: none; }

.pics__pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.8rem; align-items: center; }
.pics__pair svg { border-radius: var(--radius); }
.pics__arrow { width: 28px; height: 28px; color: var(--shu-text); }
