.cr-opening-tree-page {
  --cr-bg: #071012;
  --cr-panel: #101b20;
  --cr-text: #f3ead7;
  --cr-muted: #b8c1bc;
  --cr-line: rgba(216, 183, 90, .24);
  --cr-accent: #d8b75a;
  color: var(--cr-text);
}

.cr-opening-public-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 62px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(216, 183, 90, .22);
  background: rgba(7, 13, 16, .94);
  color: #f5f0e7;
  backdrop-filter: blur(12px);
}

.cr-opening-public-brand,
.cr-opening-public-support {
  display: inline-flex;
  align-items: center;
  color: #fff5d6;
  font-weight: 900;
  text-decoration: none;
}

.cr-opening-public-brand img {
  width: 68px;
  height: 68px;
  object-fit: contain;
}

.cr-opening-public-brand {
  gap: 10px;
}

.cr-opening-public-support {
  justify-self: end;
  gap: 5px;
  margin-left: auto;
  color: #d8ccba;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
}

.cr-opening-public-support:hover {
  color: #fff5d6;
}

.cr-opening-public-support-heart {
  color: #ef4444;
  font-weight: 950;
}

.cr-opening-player-data-bar {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--cr-muted);
  font-size: .88rem;
  font-weight: 850;
}

.cr-opening-player-data-bar select,
.cr-opening-player-data-bar button {
  min-height: 34px;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  padding: 6px 9px;
  background: var(--cr-panel);
  color: var(--cr-text);
  font: inherit;
  font-weight: 850;
}

.cr-opening-player-data-bar button {
  border-color: rgba(216, 183, 90, .62);
  background: rgba(216, 183, 90, .16);
  cursor: pointer;
}

.cr-opening-player-data-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cr-opening-player-status-games,
.cr-opening-player-stockfish-label,
.cr-opening-player-status-ready,
.cr-opening-player-status-error,
.cr-opening-player-stockfish-count {
  flex: 0 0 auto;
}

.cr-opening-player-status-ready {
  color: #22c55e;
}

.cr-opening-player-status-error {
  color: #fca5a5;
}

.cr-opening-player-stockfish-progress {
  position: relative;
  flex: 0 1 150px;
  width: clamp(86px, 11vw, 150px);
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(216, 183, 90, .48);
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .3);
}

.cr-opening-player-stockfish-progress-fill {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: linear-gradient(90deg, #d8b75a, #22c55e);
}

.cr-opening-player-load-panel {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(0, 0, 0, .62);
}

.cr-opening-player-load-panel[hidden] {
  display: none;
}

.cr-opening-player-load-card {
  position: relative;
  width: min(860px, calc(100vw - 36px));
  border: 1px solid rgba(216, 183, 90, .28);
  border-radius: 8px;
  padding: 24px;
  background: #101b20;
  color: var(--cr-text);
  box-shadow: 0 24px 90px rgba(0,0,0,.45);
}

.cr-opening-player-load-card h1 {
  margin: 0 0 8px;
  font-size: clamp(1.6rem, 3vw, 2.6rem);
}

.cr-opening-player-load-card p {
  margin: 0 0 16px;
  color: var(--cr-muted);
}

.cr-opening-player-load-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  color: var(--cr-text);
  font-size: 1.2rem;
  cursor: pointer;
}

