/* Game docs. Read mode on the landing's own material: solid sky, one Panel Blue
   reading surface at the 26px radius, Geist for prose, Galmuri only for the
   pixel subline. Tokens and the header come from landing.css. */

.docs-body { background: var(--sky); }
/* A reading page needs a solid header: a translucent one smears the paragraph under it. */
.docs-header { background: var(--sky); box-shadow: 0 10px 24px -18px rgba(10, 50, 100, .45); }

.docs-hero { padding: calc(118px + env(safe-area-inset-top)) 0 28px; }
.docs-title { margin: 0; max-width: 18ch; font-size: clamp(32px, 4.4vw, 54px); line-height: 1.02; letter-spacing: -.03em; color: #fff; text-shadow: 0 2px 18px rgba(20, 70, 130, .3); text-wrap: balance; }
.docs-title .px { display: block; margin-top: .22em; font-family: var(--pixel-bold); font-size: .62em; line-height: 1.15; letter-spacing: .02em; color: var(--cream); text-shadow: 0 2px 0 rgba(10, 50, 100, .18), 0 10px 24px rgba(10, 50, 100, .3); }
.docs-lede { margin: 20px 0 0; font-size: 16px; line-height: 1.6; color: rgba(255, 255, 255, .95); }
.docs-status { position: relative; display: block; margin: 20px 0 0; padding: 12px 16px 12px 36px; border-radius: 16px; background: rgba(15, 37, 64, .28); color: #fff; font-size: 14px; line-height: 1.7; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.docs-status > .dot { position: absolute; left: 16px; top: 20px; margin: 0; }
.docs-lede, .docs-status { max-width: 672px; }

.tag-inline { display: inline-flex; align-items: center; gap: 6px; min-height: 22px; margin: 0 2px; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .14em; vertical-align: middle; white-space: nowrap; }

.docs-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 28px; align-items: start; padding-bottom: 72px; }
.toc-toggle { display: none; }
.toc { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; padding: 18px 16px; border-radius: 22px; background: var(--glass); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), var(--shadow-sm); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.toc-title { margin: 0 0 10px; padding-left: 10px; font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 7px 10px; border-radius: 12px; font-size: 14px; color: var(--ink-2); transition: background .2s var(--ease), color .2s var(--ease); }
.toc a:hover { background: rgba(255, 255, 255, .6); color: var(--ink); }
.toc a.is-active { background: #fff; color: var(--ink); font-weight: 600; }

.docs-content { min-width: 0; padding: clamp(24px, 4vw, 48px); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.docs-section { padding-bottom: 40px; margin-bottom: 40px; border-bottom: 1px solid var(--line); }
.docs-section:last-child { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.docs-content h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 16px; font-size: clamp(26px, 3vw, 34px); line-height: 1.1; letter-spacing: -.02em; color: var(--ink); }
.docs-content h3 { margin: 32px 0 12px; font-size: 21px; letter-spacing: -.01em; color: var(--ink); }
.docs-content p { margin: 0 0 14px; max-width: 70ch; font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.docs-content b { color: var(--ink); }
.docs-content a:not(.pill) { color: var(--fire-deep); text-decoration: underline; text-underline-offset: 3px; }
.docs-note { font-size: 14px !important; color: var(--ink-3) !important; }
[data-model] { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

.docs-list, .docs-steps, .docs-rules { margin: 0 0 16px; padding-left: 22px; max-width: 70ch; display: grid; gap: 10px; }
.docs-list li, .docs-steps li, .docs-rules li { font-size: 16px; line-height: 1.6; color: var(--ink-2); padding-left: 4px; }
.docs-rules li::marker, .docs-steps li::marker { font-weight: 700; color: var(--fire); }
.docs-list li::marker { color: var(--fire); }

.formula { margin: 0 0 16px; padding: 18px 20px; overflow-x: auto; border-radius: 16px; background: var(--ink); color: #eaf4fd; font: 500 14px/1.7 ui-monospace, SFMono-Regular, Menlo, monospace; }

.table-wrap { margin: 0 0 16px; overflow-x: auto; border-radius: 16px; background: rgba(255, 255, 255, .55); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.table-wrap thead th { font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.table-wrap tbody tr:last-child > * { border-bottom: 0; }
.table-wrap tbody th { color: var(--ink); font-weight: 600; white-space: nowrap; text-transform: none; letter-spacing: 0; font-size: 14px; }

/* The page-wide img { max-width: 100% } lets a table cell count its sprite as zero wide, so the name ran into the next column on phones. */
.families .mon { display: inline-flex; align-items: center; gap: 8px; }
.families .mon img { width: 40px; height: 40px; max-width: none; flex: none; image-rendering: pixelated; }
.families td:nth-child(4), #wild .families td:nth-child(3) { white-space: nowrap; }
.families .mark { display: inline-block; width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.families td:nth-child(4) small { display: block; margin-top: 2px; color: var(--ink-3); }

.odds td { font-weight: 600; }
.odds thead th { white-space: normal; }
/* Three documented colours: forest green, the neutral ink, fire deep. */
.odds .good { color: #3f8a4a; }
.odds .ok { color: var(--ink-2); }
.odds .bad { color: var(--fire-deep); }

.type-chart { font-size: 12px; }
.type-chart th, .type-chart td { padding: 7px 6px; text-align: center; border: 1px solid var(--line); }
.type-chart thead th { font-size: 10px; letter-spacing: .04em; writing-mode: vertical-rl; transform: rotate(180deg); padding: 10px 4px; }
.type-chart thead th.corner { writing-mode: horizontal-tb; transform: none; text-align: left; font-size: 10px; min-width: 90px; }
.type-chart tbody th { text-align: left; font-size: 12px; }
.type-chart td { min-width: 30px; font-weight: 700; }
.type-chart td.strong { background: rgba(79, 184, 74, .22); color: #3f8a4a; }
.type-chart td.weak { background: rgba(232, 71, 43, .14); color: var(--fire-deep); }

.table-wrap table { min-width: 0; }
.table-wrap table.moves, .table-wrap table.type-chart { min-width: 640px; }
.qa td:first-child { width: 9em; color: var(--ink); font-weight: 600; }
.docs-shot { margin: 8px 0 20px; max-width: 640px; }
.docs-shot img { display: block; width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow-sm); image-rendering: pixelated; }
.docs-shot figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--ink-3); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.compare-card { padding: 22px 22px 8px; border-radius: 22px; background: rgba(255, 255, 255, .7); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .9); }
.compare-card h3 { margin-top: 0; }
.compare-tag { margin: 0 0 8px !important; }

.glossary { display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; margin: 0 0 16px; max-width: 70ch; }
.glossary dt { font-weight: 700; color: var(--ink); }
.glossary dd { margin: 0; color: var(--ink-2); line-height: 1.55; }

@media (max-width: 960px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .toc-toggle { display: inline-flex; justify-self: start; align-items: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--glass); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), var(--shadow-sm); }
  .toc { display: none; position: static; max-height: none; }
  .toc.is-open { display: block; }
  .toc-title { display: none; }
}
@media (max-width: 720px) {
  .docs-content { padding: 22px 18px; }
  .glossary { grid-template-columns: 1fr; gap: 2px 0; }
  .glossary dd { margin-bottom: 10px; }
}
/* A full contract address is one 42-character word; it breaks anywhere rather than push a phone page sideways. */
.ca { overflow-wrap: anywhere; word-break: break-all; }
