/* Follows the live coil.win styles.css: ink #141047, sky #f2faff, VT323 body,
   Silkscreen headings, 2px ink panels with hard shadows, cut-corner pixel buttons. */
:root {
  --ink: #141047;
  --text: #141047;
  --muted: #737caf;
  --hint: #677bac;
  --page: #f2faff;
  --panel: #f5fbff;
  --line: #141047;
  --soft: #14104722;
  --blue: #2465f6;
  --focus: #2867ff;
  --shadow: 8px 8px 0 #1410471f;
  --shadow-sm: 5px 5px 0 #14104717;
  --up: #087b4b;
  --down: #bb2f3b;
  --sky: linear-gradient(180deg, #6bbfff 0%, #9bd8ff 62%, #daf4ff 100%);
  --pad: clamp(22px, 3.8vw, 56px);
  --body: 24px;
  --small: 20px;
  --font: "VT323", "PingFang SC", "Noto Sans SC", monospace;
  --brand: "Silkscreen", monospace;
  /* Reading text: pixel fonts stay on chrome (header, buttons, labels, numbers); paragraphs use a plain face. */
  /* Reading text: Inter for Latin, Source Han Sans (Noto Sans SC) for Chinese; PingFang SC / Microsoft YaHei as fallbacks. */
  --read: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --read-size: 16.5px;
  --page-end: #e9f5e6;
  --haze: #eaf6e4;
  color-scheme: light;
}
html[data-theme="dark"] {
  --text: #eaf4ff;
  --muted: #8f9bd0;
  --hint: #8f9bd0;
  --page: #0f0d33;
  --panel: #17144a;
  --line: #c9d8ff;
  --soft: #c9d8ff2b;
  --blue: #8fb7ff;
  --focus: #8fb7ff;
  --shadow: 8px 8px 0 #00000066;
  --shadow-sm: 5px 5px 0 #0000004d;
  --up: #64d9a4;
  --down: #ff8994;
  --sky: linear-gradient(180deg, #141047 0%, #26327c 62%, #3b5aa8 100%);
  --page-end: #0f1c2c;
  --haze: #13243a;
  color-scheme: dark;
}
/* VT323 has no Chinese glyphs: Chinese falls back to the system face at a smaller size. */
html[lang="zh"] {
  --body: 16px;
  --small: 14px;
  --read-size: 16px;
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: var(--body);
  line-height: 1.3;
}
html[data-theme="dark"] body {
  background: var(--page);
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 5px;
}
[hidden] {
  display: none !important;
}
p {
  margin: 0;
}
.wrap {
  width: min(1080px, 100%);
  margin: 0 auto;
  padding: 0 var(--pad);
}
.narrow {
  width: min(820px, 100%);
}
.muted {
  color: var(--muted);
}
.link {
  color: var(--blue);
}
.link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.proto-strip {
  position: fixed;
  z-index: 50;
  left: 12px;
  bottom: 12px;
  max-width: calc(100vw - 24px);
  font-size: 17px;
  color: var(--hint);
  padding: 3px 10px;
  background: var(--panel);
  border: 2px solid var(--soft);
  pointer-events: none;
}
html[lang="zh"] .proto-strip {
  font-size: 13px;
}

/* Header: same composition as coil.win */
.header {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px var(--pad);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 2px solid transparent;
  transition:
    background 0.2s,
    padding 0.2s,
    border-color 0.2s;
}
.header.scrolled {
  padding-top: 10px;
  padding-bottom: 10px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom-color: var(--soft);
}
html[data-theme="dark"] .header.scrolled {
  background: rgba(15, 13, 51, 0.9);
}
.crumbs-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-size: 24px;
}
html[lang="zh"] .crumbs-nav {
  font-size: 16px;
}
.crumbs-nav .sep {
  color: var(--muted);
}
.crumbs-nav a:not(.brand) {
  color: var(--muted);
}
.crumbs-nav a:not(.brand):hover {
  color: var(--blue);
}
.crumbs-nav .here {
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 32ch;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 22px;
}
html[lang="zh"] .icon-btn {
  font-family: "VT323", monospace;
  font-size: 22px;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}
.icon-btn:hover {
  color: var(--blue);
}
.header a,
.header button {
  pointer-events: auto;
}
.brand {
  display: block;
}
.brand img {
  display: block;
  width: 122px;
  height: 44px;
  image-rendering: pixelated;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}
.header-actions .download {
  margin-left: 8px;
  min-height: 44px;
  padding: 6px 22px;
  font-size: 23px;
}
.header .menu-toggle {
  display: none;
}
.pixel-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 8px 25px;
  min-height: 48px;
  font-size: 25px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  clip-path: polygon(
    8px 0,
    calc(100% - 8px) 0,
    calc(100% - 8px) 3px,
    calc(100% - 3px) 3px,
    calc(100% - 3px) 8px,
    100% 8px,
    100% calc(100% - 8px),
    calc(100% - 3px) calc(100% - 8px),
    calc(100% - 3px) calc(100% - 3px),
    calc(100% - 8px) calc(100% - 3px),
    calc(100% - 8px) 100%,
    8px 100%,
    8px calc(100% - 3px),
    3px calc(100% - 3px),
    3px calc(100% - 8px),
    0 calc(100% - 8px),
    0 8px,
    3px 8px,
    3px 3px,
    8px 3px
  );
}
html[lang="zh"] .pixel-button {
  font-size: 18px;
}
.pixel-button.primary {
  color: #fff;
  background: linear-gradient(#2875ff, #2465f6) padding-box;
  box-shadow:
    inset 0 0 0 3px #141047,
    inset 0 5px 0 #8fb7ff;
}
.pixel-button.plain {
  color: #141047;
  background: #f5fbff;
  box-shadow:
    inset 0 0 0 3px #141047,
    inset 0 5px 0 #ffffff;
}
.pixel-button:hover {
  filter: brightness(1.08);
}
.pixel-button.small {
  min-height: 40px;
  padding: 4px 16px;
  font-size: 21px;
}
html[lang="zh"] .pixel-button.small {
  font-size: 15px;
}
.menu-toggle {
  width: 32px;
  height: 40px;
  padding: 9px 2px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.menu-toggle span {
  height: 2px;
  width: 26px;
  background: var(--ink);
  transition:
    transform 0.2s,
    opacity 0.2s;
}
html[data-theme="dark"] .menu-toggle span {
  background: #eaf4ff;
}
.menu-toggle[aria-expanded="true"] span:first-child {
  transform: translateY(10px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:last-child {
  transform: translateY(-10px) rotate(-45deg);
}
.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: var(--pad);
  z-index: 35;
  width: 290px;
  padding: 18px 24px;
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.menu a,
.menu button {
  display: block;
  width: 100%;
  padding: 12px 0;
  border: 0;
  background: transparent;
  font-size: 25px;
  text-align: left;
}
html[lang="zh"] .menu a,
html[lang="zh"] .menu button {
  font-size: 18px;
}
.menu a:hover,
.menu button:hover {
  color: var(--blue);
}
.menu span {
  color: var(--muted);
  padding-right: 12px;
  font-size: 19px;
}
html[lang="zh"] .menu span {
  font-size: 14px;
}
.menu hr {
  border: 0;
  border-top: 2px solid var(--soft);
  margin: 6px 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}
h1,
h2,
h3 {
  margin: 0;
  font-weight: 700;
}
.title {
  font-family: var(--brand);
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -2px;
  line-height: 1.05;
}
html[lang="zh"] .title {
  font-family: var(--font);
  font-weight: 800;
  letter-spacing: 0;
}
.lead {
  font-size: 28px;
  margin-top: 14px;
  max-width: 30ch;
}
html[lang="zh"] .lead {
  font-size: 20px;
  line-height: 1.6;
}
.snek {
  position: absolute;
  background: url("/assets/coil-poses-v2.png") 0 100% / 200% 200% no-repeat;
  image-rendering: pixelated;
}
.snek.sleep {
  background-position: 0 0;
}
.snek.jump {
  background-position: 100% 100%;
}
/* Story panels (coil.win dialogs) */
.story {
  border: 2px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.section {
  padding: 72px 0 0;
}
.h2 {
  font-family: var(--brand);
  font-size: 28px;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 22px;
}
html[lang="zh"] .h2 {
  font-family: var(--font);
  font-size: 24px;
  letter-spacing: 0;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

/* Evidence badge */
.lv {
  font-variant-numeric: tabular-nums;
  display: inline-grid;
  place-items: center;
  height: 28px;
  padding: 0 7px;
  font-family: var(--brand);
  font-size: 15px;
  font-weight: 700;
  border: 2px solid var(--line);
  line-height: 1;
  vertical-align: 2px;
}
.lv-0 {
  border-style: dashed;
  color: var(--muted);
}
.lv-2 {
  background: #2465f6;
  color: #fff;
  border-color: #141047;
}
.lv-3 {
  background: var(--text);
  color: var(--page);
}
.ev {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: var(--small);
  color: var(--muted);
}
.ev span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ex {
  color: var(--down);
}

/* Sky is a short band at the top. It fades out; the rest of the page stays the plain page color. */
.sky-top {
  position: relative;
  overflow: hidden;
  padding: 150px 0 56px;
  background: transparent;
}
.sky-top::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 280px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    #7cc8ff 0%,
    #a9dcff 40%,
    #e9f6ff 72%,
    #fff 100%
  );
}
html[data-theme="dark"] .sky-top::before {
  background: linear-gradient(
    180deg,
    #141047 0%,
    #1f2a6e 46%,
    #172058 74%,
    var(--page) 100%
  );
}
.sky-top .cloud {
  position: absolute;
  z-index: 1;
  image-rendering: pixelated;
  pointer-events: none;
  animation: drift 90s linear infinite alternate;
}
.sky-top .c1 {
  width: 190px;
  top: 70px;
  right: 42%;
}
.sky-top .c2 {
  width: 150px;
  top: 170px;
  right: 6%;
  animation-duration: 120s;
  animation-direction: alternate-reverse;
}
html[data-theme="dark"] .sky-top .cloud {
  opacity: 0.35;
}
@keyframes drift {
  from {
    transform: translateX(-40px);
  }
  to {
    transform: translateX(40px);
  }
}
.sky-inner {
  position: relative;
  z-index: 1;
}
.sky-top .title {
  color: #141047;
}
.sky-top .lead {
  color: #141047;
}
html[data-theme="dark"] .sky-top .title,
html[data-theme="dark"] .sky-top .lead {
  color: var(--text);
}
@keyframes z-float {
  50% {
    transform: translate(4px, -8px);
    opacity: 0.55;
  }
}

/* Snek lives on the footer meadow (pet.js): walks and sleeps in place. */
.pet {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 20;
  width: 132px;
  height: 132px;
  cursor: pointer;
  will-change: transform;
}
.pet-motion,
.pet-sprite {
  width: 100%;
  height: 100%;
  transform-origin: 50% 93%;
}
.pet .character-canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}
.pet:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
.pet .pet-zzz {
  position: absolute;
  right: 4px;
  top: -8px;
  width: 50px;
  height: 60px;
  font-family: "Silkscreen", monospace;
  font-weight: 700;
  font-size: 18px;
  color: #8f9bd0;
}
.pet .pet-zzz span {
  position: absolute;
  animation: z-float 2.8s ease-in-out infinite;
}
.pet .pet-zzz span:nth-child(1) {
  left: 0;
  bottom: 0;
  font-size: 14px;
}
.pet .pet-zzz span:nth-child(2) {
  left: 16px;
  bottom: 20px;
  animation-delay: -0.7s;
}
.pet .pet-zzz span:nth-child(3) {
  left: 34px;
  bottom: 42px;
  animation-delay: -1.4s;
}

/* Strategy list: numbered rows, as in the coil.win menu; two columns on wide screens */
.slist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 48px;
  border-top: 2px solid var(--line);
}
.slist li {
  border-bottom: 2px solid var(--soft);
}
.srow {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 0 14px;
  padding: 18px 0 16px;
}
.srow .n {
  font-family: "VT323", monospace;
  font-size: 22px;
  color: var(--muted);
  line-height: 1.3;
}
.srow .top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.srow .name {
  font-size: 28px;
  line-height: 1.1;
}
html[lang="zh"] .srow .name {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
}
.srow .kind {
  flex: none;
  font-size: var(--small);
  color: var(--muted);
}
.srow .sum {
  display: block;
  margin-top: 4px;
  font-family: var(--read);
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted);
}
.srow .meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 10px;
}
.srow .tags {
  font-size: var(--small);
  color: var(--muted);
}
.srow:hover .name {
  color: var(--blue);
}
.ev-sum {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: var(--small);
}