.cr-eyebrow {
  margin: 0 0 6px;
  color: var(--cr-accent);
  font-size: .78rem;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cr-auth-form,
.cr-lgr-landing-form {
  display: grid;
  gap: 14px;
}

.cr-lgr-inline-fieldset {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
  margin: 0;
  border: 1px solid rgba(216, 183, 90, .22);
  border-radius: 8px;
  padding: 14px;
}

.cr-lgr-inline-fieldset legend {
  padding: 0 6px;
  color: var(--cr-muted);
  font-size: .82rem;
  font-weight: 900;
}

.cr-lgr-radio,
.cr-lgr-username {
  display: inline-grid;
  gap: 5px;
  color: var(--cr-muted);
  font-size: .82rem;
  font-weight: 850;
}

.cr-lgr-radio {
  grid-auto-flow: column;
  align-items: center;
  min-height: 34px;
}

.cr-lgr-radio input:disabled + span {
  opacity: .44;
}

.cr-lgr-username input,
.cr-lgr-username select {
  min-height: 34px;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  padding: 6px 9px;
  background: #071012;
  color: var(--cr-text);
  font: inherit;
}

.cr-lgr-username input {
  min-width: 220px;
}

.cr-opening-player-game-count select {
  min-width: 110px;
}

.cr-button-primary,
.cr-lgr-go-button {
  min-height: 36px;
  border: 1px solid rgba(216, 183, 90, .72);
  border-radius: 6px;
  padding: 8px 16px;
  background: linear-gradient(180deg, #ffe47a 0%, #d99a24 100%);
  color: #17120a;
  font-weight: 950;
  cursor: pointer;
}

.cr-lgr-browser-import-status {
  min-height: 22px;
  color: var(--cr-muted);
  font-weight: 800;
}

.cr-lgr-browser-import-status.is-error {
  color: #f2b66d;
}

.cr-opening-inline-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(216,183,90,.3);
  border-top-color: #f062b2;
  border-radius: 999px;
  animation: cr-opening-maia-spin .78s linear infinite;
}

.cr-opening-inline-spinner[hidden] {
  display: none;
}

.cr-opening-tree-page.cr-main {
  width: min(1560px, calc(100vw - 24px));
  max-width: none;
  margin: 0 auto;
  padding: 24px 0 40px;
}

.cr-opening-tree-page .cr-muted {
  color: var(--cr-muted);
}

.cr-opening-tree-page .cr-alert {
  color: #f2b66d;
  font-weight: 800;
}

.cr-opening-tree-page .cr-main {
  width: min(1560px, calc(100vw - 24px));
  max-width: none;
}

.cr-opening-tree-shell {
  display: grid;
  gap: 14px;
}

.cr-opening-tree-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--cr-line);
}

.cr-opening-tree-head h1 {
  margin: 0 0 5px;
  font-size: clamp(1.75rem, 3vw, 3.4rem);
}

.cr-opening-tree-head p {
  margin: 0;
}

.cr-opening-tree-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.cr-opening-tree-controls label {
  display: grid;
  gap: 5px;
  color: var(--cr-muted);
  font-size: .78rem;
  font-weight: 850;
}

.cr-opening-tree-controls label[hidden] {
  display: none !important;
}

.cr-opening-tree-controls input[type="range"] {
  width: 170px;
}

.cr-opening-tree-controls input[type="number"],
.cr-opening-tree-controls select {
  width: 94px;
  min-height: 34px;
  border: 1px solid var(--cr-line);
  border-radius: 6px;
  padding: 5px 8px;
  background: var(--cr-panel);
  color: var(--cr-text);
  font: inherit;
}

.cr-opening-tree-controls select {
  width: auto;
  max-width: 210px;
  font-size: .82rem;
  font-weight: 850;
}

.cr-opening-tree-controls label:first-child select {
  min-width: 112px;
}

.cr-opening-tree-controls label.cr-opening-population-control select {
  min-width: 112px;
}

.cr-opening-tree-controls label.cr-opening-games-control select {
  min-width: 104px;
}

.cr-opening-tree-controls button {
  min-height: 34px;
  border: 1px solid rgba(216, 183, 90, .62);
  border-radius: 6px;
  padding: 6px 12px;
  background: rgba(216, 183, 90, .16);
  color: var(--cr-text);
  font-weight: 900;
  cursor: pointer;
}

.cr-opening-tree-controls output {
  color: var(--cr-text);
  font-variant-numeric: tabular-nums;
}

.cr-opening-tree-meta {
  min-height: 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  color: var(--cr-muted);
  font-size: .86rem;
  font-weight: 750;
}

.cr-opening-tree-pill {
  border: 1px solid rgba(155, 181, 177, .26);
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(16, 27, 32, .86);
}

.cr-opening-tree-legend {
  display: flex;
  align-items: end;
  gap: 8px;
  color: var(--cr-muted);
  font-size: .78rem;
  font-weight: 850;
}

