:root {
  --paper: #f7f8f3;
  --white: #fff;
  --ink: #233a30;
  --body: #55675e;
  --muted: #8c998f;
  --line: #e3e9df;
  --green: #36684e;
  --green-dark: #244e39;
  --sage: #eaf1e6;
  --red: #b84b3b;
  --gold: #e3b857;
  --board: #efe5cd;
  --ui: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --chess: "KaiTi", "STKaiti", "Kaiti SC", serif;
  --shadow: 0 8px 28px #324a3510;
}
* {
  box-sizing: border-box;
}
html {
  scrollbar-gutter: stable;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px/1.6 var(--ui);
  -webkit-font-smoothing: antialiased;
}
button,
input {
  font: inherit;
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
button,
a {
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid #8ba77a;
  outline-offset: 4px;
}
button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin: 0;
}
[hidden] {
  display: none !important;
}
.icon-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.sr-only {
  position: absolute;
  clip: rect(0, 0, 0, 0);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.site-header {
  height: 86px;
  border-bottom: 1px solid var(--line);
  background: #fafbf7;
}
.header-inner {
  max-width: 1240px;
  margin: auto;
  padding: 0 36px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: 1px;
  flex-shrink: 0;
}
.brand-seal {
  width: 42px;
  height: 44px;
  border: 1px solid #b5654d;
  background: #b75a44;
  color: #fff4e0;
  font: 30px/1.4 var(--chess);
  text-align: center;
  border-radius: 9px 3px 9px 3px;
  box-shadow:
    inset 0 0 0 3px #b75a44,
    inset 0 0 0 4px #f8e9d155;
}
.brand small {
  display: block;
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 2px;
  color: var(--muted);
  margin-top: 1px;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 100%;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 17px;
  border-radius: 8px;
  color: #748376;
  font-size: 13px;
  white-space: nowrap;
  transition: background 0.15s;
}
.nav-item:hover {
  background: #edf1e7;
}
.nav-item.active {
  color: var(--green-dark);
  background: #eaf0e5;
  font-weight: 600;
}
.nav-item svg {
  width: 17px;
  height: 17px;
}
.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: #7c8b7c;
  white-space: nowrap;
}
.status-dot {
  width: 6px;
  height: 6px;
  background: #709368;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.connection.offline .status-dot {
  background: #ca9e55;
}
.workspace {
  max-width: 1152px;
  padding: 35px 24px 20px;
  margin: auto;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin: 0 0 28px;
}
.eyebrow {
  font-family: Georgia, serif;
  font-size: 9px;
  letter-spacing: 2.1px;
  color: #8a9a86;
  margin-bottom: 8px;
}
.page-heading h1 {
  font-size: 29px;
  font-weight: 500;
  letter-spacing: 1px;
  line-height: 1.5;
}
.page-heading p {
  font-size: 12px;
  color: #889487;
  margin-top: 6px;
}
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  border-radius: 8px;
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 600;
  transition:
    background 0.15s,
    transform 0.15s;
}
.button:active:not(:disabled) {
  transform: translateY(1px);
}
.button.primary {
  background: var(--green);
  color: white;
}
.button.primary:hover {
  background: var(--green-dark);
}
.button.secondary {
  background: #fff;
  border: 1px solid #dbe4d5;
  box-shadow: 0 2px 4px #31422b04;
}
.button.secondary:hover {
  background: #f0f4e9;
}
.button .arrow {
  margin-left: 14px;
  width: 16px;
}
.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 40px;
  align-items: start;
}
.board-section {
  min-width: 0;
  max-width: 660px;
}
.board-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 4px 12px;
}
.caption-tag {
  font-size: 11px;
  letter-spacing: 1px;
  color: #75846e;
  display: flex;
  align-items: center;
  gap: 7px;
}
.caption-tag:before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #8ca482;
}
.round-label {
  font: 10px var(--ui);
  color: #91a088;
  letter-spacing: 1px;
}
.player-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 4px;
}
.player-row.opponent {
  margin-bottom: 13px;
}
.avatar {
  width: 37px;
  height: 37px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.avatar svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.engine-avatar {
  background: #e8ede4;
  color: #62765d;
}
.self-avatar {
  background: #f3e8de;
  color: #b4614d;
  font-size: 16px;
}
.player-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.player-info strong {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.player-info > span {
  font-size: 10px;
  color: #9aa38e;
}
.small-tag {
  font: 8px/1.5 var(--ui);
  border: 1px solid #d1dcce;
  border-radius: 4px;
  color: #86977d;
  padding: 0 4px;
  letter-spacing: 1px;
}
.player-status {
  font-size: 10px;
  letter-spacing: 1px;
  color: #95a189;
  margin-left: auto;
}
.player-status.thinking {
  color: var(--green);
  animation: breathe 1.6s infinite;
}
.board-frame {
  background: #e4dbc4;
  padding: 13px;
  border-radius: 10px;
  box-shadow:
    0 10px 24px #6d6d3b13,
    inset 0 0 0 1px #c9ba991f;
  position: relative;
}
.board-frame:before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid #c9b98d63;
  border-radius: 6px;
  pointer-events: none;
}
.board-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 9/10;
  background: #f1e7cf;
  background-image:
    radial-gradient(ellipse at 25% 10%, #fbf3e052, transparent 68%),
    repeating-linear-gradient(0deg, #aa8f5603 0 1px, transparent 1px 6px);
  border: 1px solid #c9b98d67;
  touch-action: none;
  border-radius: 3px;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  -webkit-user-select: none;
}
.board-lines,
.board-arrows,
.piece-layer,
.board-markers,
.board-hitgrid {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.board-lines {
  z-index: 0;
}
.board-markers {
  z-index: 1;
  pointer-events: none;
}
.piece-layer {
  z-index: 2;
  pointer-events: none;
}
.board-arrows {
  z-index: 3;
  pointer-events: none;
}
.board-hitgrid {
  z-index: 4;
}
.hit-cell {
  position: absolute;
  width: 11.111%;
  height: 10%;
  padding: 0;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.hit-cell:focus-visible {
  outline: 2px dashed #577349;
  outline-offset: -5px;
}
.piece {
  position: absolute;
  width: 9.3%;
  aspect-ratio: 1;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle at 33% 22%, #fffaf0, #f6edd7 65%, #dccaa5);
  box-shadow:
    0 3px 0 #bea77e,
    0 5px 7px #78694425,
    inset 0 1px 2px #fff;
  border: 1px solid #cbb990;
  color: #313c33;
  font-family: var(--chess);
  font-weight: 700;
  font-size: clamp(20px, 2.5vw, 35px);
  line-height: 1;
  transition:
    left 0.24s cubic-bezier(0.22, 0.65, 0.3, 1),
    top 0.24s cubic-bezier(0.22, 0.65, 0.3, 1),
    opacity 0.2s,
    transform 0.2s;
  will-change: left, top;
}
.piece:before {
  content: "";
  position: absolute;
  inset: 7.5%;
  border: 1px solid #9e8d6652;
  border-radius: 50%;
}
.piece.red {
  color: var(--red);
}
.piece.red:before {
  border-color: #b95c4855;
}
.piece.selected {
  box-shadow:
    0 0 0 3px #739060,
    0 3px 0 #baa67d,
    0 7px 12px #5c653940;
  transform: translate(-50%, -53%);
  z-index: 4;
}
.piece.checked {
  box-shadow:
    0 0 0 3px #bd645280,
    0 3px 0 #baa67d;
}
.piece.dragging {
  transition: none;
  z-index: 6;
  transform: translate(-50%, -60%) scale(1.07);
  filter: drop-shadow(0 9px 5px #62543140);
}
.piece.departing {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.65);
  z-index: 0;
}
.piece.appearing {
  animation: pieceAppear 0.24s ease-out;
}
.board-inner.turning .piece {
  transition-duration: 0.45s;
}
.legal-marker,
.last-marker {
  position: absolute;
  width: 11.11%;
  height: 10%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
}
.legal-marker:after {
  content: "";
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #6c885a;
  box-shadow: 0 0 0 5px #78926513;
}
.legal-marker.capture:after {
  width: 90%;
  background: transparent;
  border: 2px solid #74945c;
  box-shadow: none;
}
.last-marker:after {
  content: "";
  width: 85%;
  height: 85%;
  border: 1.5px solid #8f9d6860;
  border-radius: 7px;
  background: #9fa87016;
}
.last-marker.from:after {
  width: 18%;
  height: 18%;
  border: 0;
  background: #9ba575;
  border-radius: 50%;
}
.player-row.self {
  margin-top: 17px;
}
.side-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #33483c;
}
.side-dot.red-dot {
  background: #bd6754;
}
.turn-badge {
  margin-left: auto;
  border-radius: 6px;
  background: #e8f0e1;
  color: #5e7a4f;
  padding: 6px 10px;
  font-size: 11px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.turn-badge.busy {
  background: #eeeade;
  color: #9c906c;
}
.turn-badge.busy .status-dot {
  background: #b9a377;
}
.turn-badge.reviewing {
  background: #e7ecec;
  color: #748985;
}
.board-toolbar {
  border-top: 1px solid var(--line);
  margin-top: 19px;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 4px;
}
.toolbar-group {
  display: flex;
  gap: 14px;
}
.tool-button {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #869079;
  font-size: 11px;
  padding: 5px 2px;
  border-radius: 4px;
}
.tool-button:hover {
  color: var(--green-dark);
}
.tool-button svg {
  width: 16px;
  height: 16px;
}
.board-footnote {
  margin: 13px 0 0;
  text-align: center;
  font-size: 10px;
  color: #9ca58f;
}
.tiny-key {
  margin-right: 6px;
  color: #809174;
}
.side-rail {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding-top: 1px;
}
.coach-card {
  border: 1px solid #dfe7d9;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(130deg, #f2f6ec, #f6f9f1);
  padding: 22px;
  box-shadow: 0 4px 15px #42613b05;
}
.coach-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.coach-icon {
  display: grid;
  place-items: center;
  background: #e2ecd9;
  border: 1px solid #d7e3cb;
  border-radius: 10px;
  width: 37px;
  height: 37px;
  color: #5d7b4c;
}
.coach-icon svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 1.4;
  fill: none;
}
.coach-head h2 {
  font-size: 14px;
  font-weight: 600;
}
.coach-head p {
  font-size: 10px;
  color: #99a28b;
  margin-top: 1px;
}
.coach-label {
  font-size: 9px;
  margin-left: auto;
  color: #9aa68c;
  padding: 2px 5px;
  border: 1px solid #dae5d2;
  border-radius: 4px;
}
.quota-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 17px 0 16px;
  border-bottom: 1px solid #dfe8d5;
  margin-bottom: 18px;
  font-size: 10px;
  color: #829078;
}
.quota-display {
  display: flex;
  align-items: center;
  gap: 5px;
}
.quota-display i {
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  background: #96af7f;
  border-radius: 1px;
}
.quota-display i.used {
  background: #dce4d3;
}
.quota-display strong {
  font: 600 14px/1 var(--ui);
  color: #5b7750;
  margin-left: 7px;
}
.quota-display strong span {
  font-weight: 400;
  font-size: 10px;
  color: #a1ad94;
}
.section-kicker {
  color: #8b9d7c;
  font-size: 9px;
  letter-spacing: 1px;
}
.coach-content {
  min-height: 118px;
}
.coach-content h3 {
  font-size: 16px;
  letter-spacing: 0.3px;
  font-weight: 500;
  line-height: 1.5;
  margin: 8px 0;
}
.coach-content p {
  font-size: 11px;
  line-height: 1.95;
  color: #859077;
}
.coach-content .coach-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 9px;
  font-size: 9px;
  color: #98a68b;
}
.coach-content .analysis-tag {
  background: #e5eddc;
  border-radius: 3px;
  padding: 2px 5px;
  color: #718c5d;
}
.hint-button {
  width: 100%;
  background: #e9b95e;
  color: #644a1e;
  font-size: 11px;
  border: 1px solid #d9b15a;
  box-shadow: 0 3px 0 #d6b06435;
  margin-top: 10px;
  min-height: 45px;
}
.hint-button:hover {
  background: #e3b04f;
}
.hint-button svg {
  width: 16px;
  height: 16px;
}
.hint-button .arrow {
  margin-left: auto;
  width: 14px;
}
.apply-hint {
  width: 100%;
  margin-top: 8px;
  min-height: 38px;
  font-size: 11px;
}
.honest-note {
  text-align: center;
  margin-top: 10px;
  font-size: 9px;
  color: #9b9f85;
  line-height: 1.6;
}
.move-card {
  background: #fffefa;
  border: 1px solid #e3e7dc;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px #42613b04;
}
.card-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px 14px;
}
.card-heading h2 {
  font-size: 13px;
  font-weight: 600;
}
.muted {
  font-size: 10px;
  color: #a1a891;
}
.move-columns {
  display: grid;
  grid-template-columns: 45px 1fr 1fr;
  gap: 8px;
  font-size: 9px;
  color: #96a089;
  background: #f6f7f0;
  padding: 8px 20px;
  border-top: 1px solid #eef0e7;
  border-bottom: 1px solid #eef0e7;
}
.move-list {
  height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #dce3d2 transparent;
  padding: 6px 12px;
}
.empty-moves {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #c3ccb6;
}
.empty-moves svg {
  width: 30px;
  height: 30px;
  stroke: currentColor;
  stroke-width: 1.2;
  fill: none;
  margin-bottom: 10px;
}
.empty-moves p {
  font-size: 11px;
  color: #a3ac94;
}
.empty-moves span {
  font-size: 10px;
  color: #b7beaa;
  margin-top: 3px;
}
.move-row {
  display: grid;
  grid-template-columns: 45px 1fr 1fr;
  gap: 8px;
  align-items: center;
  min-height: 32px;
  padding: 0 8px;
  font-size: 11px;
}
.move-number {
  font:
    10px Georgia,
    serif;
  color: #b0b7a0;
}
.move-cell {
  font-size: 11px;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 4px;
  border-radius: 4px;
  padding: 5px 7px;
  white-space: nowrap;
  position: relative;
}
.move-cell:hover {
  background: #f3f5ec;
}
.move-cell.active {
  background: #eaf0e2;
  color: #4e6c3d;
}
.move-cell.red {
  color: #aa6555;
}
.move-cell .assisted {
  width: 4px;
  height: 4px;
  background: #c8a450;
  transform: rotate(45deg);
}
.replay-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 18px;
  border-top: 1px solid #ecefe4;
}
.replay-controls button {
  width: 26px;
  height: 26px;
  border-radius: 4px;
  font: 13px system-ui;
  color: #8d9c80;
  display: grid;
  place-items: center;
}
.replay-controls button:hover {
  background: #eff3e6;
}
.replay-controls svg {
  width: 13px;
  height: 13px;
}
.replay-controls .rotate {
  transform: rotate(180deg);
}
.replay-controls span {
  font-size: 9px;
  color: #9ca68d;
}
.move-footer {
  border-top: 1px solid #ecefe4;
  padding: 10px 19px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.move-footer button {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  color: #839573;
  padding: 0;
}
.move-footer button svg {
  width: 13px;
  height: 13px;
}
.move-footer > span {
  font-size: 9px;
  color: #b0b7a1;
}
.learning-note {
  display: flex;
  gap: 10px;
  padding: 0 5px;
}
.learning-icon {
  width: 28px;
  flex-shrink: 0;
  color: #96a586;
  padding-top: 2px;
}
.learning-icon svg {
  width: 23px;
  height: 23px;
  stroke: currentColor;
  stroke-width: 1.15;
  fill: none;
}
.learning-note strong {
  font-weight: 400;
  color: #8e9b7f;
  font-size: 10px;
}
.learning-note p {
  font-size: 9px;
  color: #adb59e;
  line-height: 1.8;
  margin-top: 4px;
}
.site-footer {
  max-width: 1104px;
  margin: 18px auto 0;
  border-top: 1px solid var(--line);
  padding: 18px 0 23px;
  font-size: 9px;
  letter-spacing: 0.15px;
  color: #a6af9d;
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.site-footer b {
  font-weight: 400;
  color: #8b9a7d;
}
.site-footer i {
  display: inline-block;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #b7c0aa;
  vertical-align: middle;
  margin: 0 8px;
}
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 21px;
  color: #fff;
  background: #344e3f;
  border: 1px solid #71846530;
  border-radius: 9px;
  box-shadow: 0 8px 25px #1d352128;
  z-index: 30;
  font-size: 12px;
  max-width: calc(100% - 32px);
  text-align: center;
  animation: toastIn 0.2s ease-out;
}
.collection-tag {
  font-size: 11px;
  color: #879776;
  border: 1px solid #dce5d2;
  padding: 7px 13px;
  border-radius: 6px;
  white-space: nowrap;
}
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 35px;
}
.puzzle-card {
  border: 1px solid #dde5d5;
  background: #fffefa;
  border-radius: 13px;
  padding: 22px;
  position: relative;
}
.puzzle-card .puzzle-number {
  font: italic 25px Georgia;
  color: #bbc6ae;
}
.puzzle-card .puzzle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.puzzle-level {
  font-size: 9px;
  color: #a39b70;
  letter-spacing: 1px;
}
.mini-board {
  aspect-ratio: 9/10;
  background: #efe7d3;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}
.mini-board svg {
  position: absolute;
  width: 100%;
  height: 100%;
}
.mini-board .mini-piece {
  position: absolute;
  display: grid;
  place-items: center;
  width: 9.3%;
  aspect-ratio: 1;
  background: #fcf5e3;
  border: 1px solid #bdaa7e;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  font: 700 18px var(--chess);
  color: #364233;
  box-shadow: 0 2px 0 #bdaa7e;
}
.mini-board .mini-piece.red {
  color: var(--red);
}
.puzzle-card h2 {
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 1px;
}
.puzzle-card p {
  font-size: 11px;
  color: #959f89;
  line-height: 1.8;
  margin: 9px 0 18px;
  min-height: 40px;
}
.puzzle-card .button {
  width: 100%;
}
.puzzle-card.completed {
  border-color: #b9cda8;
}
.section-note {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 30px 0;
  font-size: 11px;
  color: #9da88f;
  line-height: 1.8;
}
.section-note svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.3;
  flex-shrink: 0;
}
.library-list {
  display: grid;
  gap: 12px;
  margin: 35px 0;
}
.library-item {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fffefa;
  border: 1px solid #e1e7d8;
  border-radius: 9px;
  padding: 18px 22px;
}
.library-symbol {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #ecf1e5;
  font: 25px/42px var(--chess);
  text-align: center;
  color: #829972;
}
.library-info {
  flex: 1;
}
.library-info h2 {
  font-size: 14px;
  font-weight: 500;
}
.library-info p {
  font-size: 10px;
  color: #9ca58f;
  margin-top: 4px;
}
.library-result {
  font-size: 10px;
  background: #edf1e7;
  color: #879974;
  padding: 4px 8px;
  border-radius: 4px;
}
.library-empty {
  text-align: center;
  padding: 65px 25px;
  background: #f0f4e9;
  border: 1px dashed #d6dfcb;
  border-radius: 12px;
}
.library-empty h2 {
  font-size: 19px;
  font-weight: 500;
}
.library-empty p {
  font-size: 12px;
  color: #99a28d;
  margin: 10px 0 20px;
}
dialog {
  border: 1px solid #dde4d3;
  border-radius: 15px;
  background: #fdfef9;
  color: var(--ink);
  padding: 30px;
  width: min(470px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  box-shadow: 0 30px 100px #152c2940;
}
dialog::backdrop {
  background: #213c3050;
  backdrop-filter: blur(4px);
}
.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 15px;
}
.dialog-header h2 {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.7px;
}
.dialog-header .eyebrow {
  font-size: 8px;
}
.icon-button {
  display: grid;
  place-items: center;
  padding: 4px;
  color: #91a084;
}
.icon-button svg {
  width: 20px;
  height: 20px;
}
.dialog-intro {
  font-size: 11px;
  line-height: 1.8;
  color: #939e85;
  margin: 12px 0 21px;
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 19px;
}
legend {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 9px;
}
.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
fieldset label {
  position: relative;
  cursor: pointer;
}
fieldset input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
fieldset label:has(input:focus-visible) > span {
  outline: 3px solid #9cb487;
  outline-offset: 2px;
}
fieldset label > span {
  display: block;
  background: #f5f7ef;
  border: 1px solid #dfe5d6;
  border-radius: 7px;
  padding: 11px 12px;
  text-align: left;
}
fieldset label:has(input:checked) > span {
  border-color: #88a573;
  background: #eaf1e2;
  box-shadow: inset 0 0 0 1px #88a57335;
}
fieldset b {
  font-size: 12px;
  font-weight: 500;
}
fieldset small {
  display: block;
  font-size: 9px;
  color: #93a085;
  margin-top: 3px;
}
.red-text {
  color: var(--red);
}
.difficulty-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.difficulty-options label > span {
  padding: 9px 3px;
  text-align: center;
  font-size: 11px;
}
.quota-options {
  display: flex;
  gap: 9px;
}
.quota-options label {
  flex: 1;
}
.quota-options label > span {
  padding: 9px;
  text-align: center;
  font-size: 11px;
}
.field-note {
  font-size: 9px;
  color: #a0a890;
  line-height: 1.8;
  margin-top: 7px;
}
.dialog-start {
  width: 100%;
  margin-top: 5px;
}
.result-dialog {
  text-align: center;
  padding: 38px 30px;
}
.result-seal {
  width: 73px;
  height: 73px;
  background: #edf1e5;
  color: #779166;
  display: grid;
  place-items: center;
  border: 1px solid #cad9bb;
  border-radius: 50%;
  font: 45px var(--chess);
  margin: 0 auto 24px;
}
.result-dialog h2 {
  font-size: 26px;
  font-weight: 500;
  margin: 11px 0;
}
.result-dialog p {
  font-size: 12px;
  color: #93a084;
  line-height: 1.9;
}
.result-actions {
  display: flex;
  gap: 12px;
  margin-top: 27px;
}
.result-actions button {
  flex: 1;
}
.noscript {
  text-align: center;
  background: #fff2cf;
  padding: 20px;
}
@keyframes breathe {
  50% {
    opacity: 0.45;
  }
}
@keyframes pieceAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.7);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
@keyframes toastIn {
  from {
    opacity: 0;
    bottom: 22px;
  }
  to {
    opacity: 1;
    bottom: 30px;
  }
}
@media (min-width: 1400px) {
  .workspace {
    padding-top: 44px;
  }
  .page-heading {
    margin-bottom: 34px;
  }
  .game-grid {
    gap: 52px;
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .side-rail {
    gap: 24px;
  }
  .coach-card {
    padding: 24px;
  }
  .move-list {
    height: 205px;
  }
}
@media (max-width: 1000px) {
  .header-inner {
    padding: 0 24px;
  }
  .connection {
    font-size: 10px;
  }
  .brand {
    font-size: 18px;
  }
  .brand small {
    font-size: 8px;
  }
  .nav-item {
    padding: 9px 12px;
    font-size: 12px;
  }
  .workspace {
    padding: 27px 24px 15px;
  }
  .game-grid {
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 290px;
  }
  .coach-card {
    padding: 17px;
  }
  .coach-label {
    display: none;
  }
  .coach-content {
    min-height: 104px;
  }
  .coach-content h3 {
    font-size: 15px;
  }
  .coach-content p {
    font-size: 10px;
  }
  .hint-button {
    font-size: 10px;
    padding: 10px;
  }
  .move-list {
    height: 145px;
  }
  .site-footer {
    margin: 20px 24px 0;
  }
  .piece {
    font-size: clamp(19px, 3vw, 30px);
  }
  .puzzle-grid {
    gap: 16px;
  }
  .puzzle-card {
    padding: 16px;
  }
  .mini-board .mini-piece {
    font-size: 15px;
  }
}
@media (max-width: 760px) {
  .site-header {
    height: auto;
  }
  .header-inner {
    flex-wrap: wrap;
    padding: 18px 20px 0;
    gap: 16px;
  }
  .brand {
    font-size: 19px;
  }
  .brand-seal {
    width: 35px;
    height: 37px;
    font-size: 25px;
  }
  .brand small {
    font-size: 8px;
  }
  .connection {
    margin-left: auto;
  }
  .main-nav {
    width: 100%;
    order: 3;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #e7ebdf;
    padding: 9px 0;
  }
  .nav-item {
    flex: 1;
    justify-content: center;
    padding: 9px 6px;
    gap: 6px;
    font-size: 11px;
    border-radius: 6px;
  }
  .nav-item svg {
    width: 15px;
    height: 15px;
  }
  .workspace {
    padding: 23px 18px 12px;
    max-width: 580px;
  }
  .page-heading {
    margin-bottom: 22px;
    gap: 10px;
    align-items: center;
  }
  .page-heading h1 {
    font-size: 23px;
    letter-spacing: 0.5px;
  }
  .page-heading p {
    font-size: 10px;
    max-width: 250px;
    margin-top: 5px;
  }
  .eyebrow {
    font-size: 7px;
    letter-spacing: 1.7px;
    margin-bottom: 5px;
  }
  .page-heading > .button {
    font-size: 10px;
    min-height: 36px;
    padding: 9px 11px;
    gap: 6px;
    white-space: nowrap;
  }
  .page-heading > .button .arrow {
    display: none;
  }
  .page-heading > .button svg {
    width: 14px;
    height: 14px;
  }
  .game-grid {
    grid-template-columns: 1fr;
    gap: 23px;
  }
  .board-frame {
    padding: 10px;
    border-radius: 8px;
  }
  .board-frame:before {
    inset: 4px;
  }
  .piece {
    font-size: clamp(21px, 6.3vw, 35px);
  }
  .player-row.opponent {
    margin-bottom: 12px;
  }
  .avatar {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .player-info strong {
    font-size: 11px;
  }
  .player-info > span {
    font-size: 9px;
  }
  .player-row.self {
    margin-top: 14px;
  }
  .turn-badge {
    font-size: 10px;
    padding: 5px 9px;
  }
  .board-toolbar {
    margin-top: 15px;
    padding-top: 10px;
  }
  .toolbar-group {
    gap: 17px;
  }
  .tool-button {
    font-size: 10px;
  }
  .board-footnote {
    font-size: 9px;
    margin-top: 10px;
  }
  .side-rail {
    gap: 17px;
    display: grid;
    grid-template-columns: 1fr;
  }
  .coach-card {
    padding: 19px;
  }
  .coach-head h2 {
    font-size: 13px;
  }
  .coach-label {
    display: block;
  }
  .quota-row {
    padding: 13px 0 12px;
    margin-bottom: 14px;
  }
  .coach-content {
    min-height: auto;
    margin-bottom: 15px;
  }
  .coach-content h3 {
    font-size: 16px;
  }
  .coach-content p {
    font-size: 11px;
  }
  .hint-button {
    font-size: 11px;
  }
  .move-list {
    height: 170px;
  }
  .learning-note {
    padding: 3px 6px;
  }
  .site-footer {
    max-width: 544px;
    margin: 20px auto 0;
    padding: 15px 18px 25px;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    font-size: 8px;
    border-top: 0;
    text-align: center;
  }
  .puzzle-grid {
    grid-template-columns: 1fr;
    margin-top: 20px;
    gap: 20px;
  }
  .puzzle-card {
    padding: 20px;
    display: grid;
    grid-template-columns: 125px 1fr;
    gap: 5px 20px;
  }
  .puzzle-card .puzzle-top {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    align-items: start;
  }
  .puzzle-number {
    font-size: 20px !important;
  }
  .mini-board {
    grid-column: 1;
    grid-row: 1/5;
    margin-bottom: 0;
    align-self: center;
  }
  .mini-board .mini-piece {
    font-size: 12px;
  }
  .puzzle-card h2 {
    grid-column: 2;
    font-size: 18px;
    align-self: center;
  }
  .puzzle-card p {
    grid-column: 2;
    font-size: 10px;
    min-height: 0;
    margin: 2px 0 8px;
    line-height: 1.7;
  }
  .puzzle-card .button {
    grid-column: 2;
    font-size: 10px;
    padding: 8px;
    min-height: 35px;
  }
  .collection-tag {
    font-size: 9px;
    padding: 5px 8px;
  }
  .section-note {
    font-size: 9px;
    align-items: flex-start;
    margin: 24px 0;
  }
  .library-item {
    gap: 12px;
    padding: 16px;
  }
  .library-symbol {
    width: 32px;
    height: 35px;
    font-size: 21px;
    line-height: 35px;
  }
  .library-info h2 {
    font-size: 12px;
  }
  .library-info p {
    font-size: 9px;
  }
  .library-item .button {
    font-size: 10px;
    padding: 8px 10px;
    min-height: 34px;
  }
  .library-result {
    display: none;
  }
  .library-empty {
    padding: 45px 20px;
  }
  .library-empty h2 {
    font-size: 17px;
  }
  dialog {
    padding: 24px;
  }
  .dialog-header h2 {
    font-size: 20px;
  }
  .result-dialog h2 {
    font-size: 23px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
.retry-button {
  font-size: 10px;
  padding: 5px 7px;
  background: #f1e9d4;
  color: #9b783d;
  border: 1px solid #dec99b;
  border-radius: 4px;
}
.wdl-bar {
  display: flex;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
  background: #dce4d1;
}
.wdl-bar i:nth-child(1) {
  background: #83a176;
}
.wdl-bar i:nth-child(2) {
  background: #d1d9c3;
}
.wdl-bar i:nth-child(3) {
  background: #bb997f;
}
.coach-content .wdl-caption {
  font-size: 8px;
  line-height: 1.8;
  margin-top: 5px;
  color: #9ea68f;
}
.check-mark {
  color: #bc8965;
  font-size: 9px;
}
/* Readable, compact desktop stage; the board remains the visual anchor. */
@media (min-width: 1001px) {
  .workspace {
    max-width: 958px;
    padding-top: 30px;
  }
  .game-grid {
    grid-template-columns: minmax(0, 540px) 330px;
    gap: 40px;
  }
  .board-section {
    max-width: 540px;
  }
  .page-heading {
    margin-bottom: 24px;
  }
  .side-rail {
    gap: 22px;
  }
  .coach-card {
    padding: 22px;
  }
  .move-list {
    height: 190px;
  }
  .site-footer {
    max-width: 910px;
  }
  .header-inner {
    max-width: 1120px;
  }
}
.player-info strong {
  font-size: 13px;
}
.player-info > span {
  font-size: 11px;
  color: #7c8b72;
}
.coach-head p {
  color: #7a8b6b;
  font-size: 11px;
}
.coach-content p {
  font-size: 12px;
  color: #687b5b;
}
.coach-content h3 {
  font-size: 17px;
}
.section-kicker {
  color: #718860;
  font-size: 10px;
}
.coach-content .coach-meta {
  font-size: 9px;
  color: #829374;
}
.hint-button {
  font-size: 12px;
}
.honest-note {
  font-size: 10px;
  color: #81906e;
}
.page-heading p {
  color: #79886f;
}
.move-cell {
  font-size: 12px;
}
.move-number {
  font-size: 11px;
  color: #8f9e80;
}
.move-columns {
  font-size: 10px;
  color: #81936e;
}
.move-footer button {
  color: #6e875b;
  font-size: 10px;
}
.tool-button {
  color: #718462;
  font-size: 12px;
}
.board-footnote {
  color: #859573;
  font-size: 10px;
}
.learning-note strong {
  color: #788d64;
  font-size: 11px;
}
.learning-note p {
  color: #8b9a7b;
  font-size: 10px;
}
.empty-moves p {
  color: #7f936d;
  font-size: 12px;
}
.empty-moves span {
  color: #95a583;
  font-size: 11px;
}
.replay-controls span {
  color: #82946f;
  font-size: 10px;
}
.puzzle-card p {
  color: #77886b;
  font-size: 12px;
}
.section-note {
  color: #7d8f6e;
}
.dialog-intro {
  color: #74866a;
  font-size: 12px;
}
.field-note {
  color: #819372;
  font-size: 10px;
}
.library-info p {
  color: #809170;
}
.board-toolbar button {
  min-height: 32px;
}
@media (max-width: 760px) {
  .player-info strong {
    font-size: 12px;
  }
  .player-info > span {
    font-size: 10px;
  }
  .page-heading p {
    font-size: 11px;
  }
  .tool-button {
    font-size: 11px;
  }
  .board-toolbar {
    padding-top: 8px;
  }
  .honest-note {
    font-size: 10px;
  }
  .learning-note p {
    font-size: 10px;
  }
  .puzzle-card p {
    font-size: 11px;
  }
  .section-note {
    font-size: 10px;
  }
  .board-footnote {
    font-size: 9px;
  }
  .nav-item {
    min-height: 38px;
  }
  .hit-cell:focus-visible {
    outline-offset: -3px;
  }
}
@media (min-width: 1001px) and (max-height: 850px) {
  .site-header {
    height: 72px;
  }
  .workspace {
    padding-top: 21px;
    max-width: 890px;
  }
  .game-grid {
    grid-template-columns: minmax(0, 480px) 310px;
    gap: 32px;
  }
  .page-heading {
    margin-bottom: 18px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .coach-card {
    padding: 19px;
  }
  .coach-content {
    min-height: 100px;
  }
  .coach-content h3 {
    font-size: 16px;
  }
  .move-list {
    height: 155px;
  }
  .side-rail {
    gap: 18px;
  }
  .site-footer {
    max-width: 842px;
  }
  .learning-note {
    display: none;
  }
}
