* {
  box-sizing: border-box;
}
:root {
  --ink: #202f27;
  --green: #315b42;
  --muted: #66736a;
  --line: #dce1d6;
  --cream: #f6f7f1;
  --paper: #fff;
  --sage: #e5ecd9;
  --serif: Georgia, "Times New Roman", serif;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #aa852b;
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
button:disabled {
  opacity: 0.32;
  cursor: default;
}
button:hover:not(:disabled) {
  filter: brightness(0.94);
}
[hidden] {
  display: none !important;
}
i[data-icon] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
i svg {
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
header {
  background: #203b2f;
  color: #f8faf3;
  border-bottom: 3px solid #acbd91;
}
.headwrap {
  max-width: 1380px;
  margin: auto;
  min-height: 68px;
  padding: 0 clamp(18px, 4.6vw, 72px);
  display: flex;
  gap: 48px;
  align-items: center;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  font: 600 21px var(--serif);
  padding: 0;
  white-space: nowrap;
}
.monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: linear-gradient(100deg, #547758 48%, #c3d3ad 49%);
  width: 46px;
  height: 39px;
  letter-spacing: -3px;
  padding-right: 3px;
  font: 700 27px var(--serif);
}
.monogram b:first-child {
  color: white;
}
.monogram b:last-child {
  color: black;
}
nav {
  display: flex;
  gap: 8px;
}
nav button,
.xp {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #dae5d9;
  padding: 10px 15px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
}
nav button.active {
  background: #385442;
  color: white;
}
.xp {
  margin-left: auto;
  background: #38503b;
  color: #f2d288;
  border: 1px solid #55684b;
  font-size: 13px;
}
.xp i {
  color: #ecc36b;
}
main,
footer {
  max-width: 1380px;
  margin: auto;
  padding: 0 clamp(18px, 4.6vw, 72px);
}
.heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 30px 0 22px;
}
.eyebrow {
  color: #4b684c;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.7px;
}
.rule {
  width: 24px;
  height: 2px;
  background: #7f986a;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font: 500 clamp(36px, 3.7vw, 57px) / 1.12 var(--serif);
  letter-spacing: -2.5px;
  margin: 6px 0 7px;
}
h1 span {
  color: #829967;
}
.heading p,
.lead {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.modes {
  display: flex;
  border: 1px solid #d6ddce;
  padding: 4px;
  background: #e9ede2;
  border-radius: 9px;
  gap: 2px;
}
.modes button {
  display: flex;
  gap: 7px;
  align-items: center;
  padding: 9px 15px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
}
.modes .on,
.primary {
  color: white;
  background: var(--green);
}
.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 24px;
  align-items: start;
}
.boardcard,
.studycard,
.libcard,
.stat,
.empty {
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 14px;
  box-shadow: 0 2px 6px #26372a06;
}
.boardcard {
  padding: 0 16px;
}
.boardhead,
.boardfoot,
.studycap,
.sectiontitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.boardhead {
  padding: 16px 0 13px;
}
.boardhead h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font:
    650 16px "Segoe UI",
    sans-serif;
}
.boardhead h2 i {
  color: #56704c;
}
.turn,
.chip,
.family,
.level {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  font-size: 11px;
  padding: 4px 8px;
  font-weight: 650;
}
.turn {
  background: #f2f4ee;
  color: #54614f;
}
.turn b {
  width: 9px;
  height: 9px;
  border: 1px solid #8c9689;
  border-radius: 50%;
}
.boardarea {
  display: flex;
  gap: 7px;
  align-items: stretch;
}
.board {
  position: relative;
  isolation: isolate;
  flex: 1;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  overflow: hidden;
  border-radius: 4px;
  touch-action: manipulation;
}
.sq {
  border: 0;
  padding: 0;
  min-width: 0;
  position: relative;
  background: #edeed5;
  border-radius: 0;
  color: #657d52;
  touch-action: none;
}
.sq.dark {
  background: #799567;
  color: #eef2d9;
}
.sq.last {
  background: #d7de93;
}
.sq.dark.last {
  background: #afc076;
}
.sq.selected {
  box-shadow: inset 0 0 0 4px #c8a245;
}
.sq.legal:after {
  content: "";
  position: absolute;
  background: #263e3045;
  width: 24%;
  height: 24%;
  border-radius: 100%;
  top: 38%;
  left: 38%;
  pointer-events: none;
}
.sq.legal:has(img):after {
  background: transparent;
  border: 4px solid #263e3050;
  inset: 2%;
  width: 96%;
  height: 96%;
  box-sizing: border-box;
}
.sq small {
  position: absolute;
  z-index: 2;
  line-height: 1;
  font:
    700 clamp(8px, 0.8vw, 12px) / 1 "Segoe UI",
    sans-serif;
  pointer-events: none;
}
.rank {
  left: 3px;
  top: 3px;
}
.file {
  right: 3px;
  bottom: 2px;
}
.sq img {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 1.5px 1px #26362638);
}
.sq:focus-visible {
  z-index: 3;
  outline-offset: -4px;
}
button.sq:hover {
  filter: none;
}
.sq:has(img) {
  cursor: grab;
}
.dragghost {
  position: fixed;
  pointer-events: none;
  z-index: 99;
  transform: translate(-50%, -50%);
}
#evalBar {
  width: 7px;
  border-radius: 5px;
  background: #3e4b41;
  overflow: hidden;
  position: relative;
  border: 1px solid #a5af9d;
}
#evalFill {
  display: block;
  background: #f5f3de;
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 50%;
  transition: height 0.4s;
}
#evalBar.flipped #evalFill {
  top: 0;
  bottom: auto;
}
.boardfoot {
  min-height: 49px;
}
.eng {
  display: flex;
  align-items: center;
  gap: 5px;
  font:
    600 11px "Segoe UI",
    sans-serif;
  color: var(--muted);
  min-width: 75px;
}
.transport {
  display: flex;
  gap: 3px;
}
.transport button,
.iconbutton {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: #5e6c61;
}
.transport button:hover,
.iconbutton:hover {
  background: var(--sage);
}
.studycard {
  padding: 21px 25px;
}
.studycap {
  margin-bottom: 7px;
}
.studycap .eyebrow i {
  font-size: 15px;
}
.studycard h2 {
  font: 500 clamp(27px, 2.7vw, 40px) / 1.1 var(--serif);
  letter-spacing: -1.25px;
  margin: 3px 0 10px;
}
.studycard .chip,
.libcard .chip {
  background: #e4ecd8;
  color: #44623a;
  font-family: Consolas, monospace;
}
.family {
  color: #626e62;
  background: #f1f3ed;
}
.metadata {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 15px;
}
.tabs {
  display: flex;
  gap: 20px;
  border-bottom: 1px solid var(--line);
  margin: 15px 0;
}
.tabs button {
  font-size: 13px;
  font-weight: 600;
  padding: 7px 0 10px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs button.active {
  border-color: var(--green);
  color: var(--green);
}
.callout {
  background: #eff3e8;
  border: 1px solid #dee7d4;
  border-radius: 9px;
  padding: 14px 15px;
}
.callout h3,
.smalltitle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 6px;
}
.callout h3 i {
  color: #628044;
}
.callout p,
.prose,
.moveNote {
  font-size: 14px;
  line-height: 1.55;
  color: #4a594b;
}
.subhead {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 8px;
}
.continuation {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 9px 3px;
  text-align: left;
  border-bottom: 1px solid #e6eadf;
  font-size: 13px;
}
.continuation strong,
.moveTag {
  font:
    700 13px Consolas,
    monospace;
  background: #f2f4ee;
  border: 1px solid #e2e6da;
  border-radius: 5px;
  padding: 4px 7px;
}
.continuation span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #5f6b60;
}
.continuation i {
  margin-left: auto;
}
.primary,
.secondary,
.outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 15px;
  border-radius: 7px;
  font-weight: 650;
  font-size: 14px;
}
.primary.full {
  width: 100%;
  margin-top: 16px;
}
.secondary,
.outline {
  background: #f0f3eb;
  border: 1px solid var(--line);
}
.outline {
  background: white;
}
.featured {
  padding: 25px 0;
}
.sectiontitle {
  margin-bottom: 13px;
}
.sectiontitle h2,
.pageTitle {
  font: 500 26px var(--serif);
  letter-spacing: -0.8px;
}
.textbtn {
  color: var(--green);
  font-size: 13px;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.libcard {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  padding: 14px;
  min-width: 0;
}
.mini {
  width: 68px;
  height: 68px;
  flex: none;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border-radius: 4px;
  overflow: hidden;
  background: #eaeed9;
}
.mini b {
  position: relative;
}
.mini b.dark {
  background: #8ba17b;
}
.mini img {
  width: 100%;
  height: 100%;
  display: block;
}
.libcard strong {
  display: block;
  font: 600 17px/1.2 var(--serif);
  margin-bottom: 6px;
}
.libcard .info {
  min-width: 0;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.libcard .muted {
  font-size: 11px;
}
.libcard .chip {
  font-size: 10px;
  padding: 2px 5px;
  margin-right: 4px;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #697466;
  font-size: 12px;
  margin-top: 16px;
  padding-bottom: 23px;
}
footer strong {
  font-family: var(--serif);
  margin-right: 6px;
}
footer button {
  font-size: 12px;
  text-decoration: underline;
}
.moves {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 12px;
}
.moves button {
  border-radius: 4px;
  background: #eef1e9;
  padding: 5px 7px;
  font:
    13px Consolas,
    monospace;
}
.moves button.active {
  background: #d2dfbe;
}
.moves button span {
  color: #687763;
}
.notice {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
  color: #526747;
}
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.progressbar {
  height: 6px;
  background: #e4e9dc;
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 14px;
}
.progressbar span {
  display: block;
  height: 100%;
  background: #6a8a55;
}
.studycard select,
.filters input,
.filters select {
  border: 1px solid #c9d2c3;
  background: white;
  color: var(--ink);
  padding: 9px;
  border-radius: 7px;
}
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin: 0 0 14px;
}
.filters input {
  flex: 1;
  min-width: 165px;
}
.empty,
.stat {
  padding: 22px;
}
.stat b {
  display: block;
  font: 34px var(--serif);
  margin-bottom: 5px;
}
.stat span {
  font-size: 13px;
  color: var(--muted);
}
.collection {
  margin-bottom: 20px;
}
.more {
  display: block;
  margin: 18px auto;
}
.activeSave {
  color: #456c36;
  background: #e3ecd8;
}
.activeSave svg {
  fill: currentColor;
}
dialog {
  max-width: min(92vw, 530px);
  max-height: 80vh;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  color: var(--ink);
}
dialog::backdrop {
  background: #14271dcc;
}
dialog h2,
dialog h3 {
  font-family: var(--serif);
  margin: 0 0 10px;
}
dialog p {
  line-height: 1.55;
  margin-bottom: 12px;
}
dialog a {
  color: var(--green);
}
#announce {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background: #203b2f;
  color: white;
  border-radius: 8px;
  padding: 10px 16px;
  box-shadow: 0 3px 12px #0002;
  z-index: 20;
  max-width: 90vw;
  font-size: 14px;
}
#announce:empty {
  display: none;
}
.studycard .smalltitle {
  margin-top: 14px;
}
.history {
  max-height: 240px;
  overflow: auto;
}
.response {
  border-left: 3px solid #94a975;
  padding: 3px 10px;
  margin: 12px 0;
}
.quiet {
  font-size: 12px;
  color: var(--muted);
}
.filtercount {
  margin: 5px 0 12px;
}
.pagepad {
  padding-top: 20px;
}
.studycard .primary i:last-child {
  margin-left: auto;
}
.studycard .primary.full {
  justify-content: flex-start;
}
.studycard .secondary {
  font-size: 13px;
}
#progress .sectiontitle {
  margin-top: 24px;
}
.tinybtn {
  font-size: 12px;
  color: var(--green);
  font-weight: 650;
  text-decoration: underline;
}
.savedCheck {
  color: var(--green);
}
@media (min-width: 1250px) {
  .workspace {
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  }
  .boardcard {
    max-width: 645px;
  }
  .studycard {
    padding: 25px 30px;
  }
  .continuation {
    padding: 12px 3px;
  }
  .callout {
    padding: 18px;
  }
  .studycap {
    margin-bottom: 12px;
  }
  .heading {
    padding-top: 33px;
    padding-bottom: 25px;
  }
}
@media (max-width: 900px) {
  .headwrap {
    gap: 20px;
  }
  .workspace {
    gap: 14px;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  }
  .boardcard {
    padding: 0 10px;
  }
  .studycard {
    padding: 15px;
  }
  .cards {
    gap: 8px;
  }
  .libcard {
    padding: 10px;
    gap: 8px;
  }
  .mini {
    width: 54px;
    height: 54px;
  }
  .brand {
    font-size: 18px;
  }
}
@media (max-width: 720px) {
  .headwrap {
    padding: 9px 14px;
    gap: 8px;
    min-height: 56px;
  }
  .brand > span:last-child {
    display: none;
  }
  nav {
    gap: 0;
  }
  nav button {
    font-size: 13px;
    padding: 8px;
  }
  nav i {
    display: none !important;
  }
  .xp {
    padding: 7px 8px;
  }
  .heading {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 21px 0 15px;
  }
  .heading p {
    font-size: 14px;
  }
  .workspace {
    grid-template-columns: 1fr;
  }
  .modes button {
    padding: 7px 13px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .studycard {
    padding: 18px;
  }
  .mini {
    width: 58px;
    height: 58px;
  }
  .boardcard {
    padding: 0 10px;
  }
  .boardhead {
    padding: 12px 0 10px;
  }
  .boardfoot {
    min-height: 43px;
  }
  .sectiontitle h2 {
    font-size: 23px;
  }
  .eng {
    font-size: 10px;
    min-width: 60px;
  }
  .stats {
    grid-template-columns: repeat(3, 1fr);
  }
  .stat {
    padding: 14px 8px;
  }
  .stat b {
    font-size: 26px;
  }
  .turn {
    font-size: 10px;
  }
  .libcard strong {
    font-size: 18px;
  }
  .eyebrow {
    font-size: 9px;
  }
  h1 {
    letter-spacing: -1.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