.cr-opening-tree-legend-scale {
  display: grid;
  gap: 3px;
  width: min(260px, 42vw);
}

.cr-opening-tree-legend-ticks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  color: var(--cr-muted);
  font-size: .7rem;
  font-weight: 900;
  line-height: 1;
}

.cr-opening-tree-legend-ticks span:nth-child(2) {
  text-align: center;
}

.cr-opening-tree-legend-ticks span:last-child {
  text-align: right;
}

.cr-opening-tree-legend-ramp {
  display: block;
  width: 100%;
  height: 10px;
  border: 1px solid rgba(155, 181, 177, .34);
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    rgb(255,0,0),
    rgb(255,87,87) 10%,
    rgb(255,151,151) 23%,
    rgb(255,213,213) 39%,
    rgb(255,255,255) 50%,
    rgb(213,255,213) 61%,
    rgb(151,255,151) 77%,
    rgb(87,255,87) 90%,
    rgb(0,255,0)
  );
}

.cr-opening-tree-stockfish-legend-title {
  color: var(--cr-muted);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.cr-opening-tree-stockfish-legend {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.cr-opening-stockfish-key {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border: 1px solid rgba(2, 6, 23, .42);
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 950;
  line-height: 1;
}

.cr-opening-tree-layout {
  display: grid;
  grid-template-columns: minmax(560px, 1fr) minmax(560px, 1fr);
  gap: 16px;
  align-items: start;
}

.cr-opening-tree-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.cr-opening-tree-stage {
  position: relative;
  min-height: min(82vh, 980px);
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  background: #061014;
  overflow: hidden;
}

.cr-opening-tree-svg {
  display: block;
  width: 100%;
  height: min(82vh, 980px);
  min-height: 680px;
}

.cr-opening-tree-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(7, 16, 18, .78);
  color: var(--cr-muted);
  font-weight: 900;
}

.cr-opening-tree-loading[hidden] {
  display: none;
}

.cr-opening-tree-maia-spinner {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(244, 114, 182, .42);
  border-radius: 999px;
  padding: 6px 11px 6px 8px;
  background: rgba(3, 7, 18, .86);
  color: #f9a8d4;
  font-size: .78rem;
  font-weight: 950;
  box-shadow: 0 8px 22px rgba(0,0,0,.3);
  pointer-events: none;
}

.cr-opening-tree-maia-spinner[hidden] {
  display: none;
}

.cr-opening-tree-maia-mark,
.cr-opening-tree-stockfish-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: contain;
  animation: cr-opening-maia-spin .78s linear infinite;
}

.cr-opening-tree-maia-mark {
  background: #f9a8d4;
  padding: 2px;
}

.cr-opening-tree-stockfish-mark {
  background: #f8fafc;
  padding: 2px;
  animation-duration: .92s;
}

.cr-opening-tree-maia-spinner strong {
  font: inherit;
  white-space: nowrap;
}

@keyframes cr-opening-maia-spin {
  to { transform: rotate(360deg); }
}

.cr-opening-tree-tooltip {
  position: absolute;
  z-index: 14;
  max-width: min(300px, calc(100% - 24px));
  border: 1px solid rgba(216,183,90,.42);
  border-radius: 7px;
  padding: 7px 9px;
  background: rgba(3, 7, 18, .94);
  color: #f8fafc;
  box-shadow: 0 12px 28px rgba(0,0,0,.34);
  font-size: .78rem;
  font-weight: 850;
  line-height: 1.25;
  pointer-events: none;
  transform: translate(12px, 12px);
}

.cr-opening-tree-tooltip[hidden] {
  display: none;
}

.cr-opening-tree-fen-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(16, 27, 32, .92);
}

.cr-opening-tree-fen-panel span {
  color: var(--cr-muted);
  font-size: .78rem;
  font-weight: 950;
  text-transform: uppercase;
}