/* Tabs */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin: 0 0 30px;
}
.tab {
  border: 2px solid transparent;
  background: transparent;
  padding: 2px 12px;
  font-size: 22px;
  color: var(--muted);
}
html[lang="zh"] .tab {
  font-size: 16px;
}
.tab:hover {
  color: var(--blue);
}
.tab[aria-pressed="true"] {
  border-color: var(--line);
  color: var(--text);
  background: var(--panel);
}

/* Detail */
.page-top {
  padding-top: 160px;
}
.detail-title {
  margin-top: 18px;
}
.detail-title .title {
  font-size: clamp(30px, 3.6vw, 42px);
}
.block {
  margin-top: 44px;
}
.block .h2 {
  margin-bottom: 14px;
}
/* The replay follows the sky directly; the sky's own bottom padding is enough space. */
.sky-top + .wrap > #replay:first-child {
  margin-top: 4px;
}
.reading-col {
  width: min(760px, 100%);
}
.read,
.prose,
.rules-list,
.replay-now,
.stats-foot,
.full p,
.glance dd,
.lane .note,
dialog.dlg p {
  font-family: var(--read);
}
.prose {
  font-size: var(--read-size);
  line-height: 1.65;
  max-width: 64ch;
}
html[lang="zh"] .prose {
  line-height: 1.8;
}
.prose p + p {
  margin-top: 14px;
}
.prose ul {
  margin: 6px 0 0;
  padding-left: 22px;
}
.prose li {
  padding-left: 4px;
}
.prose li + li {
  margin-top: 10px;
}
.prose li::marker {
  color: var(--muted);
}
.cite {
  font-size: 0.72em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
}
.lead.read {
  font-size: 19px;
  line-height: 1.6;
  max-width: 40ch;
}
.sec {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-family: var(--read);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--line);
}
.sec .n {
  font-family: "VT323", monospace;
  font-weight: 400;
  font-size: 22px;
  color: var(--muted);
}
.glance {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0;
  margin: 26px 0 0;
}
.glance dt,
.glance dd {
  margin: 0;
  padding: 10px 18px;
  border-bottom: 2px solid var(--soft);
}
.glance dt {
  font-size: var(--small);
  color: var(--muted);
  padding-top: 12px;
}
.glance dd {
  font-size: 16px;
}
.glance dt:nth-last-of-type(1),
.glance dd:last-of-type {
  border-bottom: 0;
}
.glance .ev {
  font-family: var(--font);
}
.why {
  margin-top: 4px;
  font-size: 15px;
  color: var(--muted);
  line-height: 1.6;
}
.prose ul {
  margin: 0;
  padding-left: 26px;
}
.prose li + li {
  margin-top: 6px;
}
html[lang="zh"] .prose {
  line-height: 1.75;
}
.cite {
  color: var(--blue);
}
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rules-list {
  font-size: var(--read-size);
  line-height: 1.6;
}
.rules-list li {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 2px solid var(--soft);
}
.rules-list li:last-child {
  border-bottom: 0;
}
html[lang="zh"] .rules-list li {
  grid-template-columns: 90px 1fr;
}
.rules-list .k {
  font-family: var(--font);
  font-size: var(--small);
  color: var(--muted);
  padding-top: 2px;
}

