:root {
  --page: #e9efe9;
  --page-deep: #dfe9df;
  --card: #ffffff;
  --ink: #112215;
  --muted: #5a695c;
  --green: #026a02;
  --green-dark: #004c08;
  --green-soft: #e4f3e4;
  --green-pale: #f3f8f3;
  --line: #dce7dc;
  --gold: #dcae3b;
  --shadow: 0 20px 55px rgba(18, 54, 25, 0.1);
  --shadow-small: 0 10px 30px rgba(18, 54, 25, 0.08);
  --radius: 24px;
  --radius-small: 15px;
  --content: 1400px;
  color-scheme: light;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

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

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 6% 2%, rgba(255, 255, 255, 0.9), transparent 24rem),
    linear-gradient(135deg, transparent 0 47%, rgba(2, 106, 2, 0.025) 47% 53%, transparent 53% 100%),
    var(--page);
  background-size: auto, 44px 44px, auto;
  font-family: "Exo 2", "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--green);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--green-dark);
}

button,
input {
  font: inherit;
}

img {
  max-width: 100%;
}

::selection {
  color: #fff;
  background: var(--green);
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 16px;
  color: #fff;
  background: var(--green-dark);
  border-radius: 10px;
  transform: translateY(-150%);
}

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

.reading-progress {
  position: fixed;
  z-index: 999;
  inset: 0 auto auto 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green), #5fbe55);
  box-shadow: 0 0 12px rgba(2, 106, 2, 0.35);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  padding: 18px 20px 8px;
  pointer-events: none;
}

.header-shell {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(var(--content), calc(100% - 8px));
  min-height: 68px;
  margin: 0 auto;
  padding: 10px 13px 10px 18px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 19px;
  box-shadow: 0 14px 36px rgba(18, 54, 25, 0.11);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}

.brand {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 11px;
  min-width: max-content;
  color: var(--ink);
  font-weight: 800;
  line-height: 1.05;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.18), transparent 45%),
    var(--green);
  border: 2px solid rgba(0, 76, 8, 0.16);
  border-radius: 50%;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, 0.12);
  place-items: center;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-name {
  font-size: 1rem;
}

