:root {
  color-scheme: light;
  --paper: #f3f2ec;
  --surface: #fafaf6;
  --ink: #20281f;
  --muted: #5f685d;
  --line: #d6dbd0;
  --green: #3b6138;
  --light-green: #b8c9aa;
  --plot-height: 225px;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
a {
  color: inherit;
  text-underline-offset: 4px;
}
button,
input,
select {
  font: inherit;
}
button,
select,
input[type='range'] {
  cursor: pointer;
}
button {
  color: inherit;
}
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.wrap {
  width: min(1240px, calc(100% - 80px));
  margin-inline: auto;
}
.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  padding: 12px;
  background: var(--surface);
  z-index: 10;
}
.skip:focus {
  top: 12px;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 76px;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}
.brand > span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 34px;
  border-radius: 4px;
  background: var(--ink);
  color: #e0f1b9;
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 400;
}
nav {
  display: flex;
  gap: 25px;
  font-size: 13px;
}
nav a {
  text-decoration: none;
  color: var(--muted);
}
nav a:hover {
  color: var(--ink);
  text-decoration: underline;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 20px;
  margin: 37px 0 28px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(30px, 3.2vw, 43px);
  font-weight: 400;
  letter-spacing: -1.2px;
  line-height: 1.15;
}
.page-heading p {
  color: var(--muted);
  font-size: 15px;
  margin-top: 10px;
  line-height: 1.45;
}
.game-label {
  font: 10px monospace;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 3px;
  white-space: nowrap;
}
.calculator {
  display: grid;
  grid-template-columns: 255px minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
}
.controls {
  padding: 25px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  border-right: 1px solid var(--line);
  background: #edeee6;
}
.control-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.control-heading h2 {
  font-size: 14px;
  font-weight: 600;
}
.control-heading button {
  border: 0;
  background: none;
  padding: 4px 0 4px 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--muted);
  font-size: 12px;
}
.field {
  min-width: 0;
}
.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
.field output {
  font-size: 13px;
  color: var(--green);
  font-variant-numeric: tabular-nums;
}
select {
  width: 100%;
  min-height: 37px;
  border: 1px solid #bdc5b6;
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  padding: 7px 23px 7px 9px;
  font-size: 12px;
  text-overflow: ellipsis;
}
input[type='range'] {
  width: 100%;
  height: 24px;
  accent-color: var(--green);
  margin: 0;
}
.control-note {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted);
}
.results {
  min-width: 0;
  padding: 29px 32px 23px;
}
.statistics {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  gap: 24px;
  min-height: 122px;
  align-items: center;
}
.statistics > div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.statistics strong {
  font-variant-numeric: tabular-nums;
  font-weight: 400;
  display: block;
  letter-spacing: -1.5px;
  line-height: 1.15;
  margin: 5px 0;
}
.primary-stat strong {
  font-size: clamp(42px, 4.5vw, 62px);
  color: var(--green);
}
.primary-stat strong span {
  font-size: 0.5em;
  letter-spacing: -1px;
}
.secondary-stat {
  border-left: 1px solid var(--line);
  padding-left: 24px;
}
.secondary-stat strong {
  font-size: 36px;
}
.statistics p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.chart-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 28px 0 24px;
}
.chart-heading h2 {
  font-size: 14px;
  font-weight: 600;
}
.chart-heading span {
  font-size: 11px;
  color: var(--muted);
}
.chart-scroll {
  overflow-x: auto;
  padding: 21px 2px 1px;
}
.plot {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  min-width: calc(34px + var(--columns, 10) * 28px);
}
.y-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: var(--plot-height);
  font-size: 10px;
  color: var(--muted);
  transform: translateY(-5px);
}
.chart {
  display: grid;
  grid-template-columns: repeat(var(--columns, 10), minmax(0, 1fr));
  gap: 8px;
  position: relative;
  height: calc(var(--plot-height) + 28px);
  background: repeating-linear-gradient(
    to top,
    transparent 0,
    transparent calc(25% - 1px),
    #e7e9e1 calc(25% - 1px),
    #e7e9e1 25%
  );
  background-size: 100% var(--plot-height);
  background-repeat: no-repeat;
}
.reference-line {
  position: absolute;
  inset: calc(var(--plot-height) / 4) 0 auto;
  border-top: 1px dashed #a4ae9b;
  pointer-events: none;
}
.chart-column {
  position: relative;
  display: grid;
  grid-template-rows: var(--plot-height) 28px;
  gap: 0;
  border: 0;
  background: transparent;
  padding: 0;
  min-width: 0;
  text-align: center;
}
.bar-area {
  display: flex;
  align-items: end;
  height: var(--plot-height);
  border-bottom: 1px solid #b6bfad;
}
.chart-bar {
  width: 100%;
  height: max(2px, var(--bar-height, 0%));
  position: relative;
  background: var(--light-green);
  border-radius: 3px 3px 0 0;
  transition:
    height 250ms ease,
    background 150ms ease;
}
.chart-value {
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.turn-label {
  display: grid;
  place-items: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 5px;
  border-radius: 3px;
}
.chart-column[aria-pressed='true'] .chart-bar {
  background: var(--green);
}
.chart-column[aria-pressed='true'] .chart-value {
  color: var(--green);
  font-weight: 700;
}
.chart-column[aria-pressed='true'] .turn-label {
  background: var(--green);
  color: white;
}
.chart-column:hover .chart-bar {
  background: #729366;
}
.chart-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}
.chart-footer span:last-child {
  white-space: nowrap;
}
.chart-footer i {
  display: inline-block;
  width: 14px;
  margin-right: 4px;
  border-top: 1px dashed #89947f;
  vertical-align: middle;
}
.assumption-note {
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}
details {
  border-bottom: 1px solid var(--line);
}
summary {
  cursor: pointer;
  padding: 20px 0;
  font-size: 13px;
}
summary::marker {
  color: var(--green);
}
.method-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) 2fr;
  gap: 45px;
  padding: 8px 0 28px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