.dhead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 40px;
  align-items: start;
  margin-top: 14px;
}
.facts {
  margin-top: 12px;
  font-size: var(--small);
  color: var(--muted);
}
.evcard .evhead {
  padding: 12px 16px;
  border-bottom: 2px solid var(--line);
}
.evcard .stats {
  grid-template-columns: 1fr 1fr;
}
.evcard .stat:nth-child(3) {
  border-left: 0;
}
.evcard .stat:nth-child(n + 3) {
  border-top: 2px solid var(--soft);
}
.evcard .stat .v {
  font-size: 32px;
}
.evcard.empty-ev {
  position: relative;
  padding: 18px 18px 18px 120px;
  min-height: 120px;
}
.evcard.empty-ev .snek {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 96px;
  height: 96px;
}
.evcard .note {
  margin-top: 6px;
  font-family: var(--read);
  font-size: 14px;
  line-height: 1.5;
}
.dgrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px 48px;
  align-items: start;
  margin-top: 36px;
}
/* First rule row starts level with the paragraph next to it. */
.dgrid .rules-list li:first-child {
  padding-top: 0;
}
/* Row-aligned: row 1 = how it trades + rules, row 2 = when not to trade + when it fails. Headings line up across columns. */
.dgrid .sec {
  font-size: 19px;
}
.dgrid .prose {
  font-size: var(--read-size);
}
details.fold {
  margin-top: 0;
  border-top: 1px solid var(--soft);
}
/* One row per disclosure; only the group needs separation from the replay. */
.replay + details.fold {
  margin-top: 28px;
}
details.fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  cursor: pointer;
  padding: 20px 0;
  font-size: var(--body);
  line-height: 1.5;
  list-style: none;
}
details.fold > summary::-webkit-details-marker {
  display: none;
}
details.fold > summary::after {
  content: "+";
  flex: none;
  width: 24px;
  text-align: center;
  font: 24px/1 "VT323", monospace;
  color: var(--muted);
}
details.fold[open] > summary::after {
  content: "−";
  color: var(--blue);
}
details.fold[open] {
  padding-bottom: 24px;
}
details.fold > summary:hover {
  color: var(--blue);
}
.wrap > details.fold:last-child {
  border-bottom: 1px solid var(--soft);
}
details.fold .full {
  padding: 0 0 12px;
}

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stat {
  padding: 16px 18px;
}
.stat + .stat {
  border-left: 2px solid var(--soft);
}
.stat .k {
  font-size: var(--small);
  color: var(--muted);
}
.stat .v {
  font-size: 40px;
  line-height: 1.1;
}
html[lang="zh"] .stat .v {
  font-family: "VT323", monospace;
  font-size: 38px;
}
.stat .s {
  font-size: var(--small);
  color: var(--muted);
}
.stats-foot {
  padding: 12px 18px;
  border-top: 2px solid var(--line);
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
}
details.more {
  border-top: 2px solid var(--line);
}
details.more summary {
  cursor: pointer;
  padding: 12px 18px;
  font-size: var(--small);
  color: var(--blue);
  list-style: none;
}
details.more summary::-webkit-details-marker {
  display: none;
}
details.more[open] summary {
  border-bottom: 2px solid var(--soft);
}
.full {
  padding: 6px 18px 18px;
  overflow-x: auto;
}
.full table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 21px;
}
html[lang="zh"] .full table {
  font-size: 15px;
}
.full th,
.full td {
  text-align: right;
  padding: 6px 10px;
  border-bottom: 2px solid var(--soft);
  font-weight: 400;
  white-space: nowrap;
}
.full th {
  color: var(--muted);
}
.full th:first-child,
.full td:first-child {
  text-align: left;
}
.full .base {
  color: var(--muted);
}
.full p {
  margin-top: 12px;
  font-size: var(--small);
  color: var(--muted);
}
.example-banner {
  padding: 10px 18px;
  border-bottom: 2px solid var(--line);
  color: var(--down);
  font-size: var(--small);
}