.cr-opening-tree-fen-panel code {
  min-width: 0;
  color: var(--cr-text);
  font-size: .82rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.cr-opening-tree-fen-panel button {
  min-height: 28px;
  border: 1px solid rgba(155, 181, 177, .28);
  border-radius: 5px;
  background: rgba(8, 18, 22, .82);
  color: var(--cr-text);
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 900;
}

.cr-opening-tree-slice {
  cursor: pointer;
  transition: filter .14s ease, opacity .14s ease;
}

.cr-opening-tree-ring-underlay {
  pointer-events: none;
}

.cr-opening-tree-slice:hover,
.cr-opening-tree-slice:focus {
  filter: brightness(1.18);
  outline: none;
}

.cr-opening-tree-label {
  pointer-events: none;
  fill: #f6fbf8;
  font-size: 15px;
  font-weight: 850;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  paint-order: stroke;
  stroke: rgba(3, 8, 10, .78);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.cr-opening-tree-center {
  cursor: pointer;
}

.cr-opening-tree-center text {
  pointer-events: none;
  fill: var(--cr-text);
  font-weight: 950;
  text-anchor: middle;
}

.cr-opening-tree-detail {
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 14px;
  background: var(--cr-panel);
  min-height: 0;
  overflow: auto;
}

.cr-opening-tree-side {
  display: block;
  min-width: 0;
}

.cr-opening-tree-bottom-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
}

.cr-opening-board-card {
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(11,21,23,.98), rgba(7,16,18,.98));
  box-shadow: 0 18px 60px rgba(0,0,0,.28);
}

.cr-opening-board-status {
  min-height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
  border: 1px solid rgba(216,183,90,.28);
  border-radius: 5px;
  background: rgba(3,7,18,.58);
  color: #fff7d6;
  font-size: .84rem;
  font-weight: 900;
  text-align: center;
}

.cr-opening-board-opening-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.cr-opening-board-opening-link:hover {
  color: var(--cr-accent);
}

.cr-opening-capture-tray {
  display: flex;
  align-items: center;
  gap: 1px;
  min-height: 32px;
  margin: 6px 0;
  padding: 4px 7px;
  border: 1px solid rgba(106, 62, 28, .28);
  border-radius: 5px;
  background-color: #e6c28c;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.18), rgba(255,255,255,0) 18%, rgba(89,48,22,.08) 52%, rgba(255,255,255,.12)),
    repeating-linear-gradient(0deg, rgba(109,68,35,.11) 0 1px, rgba(255,244,211,.08) 1px 3px, rgba(159,101,48,.09) 3px 5px);
  overflow: hidden;
}

.cr-opening-capture-tray img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  margin-right: -6px;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.22));
}

.cr-opening-board-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  margin: 0 auto;
  border: 1px solid rgba(106, 62, 28, .42);
  box-shadow: 0 10px 28px rgba(0,0,0,.34);
}

.cr-opening-board-coordinate-shell {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) 18px;
  grid-template-rows: 18px minmax(0, 1fr) 18px;
  gap: 4px;
  width: min(100%, 760px, 78vh);
  margin: 0 auto;
}

.cr-opening-rank-labels,
.cr-opening-file-labels {
  color: #d8b75a;
  font-size: .76rem;
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.cr-opening-rank-labels {
  display: grid;
  grid-template-rows: repeat(8, 1fr);
  align-items: center;
  justify-items: center;
}

.cr-opening-rank-labels.is-left {
  grid-column: 1;
  grid-row: 2;
}

.cr-opening-rank-labels.is-right {
  grid-column: 3;
  grid-row: 2;
}

.cr-opening-file-labels {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: center;
  justify-items: center;
}

.cr-opening-file-labels.is-top {
  grid-column: 2;
  grid-row: 1;
}

.cr-opening-file-labels.is-bottom {
  grid-column: 2;
  grid-row: 3;
}

.cr-opening-coordinate-corner {
  min-width: 0;
  min-height: 0;
}

.cr-opening-board-coordinate-shell .cr-opening-board-wrap {
  grid-column: 2;
  grid-row: 2;
}

.cr-opening-board {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  user-select: none;
}

.cr-opening-board-arrows {
  position: absolute;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.cr-opening-board-pill-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: none;
}

.cr-opening-board-maia-arrow {
  cursor: pointer;
  pointer-events: auto;
}

.cr-opening-board-arrow-shape {
  stroke: #020617;
  stroke-width: .22;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.25));
}

