.reference-shell { width: min(1180px, calc(100% - 48px)); }
.reference-header nav { gap: 18px; }
.reference-header nav a { color: var(--steel); font-size: 12px; font-weight: 700; text-underline-offset: 4px; }
.reference-intro { max-width: 860px; padding: 50px 0 38px; }
.reference-intro h1 { margin: 0; font-family: Bahnschrift, "Arial Narrow", "Segoe UI", sans-serif; font-size: clamp(40px, 6vw, 64px); line-height: 1; letter-spacing: -0.05em; }
.reference-intro > p:last-child { max-width: 740px; margin: 17px 0 0; color: #435e64; font-size: 15px; line-height: 1.7; }
.reference-intro a { color: var(--steel); font-weight: 700; text-underline-offset: 3px; }
.reference-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); gap: clamp(35px, 6vw, 78px); align-items: start; border-top: 1px solid var(--line); }
.reference-sidebar { position: sticky; top: 18px; padding: 25px 0; }
.reference-sidebar > strong { display: block; margin-bottom: 12px; color: #60777b; font-size: 11px; }
.reference-sidebar nav { display: grid; gap: 2px; }
.reference-sidebar nav a { padding: 7px 8px; color: #435e64; border-left: 2px solid transparent; font-size: 11px; line-height: 1.35; text-decoration: none; }
.reference-sidebar nav a:hover { color: var(--ink); background: rgba(245, 247, 242, 0.7); border-left-color: var(--cobalt); }
.reference-content { min-width: 0; }
.reference-section { scroll-margin-top: 20px; padding: 31px 0 37px; border-bottom: 1px solid var(--line); }
.reference-section .section-kicker, .reference-next .section-kicker { margin: 0 0 8px; color: var(--signal); font-size: 11px; font-weight: 800; }
.reference-section h2, .reference-next h2 { margin: 0; font-family: Bahnschrift, "Arial Narrow", "Segoe UI", sans-serif; font-size: clamp(27px, 3.5vw, 38px); line-height: 1.08; letter-spacing: -0.04em; }
.reference-section h3 { margin: 25px 0 8px; font-size: 16px; letter-spacing: -0.02em; }
.reference-section p { max-width: 780px; margin: 13px 0; color: #435e64; font-size: 13px; line-height: 1.7; }
.reference-section code { color: #314e56; font-family: Consolas, "Courier New", monospace; font-size: 0.92em; }
.reference-table-wrap { overflow-x: auto; margin: 20px 0; background: #f5f7f2; border-top: 2px solid #4a8e7f; }
.reference-table { width: 100%; min-width: 570px; border-collapse: collapse; text-align: left; }
.reference-table th, .reference-table td { padding: 11px 13px; border-bottom: 1px solid #d1ddd5; vertical-align: top; }
.reference-table th { color: #60777b; font-size: 10px; font-weight: 800; }
.reference-table td { color: #435e64; font-size: 11px; line-height: 1.45; }
.reference-table td:first-child { color: var(--ink); font-weight: 700; }
.reference-table tr:last-child td { border-bottom: 0; }
.reference-table code { white-space: nowrap; font-size: 10px; }
.code-example { margin: 18px 0; }
.code-example > span { display: block; margin-bottom: 6px; color: #60777b; font-size: 10px; font-weight: 800; }
.code-example pre { overflow-x: auto; margin: 0; padding: 13px 15px; color: #e7f0eb; background: #1b3038; font-size: 11px; line-height: 1.65; tab-size: 2; }
.code-example pre code { color: inherit; font-family: Consolas, "Courier New", monospace; font-size: inherit; }
.reference-note { padding: 11px 14px; background: #e8eee9; border-left: 3px solid var(--amber); }
.reference-steps { display: grid; gap: 10px; margin: 18px 0; padding-left: 25px; }
.reference-steps li { padding-left: 4px; color: #435e64; font-size: 13px; line-height: 1.65; }
.reference-steps li::marker { color: var(--cobalt); font-family: Consolas, monospace; font-weight: 700; }
.game-reference { padding-top: 28px; }
.game-reference .section-kicker { color: #b05a39; }
.tactic-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 25px; margin-top: 20px; border-top: 1px solid #b9c9c1; }
.tactic-list section { padding: 14px 0 12px; border-bottom: 1px solid #b9c9c1; }
.tactic-list h3 { margin: 0 0 5px; font-size: 13px; }
.tactic-list p { margin: 0; font-size: 12px; }
.reference-next { display: flex; justify-content: space-between; gap: 22px; align-items: center; margin: 36px 0 0; padding: 24px; color: #f5f7f2; background: #314e56; }
.reference-next .section-kicker { color: #9ed0bd; }
.reference-next h2 { font-size: 25px; }
.reference-next p:not(.section-kicker) { margin: 7px 0 0; color: #d3dfda; font-size: 12px; line-height: 1.5; }
.reference-button { display: inline-flex; min-width: max-content; min-height: 40px; align-items: center; justify-content: center; padding: 9px 12px; color: #1b3038; background: #e9b765; font-size: 11px; font-weight: 800; text-decoration: none; }
.reference-button:hover { background: #f2ca83; }
.reference-footer { display: flex; justify-content: space-between; gap: 15px; padding-top: 21px; color: #60777b; font-size: 11px; }
.reference-footer a { color: var(--steel); font-weight: 700; text-underline-offset: 3px; }
.reference-shell a:focus-visible { outline: 3px solid #204df5; outline-offset: 3px; }

@media (max-width: 760px) {
  .reference-shell { width: min(100% - 32px, 680px); }
  .reference-layout { grid-template-columns: 1fr; gap: 0; }
  .reference-sidebar { position: static; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .reference-sidebar > strong { margin-bottom: 8px; }
  .reference-sidebar nav { display: flex; flex-wrap: wrap; gap: 4px 7px; }
  .reference-sidebar nav a { padding: 6px 8px; border-left: 0; background: rgba(245, 247, 242, 0.7); }
  .reference-sidebar nav a:hover { border-left: 0; }
  .reference-intro { padding: 37px 0 28px; }
}

@media (max-width: 480px) {
  .reference-header { flex-wrap: wrap; gap: 9px; padding: 10px 0; }
  .reference-header nav { flex-wrap: wrap; justify-content: flex-end; gap: 8px 11px; margin-left: auto; font-size: 11px; }
  .reference-header nav a { font-size: 11px; }
  .reference-intro h1 { font-size: 42px; }
  .reference-section { padding: 26px 0 31px; }
  .tactic-list { grid-template-columns: 1fr; }
  .reference-next { align-items: flex-start; flex-direction: column; padding: 20px; }
  .reference-footer { flex-direction: column; }
}

#game-catalogues .reference-table { min-width: 0; table-layout: fixed; }
#game-catalogues .reference-table th:first-child { width: 23%; }
#game-catalogues .reference-table th:last-child { width: 25%; }
#game-catalogues .reference-table td { overflow-wrap: anywhere; }
#game-catalogues summary { cursor: pointer; padding: 9px 0; }
#game-catalogues pre { overflow-x: auto; }