/* Replay */
.replay canvas {
  display: block;
  width: 100%;
}
.replay .eq {
  border-top: 2px solid var(--soft);
}
.replay-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-top: 2px solid var(--line);
}
.replay-bar input {
  flex: 1;
  accent-color: #2465f6;
  min-width: 80px;
}
.replay-bar .date {
  font-size: var(--small);
  color: var(--muted);
  white-space: nowrap;
}
.replay-now {
  padding: 12px 18px 16px;
  border-top: 2px solid var(--soft);
  min-height: 64px;
  font-size: 15px;
  line-height: 1.6;
}
.replay-now .act {
  margin-right: 8px;
}
.act-enter {
  color: var(--up);
}
.act-exit {
  color: var(--down);
}
.act-skip {
  color: var(--muted);
}
.replay-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  padding: 10px 18px;
  border-bottom: 2px solid var(--line);
  font-size: var(--small);
  color: var(--muted);
}
.replay-head select {
  font: inherit;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--soft);
}

/* Cross replay */
.lane {
  display: grid;
  grid-template-columns: 290px 1fr;
  align-items: center;
  border-top: 2px solid var(--soft);
}
.lane-name {
  padding: 6px 18px;
  font-size: 21px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
html[lang="zh"] .lane-name {
  font-size: 15px;
}
.lane canvas {
  height: 34px;
}
.lane .note {
  font-size: var(--small);
  color: var(--muted);
  padding: 0 12px;
}
.lane:hover {
  background: color-mix(in srgb, var(--blue) 7%, transparent);
}

/* Empty */
.empty {
  position: relative;
  padding: 26px 26px 26px 170px;
  min-height: 150px;
}
.empty .snek {
  left: 20px;
  top: 50%;
  width: 130px;
  height: 130px;
  transform: translateY(-50%);
}

/* Dialog */
dialog.dlg {
  width: min(560px, calc(100vw - 36px));
  padding: 28px 28px 32px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}
dialog.dlg::backdrop {
  background: #14104773;
}
dialog.dlg h2 {
  font-family: var(--brand);
  font-size: 28px;
  letter-spacing: -1px;
  margin: 0 40px 18px 0;
}
html[lang="zh"] dialog.dlg h2 {
  font-family: var(--font);
  letter-spacing: 0;
}
dialog.dlg p {
  margin-top: 12px;
}
dialog.dlg .x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  font-family: var(--brand);
  font-size: 28px;
  line-height: 1;
}