.cr-opening-board-arrow-rank {
  fill: #020617;
  stroke: rgba(255,255,255,.84);
  stroke-width: .12;
  paint-order: stroke;
  font-size: 1.58px;
  font-weight: 950;
  text-anchor: middle;
  pointer-events: none;
}

.cr-opening-board-stockfish-pill {
  appearance: none;
  position: absolute;
  transform: translate(-50%, var(--pill-y, calc(-100% - 2px))) rotate(var(--pill-rotate, 0deg));
  transform-origin: center var(--pill-origin, bottom);
  min-width: 46px;
  min-height: 19px;
  border: 1px solid rgba(2,6,23,.72);
  border-radius: 999px;
  padding: 2px 7px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.2);
  font-family: inherit;
  font-size: .66rem;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  pointer-events: auto;
  text-transform: uppercase;
}

.cr-opening-board-stockfish-pill:hover,
.cr-opening-board-stockfish-pill:focus {
  border-color: rgba(255,255,255,.92);
  outline: none;
}

.cr-opening-square {
  position: relative;
  display: grid;
  place-items: center;
  background-color: #f1dfbd;
  background-image:
    linear-gradient(rgba(255,248,224,.16), rgba(255,248,224,.16)),
    url("/static/img/board_textures/american-hard-maple.webp");
  background-size: 360% 360%;
  background-position: var(--wood-x, 50%) var(--wood-y, 50%);
}

.cr-opening-square.is-dark {
  background-color: #8e5232;
  background-image:
    linear-gradient(rgba(35,14,5,.06), rgba(255,222,174,.06)),
    url("/static/img/board_textures/american-cherry-vertical.webp");
}

.cr-opening-square.is-last::after {
  content: "";
  position: absolute;
  inset: 4px;
  border: 3px solid rgba(255, 215, 0, .72);
  border-radius: 4px;
  pointer-events: none;
}

.cr-opening-piece {
  position: relative;
  width: 88%;
  height: 88%;
  object-fit: contain;
  z-index: 2;
  transition: transform .18s ease;
  filter: drop-shadow(0 3px 3px rgba(0,0,0,.24));
}

.cr-opening-moving-piece {
  position: absolute;
  width: 11%;
  height: 11%;
  object-fit: contain;
  z-index: 8;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: left .2s cubic-bezier(.2, .72, .18, 1), top .2s cubic-bezier(.2, .72, .18, 1);
  filter: drop-shadow(0 8px 9px rgba(0,0,0,.34));
}

.cr-opening-board-nav {
  display: grid;
  grid-template-columns: repeat(2, auto) minmax(70px, 1fr) repeat(2, auto);
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid rgba(216,183,90,.24);
  border-radius: 7px;
  background: rgba(3,7,18,.48);
}

.cr-opening-board-nav button {
  min-width: 38px;
  height: 26px;
  border-radius: 6px;
  border: 1px solid rgba(106, 62, 28, .35);
  background-color: #f1dfbd;
  background-image:
    linear-gradient(rgba(255, 248, 224, .18), rgba(255, 248, 224, .18)),
    url("/static/img/board_textures/american-hard-maple.webp");
  background-size: 260% 260%;
  color: #17100a;
  font-weight: 900;
  cursor: pointer;
}

.cr-opening-board-nav button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.cr-opening-board-nav span {
  color: #f7d675;
  font-size: .82rem;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.cr-opening-board-history {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  margin-top: 8px;
  border: 1px solid rgba(216,183,90,.24);
  border-radius: 7px;
  padding: 8px;
  background: rgba(3,7,18,.48);
}

.cr-opening-board-history[hidden] {
  display: none;
}

.cr-opening-board-history code {
  min-width: 0;
  color: var(--cr-text);
  font-size: .82rem;
  font-weight: 850;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cr-opening-board-history button {
  min-height: 28px;
  border: 1px solid rgba(155, 181, 177, .28);
  border-radius: 5px;
  background: rgba(8, 18, 22, .82);
  color: var(--cr-text);
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  font-weight: 900;
}

.cr-opening-coach-panel {
  margin-top: 8px;
  border: 1px solid rgba(155, 181, 177, .24);
  border-radius: 8px;
  padding: 10px;
  background: rgba(3, 7, 18, .48);
}

.cr-opening-coach-panel[hidden] {
  display: none;
}

.cr-opening-coach-panel h3 {
  margin: 0 0 8px;
  color: #fff7d6;
  font-size: .9rem;
  font-weight: 950;
}

.cr-opening-coach-move-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  min-width: 0;
}

.cr-opening-coach-move-row strong {
  color: var(--cr-text);
  font-size: .92rem;
  overflow-wrap: anywhere;
}

.cr-opening-stockfish-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 58px;
  max-width: 98px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 2px 7px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 1px 2px rgba(0,0,0,.18);
  font-size: .68rem;
  font-weight: 950;
  line-height: 1.12;
  text-align: center;
  white-space: nowrap;
}