.brand-section {
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-home-link {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  color: var(--green-dark);
  background: var(--green-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.game-home-link:hover,
.game-home-link:focus-visible {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.top-nav a {
  padding: 9px 12px;
  color: #29422e;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a[aria-current="page"] {
  color: var(--green);
  background: var(--green-soft);
}

.search {
  position: relative;
  width: min(238px, 19vw);
}

.search-input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 14px;
  color: var(--ink);
  background: var(--green-pale);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
}

.search-input:focus {
  background: #fff;
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(2, 106, 2, 0.1);
}

.search::after {
  position: absolute;
  top: 9px;
  right: 13px;
  color: var(--green);
  content: "⌕";
  font-size: 1.2rem;
  pointer-events: none;
}

.search-results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  right: 0;
  display: none;
  width: min(390px, calc(100vw - 36px));
  margin: 0;
  padding: 7px;
  list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-small);
}

.search-results.is-open {
  display: block;
}

.search-results a,
.search-empty {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  color: var(--ink);
  border-radius: 9px;
  text-decoration: none;
}

.search-results a:hover,
.search-results a:focus {
  background: var(--green-soft);
}

.search-results span {
  color: var(--muted);
  font-size: 0.79rem;
  font-weight: 500;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  color: var(--green);
  background: var(--green-soft);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}

.menu-toggle span,
.menu-toggle::before,
.menu-toggle::after {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 3px;
  content: "";
}

.page-shell {
  width: min(var(--content), calc(100% - 40px));
  margin: 22px auto 72px;
}

.hero {
  position: relative;
  min-height: 370px;
  margin-bottom: 24px;
  padding: clamp(42px, 6vw, 88px);
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(105deg, rgba(0, 62, 7, 0.97), rgba(2, 106, 2, 0.86)),
    var(--green);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero::before,
.hero::after {
  position: absolute;
  content: "";
  border: 2px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
}

.hero::before {
  top: -132px;
  right: -70px;
  width: 410px;
  height: 410px;
  box-shadow:
    0 0 0 42px rgba(255, 255, 255, 0.035),
    0 0 0 88px rgba(255, 255, 255, 0.025);
}

.hero::after {
  right: 112px;
  bottom: -155px;
  width: 310px;
  height: 310px;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 810px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 17px;
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #cceccc;
}

.eyebrow::before {
  width: 27px;
  height: 2px;
  background: currentColor;
  content: "";
}

h1,
h2,
h3,
h4 {
  margin-top: 0;
  color: var(--ink);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 970px;
  margin-bottom: 22px;
  font-size: clamp(2.65rem, 6vw, 5.7rem);
  font-weight: 850;
}

.hero h1 {
  color: #fff;
}

.hero p {
  max-width: 735px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(1.05rem, 1.8vw, 1.3rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  color: #fff;
  background: var(--green);
  border: 1px solid var(--green);
  border-radius: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.button:hover {
  color: #fff;
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.button-light {
  color: var(--green-dark);
  background: #fff;
  border-color: #fff;
}

.button-light:hover {
  color: var(--green-dark);
  background: #eaf6ea;
}

.button-ghost {
  color: #fff;
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
}

.button-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.55);
}

.manual-grid {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.manual-sidebar {
  position: sticky;
  top: 106px;
  display: grid;
  gap: 18px;
}

.sidebar-card,
.article-card,
.feature-card,
.stat-card,
.next-card,
.notice {
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow-small);
}

.sidebar-card {
  padding: 20px;
}

.sidebar-title {
  display: block;
  margin-bottom: 11px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.manual-nav {
  display: grid;
  gap: 8px;
}

.manual-nav a {
  position: relative;
  padding: 8px 10px 8px 15px;
  color: #314736;
  border-radius: 9px;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
}

.manual-nav a::before {
  position: absolute;
  top: 50%;
  left: 3px;
  width: 5px;
  height: 5px;
  background: #aec2b0;
  border-radius: 50%;
  content: "";
  transform: translateY(-50%);
}

.manual-nav a:hover,
.manual-nav a[aria-current="page"] {
  color: var(--green);
  background: var(--green-soft);
}

.manual-nav a[aria-current="page"]::before {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(2, 106, 2, 0.12);
}

.toc {
  display: grid;
  gap: 8px;
}

.toc a {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  text-decoration: none;
}

.toc a:hover,
.toc a.is-active {
  color: var(--green);
}

.manual-main {
  min-width: 0;
}

.page-intro {
  margin-bottom: 24px;
  padding: clamp(34px, 5vw, 64px);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.96), rgba(248, 252, 248, 0.92)),
    var(--card);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.page-intro h1 {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: clamp(2.35rem, 5vw, 4.7rem);
}

.page-intro > p:last-child {
  max-width: 850px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.12rem;
}

.article-card {
  margin-bottom: 24px;
  padding: clamp(28px, 4vw, 52px);
}

.article-card h2 {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.65rem, 3vw, 2.45rem);
}

.article-card h3 {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 1.25rem;
}

.article-card h4 {
  margin-top: 24px;
  margin-bottom: 8px;
  font-size: 1rem;
}

.article-card p {
  max-width: 950px;
  margin-top: 0;
}

.article-card p:last-child {
  margin-bottom: 0;
}

.lead {
  color: #2e4533;
  font-size: 1.13rem;
  line-height: 1.75;
}

.feature-grid,
.card-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feature-card,
.stat-card {
  padding: 25px;
}

.feature-card h3,
.stat-card h3 {
  margin: 0 0 9px;
  font-size: 1.15rem;
}

.feature-card p,
.stat-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.93rem;
}

.feature-number,
.feature-kicker {
  display: inline-grid;
  min-width: 35px;
  height: 35px;
  margin-bottom: 18px;
  padding: 0 9px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 10px;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 850;
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 24px 0;
}

.stat-card {
  border-radius: 18px;
}

.stat-card strong {
  display: block;
  margin-bottom: 2px;
  color: var(--green);
  font-size: 1.55rem;
  line-height: 1.1;
}

.notice {
  margin: 24px 0;
  padding: 24px 25px 24px 29px;
  background: linear-gradient(105deg, var(--green-soft), #fff);
  border-color: #cfe3cf;
  border-left: 5px solid var(--green);
  border-radius: 16px;
}

.notice strong {
  display: block;
  margin-bottom: 4px;
  color: var(--green-dark);
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice-gold {
  background: linear-gradient(105deg, #fff7df, #fff);
  border-color: #ecdeaf;
  border-left-color: var(--gold);
}

.prose-list {
  display: grid;
  gap: 11px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}

.prose-list li {
  position: relative;
  padding-left: 24px;
}

.prose-list li::before {
  position: absolute;
  top: 0.68em;
  left: 3px;
  width: 7px;
  height: 7px;
  background: var(--green);
  border-radius: 50%;
  content: "";
}

.steps {
  display: grid;
  gap: 15px;
  margin: 24px 0;
  padding: 0;
  counter-reset: manual-step;
  list-style: none;
}

.steps li {
  position: relative;
  min-height: 50px;
  padding: 5px 0 0 62px;
  counter-increment: manual-step;
}

.steps li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--green);
  border-radius: 13px;
  content: counter(manual-step, decimal-leading-zero);
  place-items: center;
  font-size: 0.78rem;
  font-weight: 850;
}

.table-wrap {
  margin: 22px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.93rem;
}

th,
td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}

th {
  color: var(--green-dark);
  background: var(--green-pale);
  font-size: 0.76rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: #fafdfa;
}

kbd {
  display: inline-block;
  min-width: 1.8em;
  margin: 0 0.08em;
  padding: 0.12em 0.43em;
  color: #18301d;
  background: #f8fbf8;
  border: 1px solid #c8d6c9;
  border-bottom-width: 3px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82em;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
}

.definition-grid {
  display: grid;
  grid-template-columns: minmax(145px, 0.34fr) minmax(0, 1fr);
  gap: 0;
  margin: 22px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.definition-grid dt,
.definition-grid dd {
  margin: 0;
  padding: 14px 17px;
  border-bottom: 1px solid var(--line);
}

.definition-grid dt {
  color: var(--green-dark);
  background: var(--green-pale);
  font-weight: 800;
}

.definition-grid dd:nth-last-child(1),
.definition-grid dt:nth-last-child(2) {
  border-bottom: 0;
}

.quote {
  margin: 28px 0;
  padding: 5px 0 5px 26px;
  color: #29462f;
  border-left: 4px solid var(--green);
  font-size: 1.12rem;
  font-weight: 650;
}

.next-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.next-card {
  display: block;
  padding: 25px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.next-card:hover {
  color: var(--ink);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.next-card small {
  display: block;
  margin-bottom: 6px;
  color: var(--green);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-card strong {
  display: block;
  margin-bottom: 5px;
  font-size: 1.15rem;
}

.next-card span {
  color: var(--muted);
  font-size: 0.89rem;
}

details {
  margin: 12px 0;
  padding: 0 18px;
  background: var(--green-pale);
  border: 1px solid var(--line);
  border-radius: 13px;
}

summary {
  padding: 15px 0;
  color: var(--green-dark);
  cursor: pointer;
  font-weight: 800;
}

details > p {
  padding-bottom: 16px;
}

.site-footer {
  padding: 0 20px 28px;
}

.footer-shell {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  width: min(var(--content), calc(100% - 8px));
  margin: 0 auto;
  padding: 36px;
  color: #dceadc;
  background: var(--green-dark);
  border-radius: 22px;
}

.footer-shell .brand {
  color: #fff;
}

.footer-shell .brand-section {
  color: #bcd0bf;
}

.footer-copy {
  max-width: 540px;
  margin: 15px 0 0;
  color: #bcd0bf;
  font-size: 0.9rem;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 20px;
  align-content: start;
}

.footer-links a {
  color: #eff7ef;
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-meta {
  grid-column: 1 / -1;
  padding-top: 18px;
  color: #9eb8a2;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  font-size: 0.78rem;
}

@media (max-width: 1120px) {
  .top-nav {
    display: none;
  }

  .search {
    width: min(290px, 33vw);
    margin-left: auto;
  }

  .manual-grid {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .site-header {
    padding-inline: 12px;
  }

  .header-shell {
    position: relative;
    flex-wrap: wrap;
    width: 100%;
  }

  .menu-toggle {
    display: block;
  }

  .search {
    display: none;
    order: 3;
    width: 100%;
    margin: 4px 0 0;
  }

  .top-nav {
    display: none;
    order: 4;
    width: 100%;
    margin: 0;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }

  .header-shell.is-open .search,
  .header-shell.is-open .top-nav {
    display: flex;
  }

  .header-shell.is-open .top-nav {
    flex-wrap: wrap;
  }

  .page-shell {
    width: min(100% - 24px, var(--content));
    margin-top: 12px;
  }

  .hero {
    min-height: 0;
  }

  .manual-grid {
    grid-template-columns: 1fr;
  }

  .manual-sidebar {
    position: static;
  }

  .manual-sidebar .sidebar-card:first-child {
    display: none;
  }

  .manual-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .footer-shell {
    grid-template-columns: 1fr;
  }

  .footer-meta {
    grid-column: 1;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .site-header {
    padding-top: 10px;
  }

  .header-shell {
    min-height: 60px;
    gap: 8px;
    padding: 8px 10px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

  .brand-section {
    display: none;
  }

  .game-home-link {
    width: 42px;
    padding-inline: 0;
  }

  .game-home-link__label {
    display: none;
  }

  .hero,
  .page-intro,
  .article-card {
    border-radius: 18px;
  }

  .hero {
    padding: 38px 25px;
  }

  .hero h1 {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }

  .page-intro,
  .article-card {
    padding: 28px 23px;
  }

  .feature-grid,
  .card-grid,
  .stat-grid,
  .next-grid {
    grid-template-columns: 1fr;
  }

  .manual-nav,
  .toc {
    grid-template-columns: 1fr;
  }

  .definition-grid {
    grid-template-columns: 1fr;
  }

  .definition-grid dt {
    padding-bottom: 5px;
    border-bottom: 0;
  }

  .definition-grid dd {
    padding-top: 5px;
  }

  .footer-shell {
    padding: 28px 24px;
  }

  .footer-links {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