/* Footer: grass grows from the page into an ink footer */
.footer {
  margin-top: 40px;
  padding-top: 120px;
  background: linear-gradient(
      180deg,
      rgba(255, 255, 255, 0) 0,
      var(--haze) 100%
    )
    0 0 / 100% 208px no-repeat;
}
/* Mirror of the top sky: a faint meadow haze for the last ~200px above the grass. */
.footer .ground {
  position: relative;
  height: 88px;
  background: url("/assets/meadow.png") center top / auto 176px repeat-x;
  image-rendering: pixelated;
}
.footer .ground .prop {
  position: absolute;
  bottom: 40px;
  image-rendering: pixelated;
}
.footer-body {
  background: #141047;
  color: #eaf4ff;
  padding: 40px 0 28px;
}
html[data-theme="dark"] .footer .ground {
  filter: brightness(0.7) saturate(0.85);
}
html[data-theme="dark"] .footer-body {
  background: #08061d;
}
.fgrid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}
.fbrand img {
  display: block;
  width: 122px;
  height: 44px;
  image-rendering: pixelated;
}
.fbrand p {
  margin: 10px 0 16px;
  font-family: var(--read);
  font-size: 14px;
  line-height: 1.6;
  color: #b9c4ee;
  max-width: 30ch;
}
.fcol h3 {
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--small);
  color: #8f9bd0;
  margin: 4px 0 10px;
}
.fcol a {
  display: block;
  padding: 4px 0;
  font-size: var(--small);
  color: #eaf4ff;
}
.fcol a:hover {
  color: #8fb7ff;
}
.fdisclaimer {
  margin-top: 34px;
  padding-top: 18px;
  border-top: 2px solid #ffffff1f;
  font-family: var(--read);
  font-size: 13px;
  line-height: 1.6;
  color: #b9c4ee;
}
.fbottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  font-size: var(--small);
  color: #8f9bd0;
}

