@font-face {
  font-family: InterVariable;
  src: url('/fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
  font-display: swap;
}

@font-face {
  font-family: InterVariable;
  src: url('/fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
  font-weight: 100 900;
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
  font-display: swap;
}


:root {
  color-scheme: dark;
  --deep: light-dark(#061c2c, #e6f4fa);
  --deep-2: #0a2a42;
  --ocean: light-dark(#1c4e96, #9fcaff);
  --river: #2fb4e6;
  --river-soft: #8adcff;
  --land: #58b368;
  --amber: #f2b544;
  --ink: light-dark(#122331, #d6e5ea);
  --muted: light-dark(#526876, #afc5cc);
  --paper: light-dark(#fff, #101819);
  --surface: light-dark(#fff, #182326);
  --mist: light-dark(#eaf5fb, #223538);
  --line: light-dark(rgba(6, 28, 44, .13), #3a4d50);
  --night: #061c2c;
  --shadow: 0 20px 55px rgba(6, 28, 44, .18);
  --font: InterVariable, "Noto Sans SC Variable", "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }


html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

html:has(.gameplay-article) {
  scroll-behavior: auto;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

html:lang(zh) body { line-height: 1.8; }
img { max-width: 100%; display: block; }
a { color: var(--ocean); }

.shell {
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: .65rem; left: .65rem;
  z-index: 100;
  padding: .75rem 1rem;
  border-radius: .4rem;
  background: var(--night);
  color: #fff;
  transform: translateY(-180%);
  transition: transform .16s ease;
}

.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.5rem;
  min-height: 5rem;
}

.brand, .nav-link, .language-link, .compact-button, .ui-button, .nav-toggle {
  font: inherit;
  color: inherit;
  text-decoration: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.2rem;
  font-weight: 750;
  color: var(--deep);
  letter-spacing: 0;
}

.brand-logo { border-radius: .45rem; }
.site-nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); }

.nav-link {
  position: relative;
  padding: .35rem 0;
  font-weight: 550;
  color: var(--muted);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0; right: 100%; bottom: 0;
  height: 2px;
  background: var(--river);
  transition: right .18s ease;
}

.nav-link:hover::after, .nav-link.active::after, .language-link.active::after { right: 0; }

.header-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.language-dropdown { position: relative; display: inline-block; width: 8rem; max-width: 100%; }
.language-link {
  display: block;
  padding: .45rem .65rem;
  border-radius: .3rem;
  font-size: .875rem;
  color: var(--muted);
  overflow: hidden;
  transition: color .16s ease, background .16s ease;
}

.language-link:hover, .language-link.active { background: var(--mist); color: var(--deep); }
.language-link.active::after { content: none; }

.language-dropdown summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .55rem;
  list-style: none;
  cursor: pointer;
  min-height: 2.75rem;
  padding: .35rem .65rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: .875rem;
}
.language-name { white-space: nowrap; }

.language-dropdown summary::-webkit-details-marker { display: none; }
.language-dropdown summary::after {
  content: "";
  flex: none;
  width: .9rem;
  height: .9rem;
  background: currentColor;
  mask: url('/assets/chevron-down.svg') center / contain no-repeat;
  transition: transform .16s ease;
}
.language-dropdown[open] summary::after { transform: rotate(180deg); }
.site-footer .language-dropdown summary::after { transform: rotate(180deg); }
.site-footer .language-dropdown[open] summary::after { transform: rotate(0deg); }
.language-dropdown summary:hover { background: var(--mist); }
.language-dropdown summary:focus-visible { outline: 2px solid var(--river); outline-offset: 2px; }
.language-options {
  position: absolute;
  z-index: 1;
  inset: calc(100% + .35rem) 0 auto;
  padding: .25rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--surface);
  box-shadow: 0 8px 24px #0005;
}
.site-footer .language-options {
  inset: auto 0 calc(100% + .35rem);
  min-width: 0;
}

.compact-button {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 2.35rem;
  padding: .3rem .55rem;
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: rgba(255, 255, 255, .88);
  color: var(--deep);
  cursor: pointer;
  font-family: var(--mono);
  font-size: .84rem;
  font-weight: 650;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.compact-button:hover { border-color: rgba(47, 180, 230, .8); }
.compact-button.copied { border-color: rgba(88, 179, 104, .75); color: #2d7f42; }

.ui-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: .6rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, .46);
  border-radius: .3rem;
  background: transparent;
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  transition: background .14s ease, border-color .14s ease, color .14s ease;
}

.ui-button:hover,
.ui-button:focus-visible { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .72); }
.ui-button:active { background: rgba(255, 255, 255, .22); }
.ui-button.primary-button { background: #fff; border-color: #fff; color: var(--deep); }
.ui-button.primary-button:hover,
.ui-button.primary-button:focus-visible { background: rgba(255, 255, 255, .82); border-color: rgba(255, 255, 255, .82); color: var(--deep); }
.ui-button.primary-button:active { background: rgba(255, 255, 255, .92); }

.compact-button:focus-visible,
.ui-button:focus-visible,
.nav-link:focus-visible,
.language-link:focus-visible,
.nav-toggle:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(47, 180, 230, .8);
  outline-offset: 2px;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem; height: 2.5rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--surface);
  cursor: pointer;
}

.nav-icon {
  width: 1.25rem;
  height: 1.25rem;
  background: currentColor;
  mask: url('/assets/menu.svg') center / contain no-repeat;
}

.mobile-nav {
  display: none;
  position: absolute;
  inset: 100% 0 auto;
  max-height: 70svh;
  overflow-y: auto;
  padding-bottom: 1rem;
  background: var(--paper);
}

.mobile-nav .nav-link { display: block; padding: .75rem 1.25rem; }

html.nav-open .mobile-nav {
  display: block;
  border-top: 1px solid var(--line);
}

.nav-toggle[aria-expanded="true"] .nav-icon { mask-image: url('/assets/x.svg'); }

.layout { min-height: 55vh; }
.article { width: min(820px, calc(100% - 2.5rem)); margin-inline: auto; padding-block: 4rem 6rem; }
.home-page .article { width: min(1160px, calc(100% - 2.5rem)); }
.home-page { background: var(--paper); }

.hero {
  position: relative;
  min-height: min(88vh, 760px);
  display: grid;
  align-items: center;
  padding: 7rem 0 4rem;
  background:
    linear-gradient(105deg, rgba(6, 28, 44, .92) 0, rgba(8, 42, 66, .82) 46%, rgba(8, 42, 66, .34) 100%),
    url('/assets/river-valley.webp') right center / cover no-repeat;
  color: #fff;
  overflow: hidden;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 2.2rem;
  width: min(780px, 100%);
}

.hero h1 {
  margin: 0;
  font-size: clamp(3.5rem, 9vw, 6.8rem);
  line-height: .98;
  color: #fff;
}

.hero .eyebrow, .hero .subtitle { margin: 0; max-width: 40rem; }
.hero .eyebrow { color: var(--river-soft); font-size: .9rem; font-weight: 750; text-transform: uppercase; letter-spacing: .08em; }
.hero .subtitle { color: rgba(255, 255, 255, .86); font-size: clamp(1.1rem, 2vw, 1.35rem); line-height: 1.65; }

.action-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }

.fact-strip {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 1.3rem 0 3.8rem;
}

.fact {
  display: grid;
  align-content: start;
  gap: .2rem;
  padding: .7rem .9rem;
  border: 1px solid var(--line);
  border-left-width: 2px;
  border-radius: .3rem;
  background: #fff;
}

.fact:first-child { border-left-color: var(--river); }
.fact:nth-child(2) { border-left-color: var(--land); }
.fact:nth-child(3) { border-left-color: var(--ocean); }
.fact:nth-child(4) { border-left-color: var(--amber); }
.fact-value { color: var(--deep); font-size: 1.2rem; font-weight: 780; }
.fact-label { color: var(--muted); font-size: .87rem; line-height: 1.35; }

.section-plain, .section-water { position: relative; }
.section-plain { padding: clamp(3.5rem, 8vw, 5.5rem) 0; }
.section-water {
  margin-top: 0;
  padding: clamp(4rem, 9vw, 6rem) 0;
  background:
    linear-gradient(180deg, rgba(6, 28, 44, .9), rgba(13, 52, 85, .94)),
    url('/assets/river-basin-landscape.png') center 30% / cover no-repeat fixed;
  color: rgba(255, 255, 255, .84);
}

.section-title {
  margin: 0 0 1.5rem;
  color: var(--deep);
  font-size: clamp(2.1rem, 4vw, 3rem);
  line-height: 1.15;
}

.section-water .section-title { color: #fff; }
.featured-grid + .callout { margin-block-start: 1.5rem; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split > :first-child { grid-column: 1; }
.split > :nth-child(2) { grid-column: 2; }
.split-media {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  background: url('/assets/river-basin-landscape.png') center / cover no-repeat;
  border-radius: .5rem;
  transform: translateZ(0);
  transition: transform .2s ease;
}

.split-media:hover { transform: scale(1.015); }
.split-copy p { max-width: 38rem; color: inherit; }
.split-copy > ul { display: grid; gap: .8rem; margin-top: 1.5rem; padding: 0; list-style: none; }
.split-copy > ul li { display: grid; grid-template-columns: 18px 1fr; gap: .7rem; align-items: start; color: inherit; }
.split-copy li svg { width: 18px; height: 18px; margin-top: .3rem; color: var(--ocean); }
.section-water .split-copy > ul svg { color: #8adcff; }

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2.2rem;
}

.feature-card {
  display: grid;
  gap: .55rem;
  align-content: start;
  padding: 1.4rem;
  border: 1px solid var(--line);
  border-radius: .6rem;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.feature-card:hover { border-color: rgba(47, 180, 230, .6); background: #fbfeff; }
.feature-card svg { width: 26px; height: 26px; color: var(--ocean); }
.feature-card h3, .feature-card p { margin: 0; }
.feature-card h3 { color: var(--deep); font-size: 1.1rem; }
.feature-card p { color: var(--muted); }

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: .3rem; }
.article > * + * { margin-top: 1.15rem; }

.article h1, .article h2, .article h3 {
  color: var(--deep);
  line-height: 1.18;
  letter-spacing: 0;
}

.article h1 { margin: 0; font-size: clamp(2.7rem, 6vw, 4.8rem); }
.article h2 { margin-top: 3rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); font-size: clamp(1.85rem, 3.8vw, 2.5rem); }
.article h2 > span { display: block; }
.article h3 { margin-top: 2rem; font-size: clamp(1.25rem, 2vw, 1.5rem); }
.article p { margin: 0; }
.article ul, .article ol { padding-left: 1.35rem; }
.article li + li { margin-top: .35rem; }
.article strong { color: var(--deep); }

main a:not(.ui-button, .toc-link) {
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
  transition: color .16s ease;
}

main a:not(.ui-button, .toc-link):hover { color: light-dark(#1d67b9, #c6e1ff); }
.article code { font-family: var(--mono); font-size: .9em; }

.article :not(pre) > code {
  padding: .14em .34em;
  border: 1px solid var(--line);
  border-radius: .3rem;
  background: var(--mist);
}

.article pre {
  overflow-x: auto;
  padding: 1rem 1.2rem;
  border-radius: .55rem;
  background: var(--night);
  color: #dff5ff;
}

.article blockquote {
  margin: 0;
  padding: 1rem 1.3rem;
  border-left: 4px solid var(--river);
  background: linear-gradient(90deg, rgba(47, 180, 230, .12), rgba(47, 180, 230, 0));
  color: var(--ink);
  font-size: 1.08rem;
}

.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: .55rem; }
.table-scroll table { width: 100%; margin: 0; border-collapse: collapse; font-size: .95rem; }
.table-scroll :is(th, td) { padding: .75rem .9rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.table-scroll th { position: sticky; top: 0; background: var(--mist); color: var(--deep); font-size: .875rem; }
.table-scroll tr:last-child td { border-bottom: 0; }
.table-scroll tbody tr:hover td { background: var(--mist); }

.callout {
  --callout-radius: .3rem;
  position: relative;
  padding: 1.1rem 1.25rem;
  border: 1px solid rgba(242, 181, 68, .5);
  border-radius: var(--callout-radius);
  background: rgba(242, 181, 68, .11);
}

.callout::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: var(--callout-radius);
  border-radius: var(--callout-radius) 0 0 var(--callout-radius);
  background: var(--amber);
  pointer-events: none;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: #fff;
  box-shadow: 0 10px 28px rgba(6, 28, 44, .06);
}

.steps li::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: .5rem;
  color: var(--river);
  font-size: .875rem;
  font-weight: 750;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.gallery > * { margin: 0 !important; }
.gallery img { width: 100%; height: 100%; object-fit: cover; border-radius: .55rem; }

.split-start + .steps, .split-start + p, .split-start + ul, .split-start + ol, .split-start + .gallery { margin-top: 0; }
.split-start + .table-scroll { margin-top: 0; }
.split-end + * { margin-top: 1.5rem; }

.gameplay-shell {
  position: relative;
  background: linear-gradient(180deg, #fff 0, #fff 220px, #eef7fc 100%);
}

.gameplay-header {
  position: relative;
  min-height: 45vh;
  padding: clamp(4.5rem, 9vw, 8rem) 0 0;
  background:
    linear-gradient(180deg, rgba(6, 28, 44, .72), rgba(6, 28, 44, .86)),
    url('/assets/river-basin-landscape.png') center 35% / cover no-repeat;
  color: #fff;
}

.gameplay-header .article { padding-bottom: 4.5rem; }
.gameplay-header h1, .gameplay-header h2 { color: #fff; border-bottom-color: rgba(255, 255, 255, .2); }
.gameplay-header p { color: rgba(255, 255, 255, .86); max-width: 43rem; }

.gameplay-body {
  display: grid;
  grid-template-columns: 220px minmax(0, 820px);
  justify-content: center;
  gap: clamp(1.5rem, 4vw, 4rem);
  width: min(1180px, calc(100% - 2.5rem));
  margin-inline: auto;
  padding: 3rem 0 6rem;
}

.side-toc {
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
}

.side-toc::before {
  content: "Contents";
  display: block;
  margin-bottom: .55rem;
  color: var(--deep);
  font-size: .875rem;
  font-weight: 750;
}

html:lang(zh) .side-toc::before { content: "目录"; }
.side-toc .toc-link { display: block; padding: .38rem .65rem .38rem .85rem; border-radius: .35rem; color: var(--muted); font-size: .9rem; text-decoration: none; transition: background .16s ease, color .16s ease; }
.side-toc .toc-link:hover { background: var(--mist); color: var(--deep); }
.side-toc .toc-link[aria-current="page"] {
  position: relative;
  background: var(--mist);
  color: var(--deep);
}
.side-toc .toc-link[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: .3rem;
  border-radius: .3rem 0 0 .3rem;
  background: #638691;
}
.gameplay-article > * + * { margin-top: 1.15rem; }

.gameplay-article h2 {
  margin-top: 3.2rem;
}

.section-dark {
  margin-inline: auto;
  width: min(1180px, calc(100% - 2.5rem));
  padding: 2.2rem;
  border: 1px solid rgba(6, 28, 44, .12);
  border-radius: .3rem;
  background: #f7fbfd;
  color: var(--ink);
}

.section-dark h2, .section-dark h3 { color: var(--deep); }
.section-dark table { background: #fff; color: inherit; }
.section-dark th { background: var(--mist); color: var(--deep); }
.section-dark td, .section-dark th { border-bottom-color: var(--line); }

.guide-shell { background: linear-gradient(180deg, #fff, #edf7fc); }
.guide-article { width: min(760px, calc(100% - 2.5rem)); margin-inline: auto; padding: 4rem 0 6rem; }

.site-footer {
  background: var(--night);
  color: rgba(255, 255, 255, .76);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr .8fr .6fr;
  gap: 2rem;
  padding: 3rem 0 2rem;
}

.footer-brand { color: #fff; }
.footer-brand p { margin: .8rem 0 0; max-width: 24rem; }
.footer-heading { margin: 0 0 .75rem; color: #fff; font-size: .9rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.inverse-button { background: transparent; border-color: rgba(255, 255, 255, .34); color: #fff; }
.inverse-button:hover { border-color: rgba(255, 255, 255, .62); }
.inverse-button.copied { border-color: rgba(88, 179, 104, .8); color: #a5e6ae; }
.site-footer .language-link { color: rgba(255, 255, 255, .78); }
.site-footer .language-link:hover, .site-footer .language-link.active { background: rgba(255, 255, 255, .1); color: #fff; }
.legal { padding: 1.2rem 0 2rem; border-top: 1px solid rgba(255, 255, 255, .12); }
.legal p { margin: 0; max-width: 60rem; font-size: .82rem; line-height: 1.6; }
.legal p + p { margin-top: .4rem; }

@media (max-width: 900px) {
  .site-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .header-actions { margin-left: auto; }
  .gameplay-body { display: block; width: min(820px, calc(100% - 2.5rem)); }
  .side-toc {
    position: static;
    display: flex;
    gap: .4rem;
    max-height: none;
    margin-bottom: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
  }
  .side-toc::before { display: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .shell { width: min(1180px, calc(100% - 1.75rem)); }
  .header-inner { grid-template-columns: auto auto; gap: .75rem; }
  .header-actions .compact-button { display: none; }
  .article { width: calc(100% - 1.75rem); padding-top: 3rem; }
  .guide-article, .gameplay-body { width: calc(100% - 1.75rem); }
  .gameplay-header { min-height: 52vh; }
  .gameplay-header .article { width: calc(100% - 1.75rem); }
  .steps { grid-template-columns: 1fr; }
  .section-dark { width: calc(100% - 1.75rem); padding: 1.4rem; }
}

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

.hero { min-height: min(68svh, 620px); padding: 3rem 0; }
.hero-inner { gap: .85rem; }
.hero h1 { font-size: 5rem; }
.hero .eyebrow { letter-spacing: 0; }
.hero-tagline { margin: 0; font-size: 1.55rem; font-weight: 600; line-height: 1.3; }
.hero .subtitle { font-size: 1.1rem; }
.action-row { margin-top: .7rem; }
.ui-button {
  gap: .65rem;
  min-height: 2.75rem;
  border-radius: .4rem;
  cursor: pointer;
  transition: background-color .2s ease-in-out, color .2s ease-in-out, border-color .2s ease-in-out;
}
.ui-button.primary-button { background: #f4faf7; color: #153d34; }
.ui-button.primary-button:is(:hover, :focus-visible) {
  background: #d6efe4;
  border-color: #d6efe4;
  color: #153d34;
}
.ui-button.primary-button:active {
  background: #bfded0;
  border-color: #bfded0;
  color: #153d34;
}
.ui-button.inverse-button:hover { background: #f4faf7; color: #153d34; border-color: #f4faf7; }
.ui-button.inverse-button:active { background: #d6efe4; }
.ui-button.quiet-button { color: var(--deep); border-color: var(--line); background: var(--surface); }
.ui-button.quiet-button:hover { background: var(--mist); border-color: #5c8477; }
.quiet-button .button-icon img { filter: invert(1); }
.button-icon { display: inline-grid; place-items: center; width: 1rem; height: 1rem; }
.button-icon img { grid-area: 1 / 1; width: 1rem; height: 1rem; transition: opacity .2s ease, transform .2s ease; }
.inverse-button:not(:hover) .button-icon img { filter: invert(1); }
.button-icon img + img { opacity: 0; transform: scale(.75); }
.copied .button-icon img:first-child { opacity: 0; transform: scale(.75); }
.copied .button-icon img + img { opacity: 1; transform: none; }
.copy-status { position: fixed; z-index: 60; right: 1rem; bottom: 1rem; }
.copy-status span:not([hidden]) { display: block; background: #153d34; color: #fff; padding: .55rem .85rem; border-radius: .4rem; }

.launch-notice {
  display: flex;
  align-items: flex-start;
  gap: .65rem;
  width: fit-content;
  max-width: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line);
  border-radius: .45rem;
  background: var(--surface);
  color: var(--ink);
  font-size: .92rem;
  line-height: 1.55;
}
.launch-notice .launch-title { margin: 0; color: var(--deep); font-weight: 730; }
.launch-notice .launch-detail { margin: .15rem 0 0; }
.launch-detail time { color: var(--deep); font-weight: 680; }
.launch-icon {
  display: block;
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  background: var(--amber);
  mask: url('/assets/triangle-alert.svg') center / contain no-repeat;
}
.launch-notice .launch-icon { margin-top: .2rem; }
[data-launch-state="online"] .launch-icon { background: var(--land); mask-image: url('/assets/check.svg'); }

.server-copy { position: relative; display: inline-flex; }
.server-copy .compact-button { cursor: help; }
.server-copy-hint {
  position: absolute;
  z-index: 3;
  inset-block-start: 100%;
  inset-inline-start: 0;
  width: max-content;
  max-width: min(18rem, calc(100vw - 2rem));
  padding-block-start: .3rem;
  visibility: hidden;
}
.server-copy-hint-content {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .6rem;
  border: 1px solid var(--line);
  border-radius: .35rem;
  background: var(--surface);
  color: var(--deep);
  box-shadow: 0 8px 20px #0004;
  font-size: .82rem;
  line-height: 1.4;
}
.server-copy:not(.hint-dismissed):has(> button:focus-visible) .server-copy-hint { visibility: visible; }
.site-footer .server-copy-hint {
  inset-block-start: auto;
  inset-block-end: 100%;
  padding-block: 0 .3rem;
}
@media (hover: hover) {
  .server-copy:not(.hint-dismissed):hover .server-copy-hint { visibility: visible; }
}

.fact-strip { padding-block: 1.3rem; border-bottom: 1px solid var(--line); }
.fact { border: 0; border-inline-start: 1px solid var(--line); border-radius: 0; background: var(--paper); }
.fact:first-child { border-inline-start: 0; }
.section-water { background-attachment: scroll; }
.section-title { font-size: 2.4rem; }
.section-inner > p, .join-band p { max-width: 68ch; }
.section-inner > ul + h2 { margin-top: 2.8rem; }
.join-band { padding: 3rem 0; background: #16433e; color: #fff; }
.join-band .section-title { color: inherit; }
.join-band code { font-family: inherit; font-weight: 650; white-space: nowrap; }
.featured-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feature-card { border-radius: .5rem; background: var(--surface); }
.feature-card:hover { background: var(--surface); border-color: var(--line); }
.gameplay-header { min-height: 0; padding: 0; }
.gameplay-header .article { padding-block: 3rem; }
.gameplay-article, .gameplay-commands-article { width: 100%; min-width: 0; padding: 0; }
.gameplay-article > h2:first-child { margin-top: 0; }
.article p { margin-block: 1rem; }
.callout > :first-child { margin-top: 0; }
.callout > :last-child { margin-bottom: 0; }
.article h1 { font-size: 3rem; }
.article h2 { font-size: 2rem; }
.article h3 { font-size: 1.35rem; }
.article code { overflow-wrap: anywhere; }
.article pre code { overflow-wrap: normal; }

@media (max-width: 900px) {
  .header-inner { grid-template-columns: minmax(0, 1fr) auto; }
  .header-actions :is(.compact-button, .server-copy) { display: none; }
  .header-actions .language-dropdown { width: 7rem; }
  .site-footer .language-dropdown { width: 7rem; }
  .featured-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .header-inner { gap: .35rem; min-height: 4rem; }
  .header-actions { gap: .35rem; }
  .brand { gap: .25rem; }
  .brand-logo { width: 32px; height: 32px; }
  .hero { padding-block: 2.25rem; }
  .hero h1 { font-size: 3.1rem; }
  .hero-tagline { font-size: 1.25rem; }
  .hero .subtitle { font-size: 1rem; }
  .section-title, .article h2 { font-size: 1.65rem; }
  .article h1 { font-size: 2.35rem; }
  .fact-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: .65rem; }
  .fact:nth-child(odd) { border-inline-start: 0; }
  .split { display: flex; flex-direction: column; align-items: stretch; gap: 1.5rem; }
  .split-media { min-height: 0; aspect-ratio: 4 / 3; }
  .featured-grid { grid-template-columns: 1fr; }
}


/* World map */
.map-page { padding-block: clamp(1.5rem, 4vw, 3rem) 4rem; }
.map-page [hidden] { display: none !important; }
.map-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .65rem 1rem; margin-bottom: 1.25rem; }
.map-heading h1 { margin: 0; color: var(--deep); font-size: clamp(2.3rem, 6vw, 3rem); line-height: 1.15; }
.map-heading p, .map-details { color: var(--muted); }
.map-heading p { margin: .55rem 0 0; }
.map-heading output { padding: .4rem .75rem; font-family: var(--mono); color: var(--deep); background: var(--mist); border-radius: .4rem; }
.map-workspace { overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: .55rem; }
.map-controls, .map-tools, .map-controls form, .map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem; }
.map-controls { justify-content: space-between; padding: .7rem .85rem; border-bottom: 1px solid var(--line); }
.map-tools { min-width: 0; }
.map-controls :is(button, input[type=number], select) { min-height: 2.6rem; padding: .3rem .6rem; font: inherit; color: var(--deep); background: var(--surface); border: 1px solid var(--line); border-radius: .4rem; }
.map-controls input[type=number] { width: 9ch; }
.map-controls select { max-width: min(100%, 20rem); }
.map-controls button { cursor: pointer; }
.map-controls button[aria-pressed=true] { border-color: var(--river); background: var(--mist); }
.map-controls button:disabled { opacity: .5; cursor: default; }
.map-controls #submit { background: var(--deep); color: var(--paper); }
.map-viewport { position: relative; background: var(--night); color: #fff; }
.map-viewport canvas { display: block; width: 100%; height: clamp(340px, 61dvh, 780px); touch-action: none; cursor: grab; }
.map-viewport canvas:focus-visible { outline: 2px solid var(--river); outline-offset: -3px; }
.map-viewport #owner { position: absolute; right: .7rem; bottom: .7rem; pointer-events: none; padding: .3rem .6rem; border-radius: .4rem; background: var(--night); }
.map-details { padding: .75rem .85rem; font-size: .88rem; }
.map-details p { margin: .25rem 0 0; }
.map-legend { gap: .3rem 1rem; margin: 0; padding: 0; list-style: none; }
.map-legend i { display: inline-block; width: .75rem; height: .75rem; margin-right: .4rem; border-radius: .12rem; }
.map-legend .terrain { background: #73977d; }
.map-legend .territory { background: #8dabed; }
.map-legend .spacing { background: #c4a080; }
.map-legend .selection { background: #51dcdb; }
.map-legend .conflict { background: #f26968; }
.map-legend .core { background: #e1b04b; }

/* Coordinate calculator */
.coordinate-form {
  display: grid;
  justify-items: start;
  gap: 1.15rem;
  margin-block: 1.5rem;
  padding: clamp(.9rem, 3vw, 1.5rem);
  border: 1px solid var(--line);
  border-radius: .55rem;
  background: var(--surface);
}
.coordinate-inputs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: .9rem;
  width: 100%;
}
.coordinate-field label { display: block; margin-bottom: .3rem; color: var(--deep); font-weight: 650; }
.coordinate-field input {
  width: 100%;
  min-height: 2.75rem;
  padding: .45rem .65rem;
  border: 1px solid var(--line);
  border-radius: .4rem;
  background: var(--paper);
  color: var(--deep);
  font: 1rem var(--mono);
}
.coordinate-field input::placeholder { color: var(--muted); }
.coordinate-field input:focus-visible { outline: 2px solid var(--river); outline-offset: 2px; }
.coordinate-field input[aria-invalid="true"] { border-color: var(--amber); }
.coordinate-error:not([hidden]) { display: block; margin-top: .3rem; color: var(--amber); }
.coordinate-result {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  width: 100%;
  padding: .75rem;
  border-radius: .4rem;
  background: var(--mist);
}
.coordinate-result output {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem clamp(.85rem, 3vw, 1.5rem);
  font-family: var(--mono);
}
.coordinate-axis { color: var(--muted); }
.coordinate-form button:disabled { opacity: .55; cursor: default; }