.cr-opening-coach-panel dl {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
}

.cr-opening-coach-panel dt {
  color: var(--cr-muted);
  font-size: .78rem;
  font-weight: 850;
}

.cr-opening-coach-panel dd {
  margin: 0;
  color: var(--cr-text);
  font-size: .8rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.cr-opening-coach-drill-button {
  width: 100%;
  margin-top: 9px;
}

.cr-opening-tree-detail h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.cr-opening-playing-as {
  display: flex;
  align-items: center;
  min-height: 32px;
  margin: 0 0 10px;
  padding: 5px 9px;
  border: 1px solid rgba(240, 217, 181, .58);
  border-radius: 7px;
  background-color: #946f51;
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.13), rgba(255,255,255,0) 22%, rgba(69,35,15,.12) 58%, rgba(255,255,255,.1)),
    repeating-linear-gradient(0deg, rgba(109,68,35,.12) 0 1px, rgba(255,244,211,.08) 1px 3px, rgba(116,72,36,.09) 3px 5px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .16);
  color: #f8fafc;
  font-size: .9rem;
  font-weight: 950;
}

.cr-opening-playing-as.is-white {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .62);
}

.cr-opening-playing-as.is-black {
  color: #101010;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .34);
}

.cr-opening-next-moves-panel {
  border: 1px solid var(--cr-line);
  border-radius: 8px;
  padding: 12px;
  background: var(--cr-panel);
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

.cr-opening-next-moves-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.cr-opening-next-moves-panel th,
.cr-opening-next-moves-panel td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(155, 181, 177, .16);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.cr-opening-next-moves-panel th {
  color: var(--cr-muted);
  font-size: .72rem;
  font-weight: 950;
  text-transform: uppercase;
}

.cr-opening-next-moves-panel tfoot th {
  border-top: 4px solid rgba(216, 183, 90, .56);
  border-bottom: 0;
  color: var(--cr-text);
  font-size: .78rem;
  font-weight: 950;
  text-transform: none;
}

.cr-opening-next-moves-panel tfoot sup {
  margin-left: 3px;
  color: var(--cr-accent);
  font-size: .72em;
  font-weight: 950;
}

.cr-opening-next-moves-panel td:nth-child(2) {
  white-space: normal;
}

.cr-opening-next-moves-panel .cr-opening-table-notes {
  margin: 9px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.cr-opening-next-moves-panel .cr-opening-table-note {
  margin: 0;
  color: var(--cr-muted);
  font-size: .76rem;
  font-weight: 750;
}

.cr-opening-next-moves-panel .cr-opening-table-note-weighted {
  flex: 0 0 auto;
  text-align: right;
}

.cr-opening-next-moves-panel .cr-opening-table-note-stars {
  color: var(--cr-accent);
  font-size: .72em;
  font-weight: 950;
}

.cr-opening-next-moves-panel h2 {
  margin: 0 0 10px;
  color: var(--cr-muted);
  font-size: .84rem;
  font-weight: 950;
  text-transform: uppercase;
}

.cr-opening-tree-crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 12px;
}

.cr-opening-tree-crumbs button,
.cr-opening-tree-continuation-button {
  border: 1px solid rgba(155, 181, 177, .28);
  border-radius: 6px;
  background: rgba(8, 18, 22, .82);
  color: var(--cr-text);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
}

.cr-opening-tree-crumbs button {
  min-height: 28px;
  padding: 4px 8px;
  font-size: .78rem;
}

.cr-opening-tree-crumbs button.is-white {
  border-color: rgba(255,255,255,.72);
  background: #f8fafc;
  color: #071012;
}

.cr-opening-tree-crumbs button.is-black {
  border-color: rgba(2,6,7,.9);
  background: #020607;
  color: #f8fafc;
}

.cr-opening-tree-crumbs button.is-root {
  border-color: rgba(216, 183, 90, .42);
  background: rgba(216, 183, 90, .16);
  color: var(--cr-text);
}

.cr-opening-tree-crumb-arrow {
  color: var(--cr-muted);
  font-size: .78rem;
  font-weight: 950;
}

.cr-opening-tree-detail dl {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.cr-opening-tree-detail dt {
  color: var(--cr-muted);
  font-size: .8rem;
  font-weight: 850;
}

.cr-opening-tree-detail dd {
  margin: 0;
  color: var(--cr-text);
  font-weight: 850;
  overflow-wrap: anywhere;
}

.cr-opening-hidden-help {
  display: block;
  margin-top: 2px;
  color: var(--cr-muted);
  font-size: .76rem;
  font-weight: 750;
  line-height: 1.25;
}

.cr-opening-next-moves-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}

.cr-opening-next-moves-panel th,
.cr-opening-next-moves-panel td {
  border-top: 1px solid rgba(155, 181, 177, .17);
  padding: 7px 4px;
  text-align: right;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
}

.cr-opening-next-moves-panel th:first-child,
.cr-opening-next-moves-panel td:first-child {
  text-align: left;
}

.cr-opening-next-moves-panel td:first-child {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.cr-opening-tree-rank {
  color: var(--cr-muted);
  font-size: .78rem;
  font-weight: 950;
  text-align: right;
}

.cr-opening-tree-continuation-button {
  width: 100%;
  min-height: 28px;
  padding: 4px 7px;
  text-align: left;
}

.cr-opening-tree-continuation-label {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  color: var(--cr-text);
  font-weight: 900;
}

.cr-opening-tree-score-chip {
  display: inline-block;
  min-width: 54px;
  border: 1px solid rgba(2, 6, 7, .32);
  border-radius: 6px;
  padding: 3px 5px;
  color: #061014;
  font-weight: 950;
}

.cr-opening-copy-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cr-opening-copy-row code {
  min-width: 0;
  overflow-wrap: anywhere;
}

.cr-opening-copy-row button {
  min-height: 24px;
  border: 1px solid rgba(155, 181, 177, .28);
  border-radius: 5px;
  background: rgba(8, 18, 22, .82);
  color: var(--cr-text);
  cursor: pointer;
  font: inherit;
  font-size: .74rem;
  font-weight: 900;
}

.cr-opening-tree-empty {
  fill: var(--cr-muted);
  font-size: 18px;
  font-weight: 900;
  text-anchor: middle;
}

.cr-opening-next-moves-panel th,
.cr-opening-next-moves-panel td {
  padding: 7px 8px;
  text-align: left;
  white-space: nowrap;
}

.cr-opening-next-moves-panel th:first-child,
.cr-opening-next-moves-panel td:first-child {
  width: 72px;
  text-align: left;
}

.cr-opening-next-moves-panel td:first-child {
  display: table-cell;
}

.cr-opening-next-moves-panel td:nth-child(2) {
  min-width: 120px;
  white-space: normal;
}

@media (max-width: 900px) {
  .cr-opening-tree-head {
    display: grid;
    align-items: start;
  }

  .cr-opening-tree-controls {
    justify-content: start;
  }

  .cr-opening-tree-layout {
    grid-template-columns: 1fr;
  }

  .cr-opening-tree-stage {
    min-height: 520px;
  }

  .cr-opening-tree-svg {
    height: 520px;
    min-height: 520px;
  }

  .cr-opening-tree-side {
    grid-row: 2;
  }

  .cr-opening-tree-bottom-panels {
    grid-template-columns: 1fr;
  }
}