@media (max-width: 760px) {
  .fgrid {
    grid-template-columns: 1fr 1fr;
  }
  .fbrand {
    grid-column: 1 / -1;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dhead,
  .dgrid {
    grid-template-columns: 1fr;
  }
  .stat:nth-child(3) {
    border-left: 0;
  }
  .stat:nth-child(n + 3) {
    border-top: 2px solid var(--soft);
  }
  .lane {
    grid-template-columns: 1fr;
  }
  .lane-name {
    padding-bottom: 0;
  }
  .slist {
    grid-template-columns: 1fr;
  }
  .srow {
    grid-template-columns: 34px minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .sky-top {
    padding-top: 104px;
    padding-bottom: 36px;
  }
  .sky-top::before {
    height: 240px;
  }
  .sky-top .c1 {
    display: none;
  }
  .sky-top .c2 {
    width: 110px;
    top: 96px;
    right: 30%;
  }
  :root {
    --pad: 22px;
  }
  .header {
    padding-top: 14px;
    padding-bottom: 14px;
  }
  .brand img {
    width: 122px;
    height: 44px;
  }
  .header .wide-only {
    display: none;
  }
  .header .menu-toggle {
    display: flex;
  }
  .crumbs-nav {
    gap: 8px;
  }
  .crumbs-nav .here {
    max-width: 12ch;
  }
  .menu {
    left: var(--pad);
    right: var(--pad);
    width: auto;
  }
  .sky-top .c2 {
    top: 84px;
  }
  .empty {
    padding: 140px 20px 20px;
  }
  .empty .snek {
    top: 10px;
    left: 20px;
    transform: none;
    width: 120px;
    height: 120px;
  }
  .rules-list li {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .glance {
    grid-template-columns: 1fr;
  }
  .glance dt {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .page-top {
    padding-top: 130px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
/* Production additions: distribution values, static markup, and long reasons. */
.logo-dark {
  display: none !important;
}
html[data-theme="dark"] .logo-light {
  display: none;
}
html[data-theme="dark"] .logo-dark {
  display: block !important;
}
.distribution-label,
.instrument-title {
  font-family: var(--read);
  font-size: 13px;
  padding: 8px 16px;
}
.instrument-title {
  padding-bottom: 0;
}
.evcard .stat .v {
  font-family: "VT323", monospace;
  font-size: 28px;
}
.stat .v small {
  display: block;
  font-family: var(--read);
  font-size: 11px;
  line-height: 1.7;
  color: var(--muted);
}
.instrument-stats + .instrument-stats {
  border-top: 2px solid var(--soft);
}
.warning-row {
  margin-top: 10px;
  font-family: var(--read);
  font-size: 13px;
}
.srow .sum small {
  font-size: 11px;
}
.command,
.replay-now {
  overflow-wrap: anywhere;
}
.replay-note,
.replay-error {
  font-family: var(--read);
  font-size: 12px;
  line-height: 1.6;
  padding: 8px 18px;
  color: var(--muted);
}
.replay-error {
  color: var(--down);
}
.replay-bar input {
  min-width: 0;
  width: 100%;
}
.full table caption {
  text-align: left;
  color: var(--muted);
}
.full h3 {
  font-size: 18px;
  margin-top: 20px;
}
.full h4 {
  font-size: 15px;
}
.full td small {
  white-space: normal;
}
@media (max-width: 640px) {
  .crumbs-nav {
    gap: 7px;
  }
  .header {
    gap: 8px;
  }
  .crumbs-nav .here {
    max-width: 14ch;
  }
  .dhead {
    grid-template-columns: 1fr;
  }
  .srow .top {
    flex-wrap: wrap;
  }
  .lane {
    grid-template-columns: 1fr;
  }
  .lane-name {
    white-space: normal;
  }
  .replay-head {
    padding: 10px;
  }
  .evcard .stat {
    padding: 12px;
  }
  .full {
    padding: 6px 0;
  }
  .full table {
    min-width: 400px;
  }
}
.evidence-tabs {
  display: flex;
  gap: 4px;
  padding: 0 14px;
}
.evidence-tabs .tab {
  font:
    18px "VT323",
    monospace;
}
.instrument-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.lane {
  grid-template-columns: 1fr;
}
.lane-name {
  white-space: normal;
}
.lane canvas {
  width: 100%;
}
.comparison-table {
  margin: 20px 0;
  padding: 0 0 12px;
}
.comparison-table table {
  font-family: var(--read);
  font-size: 14px;
}
.comparison-table td small {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.fill-details {
  padding: 10px 18px;
  border-top: 2px solid var(--soft);
  font: 14px var(--read);
}
.fill-details summary {
  cursor: pointer;
}
.fill-details .full {
  padding: 12px 0 0;
}
.fill-details table {
  font: 13px var(--read);
}

/* #49 review: preserve Coil chrome; give comparisons their own reading rhythm. */
.value-positive { color: var(--up); }
.value-negative { color: var(--down); }
.value-zero { color: var(--muted); }
.detail-intro { max-width: 820px; }
.detail-intro .warning-row { margin-top: 24px; }
.sky-top { padding-bottom: 48px; }
.sky-top .title { font-size: clamp(32px, 4vw, 46px); line-height: 1.2; }
.sky-top .lead { max-width: 60ch; font: 16px/1.8 var(--read); margin-top: 22px; }
/* Catalog entries remain small enough to scan side by side as the library grows. */
.strategy-list { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.strategy-list > li { min-width: 0; }
.strategy-entry { border: 1px solid var(--soft); background: var(--panel); padding: 24px; display: flex; flex-direction: column; height: 100%; }
.strategy-heading { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; }
.strategy-number { font: 24px/1.5 "VT323", monospace; color: var(--muted); }
.strategy-heading .kicker { font: 12px/1.6 var(--read); color: var(--muted); margin-bottom: 4px; }
.strategy-heading h2 { font-size: 27px; line-height: 1.3; font-weight: 400; }
html[lang="zh"] .strategy-heading h2 { font-size: 21px; font-weight: 700; }
.strategy-heading h2 a:hover { color: var(--blue); }
.strategy-description { margin-top: 14px; font: 14px/1.7 var(--read); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.strategy-entry > .warning-row { margin-top: 16px; font-size: 12px; }
.strategy-entry .lv { height: 24px; font-size: 16px; }
.catalog-results { margin-top: 22px; }
.catalog-results table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.catalog-results caption { text-align: left; color: var(--muted); font: 12px/1.8 var(--read); margin-bottom: 10px; }
.catalog-date { white-space: nowrap; }
.catalog-results th, .catalog-results td { padding: 7px 0; text-align: right; font-weight: 400; }
.catalog-results thead th { color: var(--muted); font: 11px/1.5 var(--read); }
.catalog-results th:first-child { text-align: left; }
.catalog-results tbody th { font: 22px/1.5 "VT323", monospace; }
.catalog-results tbody th small { font: 12px var(--read); color: var(--muted); margin-left: 8px; }
.catalog-results tbody td { font: 26px/1.3 "VT323", monospace; }
.more-markets { font: 12px/1.8 var(--read); }
.catalog-footer { position: relative; padding-top: 16px; margin-top: auto; font: 13px/1.8 var(--read); }
.catalog-link { position: absolute; top: 16px; right: 0; color: var(--blue); }
.catalog-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.catalog-range > summary { width: fit-content; max-width: calc(100% - 115px); cursor: pointer; color: var(--muted); }
.catalog-range > summary:hover { color: var(--blue); }
.catalog-range > summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.catalog-range > div { padding: 16px; margin-top: 14px; background: var(--panel); border: 1px solid var(--soft); font-size: 12px; }
.catalog-range section + section { margin-top: 14px; }
.catalog-range h3 { font-size: 12px; margin-bottom: 4px; }
.catalog-period { font: 12px/1.8 var(--read); color: var(--muted); margin-top: 24px; }
.result-scope { font: 13px/1.9 var(--read); color: var(--muted); margin: 28px 0 32px; max-width: 80ch; }
.market-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; align-items: start; }
.market-result { min-width: 0; padding: 28px; border: 2px solid var(--line); background: var(--panel); box-shadow: var(--shadow-sm); }
.market-result h3 { display: flex; align-items: baseline; gap: 16px; margin-bottom: 26px; font: 30px/1.2 "VT323", monospace; }
.market-result h3 > span { font: 12px/1.6 var(--read); color: var(--muted); }
.result-table table { border-collapse: collapse; width: 100%; font: 16px/1.5 var(--read); font-variant-numeric: tabular-nums; }
.result-table th, .result-table td { padding: 16px 8px; text-align: right; vertical-align: middle; border-bottom: 1px solid var(--soft); white-space: nowrap; }
.result-table th:first-child { text-align: left; padding-left: 0; font-size: 13px; font-weight: 400; }
.result-table td:last-child, .result-table th:last-child { padding-right: 0; }
.result-table thead th { font-size: 12px; font-weight: 400; color: var(--muted); padding-top: 0; padding-bottom: 14px; }
.result-table .ai-result td { font: 32px/1.2 "VT323", monospace; }
.result-table .ai-result th { font-weight: 600; color: var(--blue); }
.result-table small { display: block; color: var(--muted); font: 11px/1.7 var(--read); margin-top: 4px; }
.result-table .market-context th { color: var(--muted); }
.result-table .market-context td { font-size: 14px; }
.market-difference { margin-top: 24px; }
.difference-label { color: var(--muted); font: 12px/1.6 var(--read); }
.market-difference dl { margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.market-difference dt { font: 13px/1.6 var(--read); }
.market-difference dd { margin: 6px 0 0; font: 30px/1.2 "VT323", monospace; }
.market-difference dd > span:last-child { color: var(--muted); font: 12px var(--read); }
.drawdown-transition { margin-top: 14px; font: 12px/1.8 var(--read); color: var(--muted); }
.market-interpretation { margin-top: 24px; max-width: 45ch; font: 14px/1.8 var(--read); }
.run-range { border-top: 1px solid var(--soft); margin-top: 24px; font: 13px/1.7 var(--read); }
.run-range summary { padding: 18px 0 0; color: var(--blue); cursor: pointer; }
.run-range summary:focus-visible, .fold summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 5px; }
.range-legend { color: var(--muted); margin-top: 20px; font-size: 12px; }
.interval { margin-top: 22px; }
.interval-label { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; flex-wrap: wrap; }
.interval-label > span:last-child { font-variant-numeric: tabular-nums; }
.interval-rail { position: relative; height: 26px; margin: 8px 0; }
.interval-rail::before { content: ""; position: absolute; left: 6%; right: 6%; top: 12px; border-top: 1px solid var(--soft); }
.interval-range { position: absolute; height: 4px; top: 11px; background: var(--blue); }
.interval-median { position: absolute; width: 10px; height: 10px; border-radius: 50%; top: 8px; background: var(--blue); transform: translateX(-50%); }
.interval-control { position: absolute; width: 2px; height: 18px; top: 4px; background: var(--text); transform: translateX(-50%); }
.range-trades { color: var(--muted); margin-top: 20px; }
.range-trades small { font: inherit; }
.results-heading .h2 { margin-bottom: 20px; max-width: 32ch; }
.results-takeaway { max-width: 52ch; font: 20px/1.7 var(--read); }
.result-context { margin-top: 40px; max-width: 72ch; font: 14px/1.9 var(--read); }
.result-context h3 { font-size: 14px; margin-bottom: 10px; }
.result-context p { color: var(--muted); }
.result-context p + p { margin-top: 12px; }
.replay-intro { margin-bottom: 24px; color: var(--muted); }
.chart-legend { font: 12px/1.6 var(--read); color: var(--muted); padding: 12px 18px; border-bottom: 1px solid var(--soft); }
#comparison, #results, #replay { scroll-margin-top: 100px; }
@media (max-width: 1000px) {
  .market-grid { grid-template-columns: 1fr; gap: 32px; }
  .market-result { max-width: 680px; width: 100%; }
}
@media (max-width: 640px) {
  .sky-top { padding-bottom: 36px; }
  .strategy-list { grid-template-columns: 1fr; gap: 16px; }
  .market-result { padding: 24px 18px; }
  .market-result h3 { margin-bottom: 24px; }
  .result-table th, .result-table td { padding: 16px 4px; }
  .result-table th:first-child { font-size: 12px; }
  .result-table thead th { font-size: 11px; }
  .result-table .ai-result td { font-size: 30px; }
  .result-table table { font-size: 15px; }
  .market-difference dl { gap: 12px; }
  html[lang="en"] .market-difference dt { min-height: 3.2em; }
  .results-takeaway { font-size: 18px; }
  .chart-legend { padding: 10px; }
}
@media (max-width: 360px) {
  .catalog-results thead th { font-size: 10px; }
  .catalog-results th + th, .catalog-results td + td { padding-left: 8px; }
  .catalog-results tbody td { font-size: 24px; }
}