caption {
  text-align: left;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  margin-bottom: 15px;
}
th,
td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  text-align: right;
}
th:first-child {
  text-align: left;
}
tbody th {
  font-weight: 400;
}
tr.selected {
  background: #e0e9d8;
}
.method-copy p {
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 15px;
  color: var(--muted);
}
.method-copy .formula {
  overflow-wrap: anywhere;
  font: 12px/1.8 monospace;
  color: var(--ink);
}
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  padding: 39px 0 30px;
}
.about h2 {
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  margin-bottom: 14px;
}
.about p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.75;
  margin-top: 10px;
}
.source-label {
  font: 10px monospace;
  color: var(--muted);
  letter-spacing: 1px;
}
.source h3 {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  margin-top: 10px;
}
.source h3 a {
  text-decoration-color: #a7b19d;
}
.source h3 a:hover {
  text-decoration-color: var(--ink);
}
.film {
  border-top: 1px solid var(--line);
}
.film summary span {
  font-size: 11px;
  color: var(--muted);
  margin-left: 12px;
}
.film video {
  display: block;
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  background: var(--ink);
  border-radius: 6px;
}
.film > p {
  font-size: 11px;
  color: var(--muted);
  margin: 12px 0 20px;
}
footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding-block: 27px;
}
footer > span {
  font-size: 12px;
}
footer p {
  font-size: 10px;
  line-height: 1.6;
  color: var(--muted);
}
@media (min-width: 1440px) {
  .calculator {
    grid-template-columns: 270px minmax(0, 1fr);
  }
}
@media (max-width: 1000px) {
  .wrap {
    width: calc(100% - 48px);
  }
  .calculator {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .controls {
    padding: 22px 18px;
  }
  .results {
    padding: 24px 22px;
  }
  .statistics {
    gap: 15px;
  }
  .secondary-stat {
    padding-left: 15px;
  }
  .secondary-stat strong {
    font-size: 29px;
  }
  .game-label {
    display: none;
  }
}
@media (max-width: 800px) {
  :root {
    --plot-height: 180px;
  }
  .masthead {
    height: 62px;
  }
  .page-heading {
    margin: 25px 0 23px;
  }
  .calculator {
    display: flex;
    flex-direction: column;
  }
  .controls {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px 24px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 18px 22px;
  }
  .control-heading {
    grid-column: 1 / -1;
  }
  .control-note {
    grid-column: 1 / -1;
    font-size: 10px;
  }
  .field label {
    margin-bottom: 7px;
  }
  .results {
    padding: 22px;
  }
  .statistics {
    min-height: 108px;
    grid-template-columns: 1.25fr 1fr 1fr;
  }
  .primary-stat strong {
    font-size: 49px;
  }
  .chart-heading {
    margin-top: 20px;
  }
  .about {
    gap: 35px;
  }
}
@media (max-width: 520px) {
  .wrap {
    width: calc(100% - 32px);
  }
  nav {
    gap: 18px;
    font-size: 12px;
  }
  .brand {
    font-size: 15px;
  }
  .brand > span {
    width: 26px;
    height: 29px;
    font-size: 23px;
  }
  .page-heading {
    margin-top: 22px;
  }
  h1 {
    font-size: 32px;
  }
  .page-heading p {
    font-size: 13px;
  }
  .controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 16px;
    gap: 16px 20px;
  }
  .results {
    padding: 20px 15px;
  }
  .statistics {
    gap: 10px;
    align-items: start;
    min-height: 104px;
  }
  .statistics > div > span {
    font-size: 10px;
    min-height: 28px;
  }
  .statistics strong {
    letter-spacing: -1px;
  }
  .primary-stat strong {
    font-size: 37px;
  }
  .secondary-stat {
    padding-left: 10px;
  }
  .secondary-stat strong {
    font-size: 29px;
    line-height: 1.47;
  }
  .statistics p {
    font-size: 10px;
  }
  .chart-heading {
    margin: 17px 0 22px;
  }
  .chart-heading h2 {
    font-size: 13px;
  }
  .chart-heading span {
    font-size: 10px;
  }
  .chart {
    gap: 5px;
  }
  .chart-value {
    font-size: 9px;
  }
  .chart-footer {
    font-size: 9px;
  }
  .assumption-note {
    font-size: 10px;
    margin-top: 16px;
  }
  .about,
  .method-grid {
    grid-template-columns: 1fr;
    gap: 26px;
  }
  .about {
    padding-top: 28px;
  }
  .film summary {
    font-size: 12px;
  }
  .film summary span {
    display: block;
    margin: 7px 0 0 15px;
  }
  footer {
    align-items: start;
  }
  footer p {
    max-width: 230px;
    font-size: 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
