/* Common imports for all CSS modules */
/*
 * This source is generated by bin/gen/licon.py. Run licon.py after changing public/font/lichess.sfd
 *
 * Constant names and values are pulled from private use characters defined in the sfd file.
 *
 * Character names can be edited in fontforge's "glyph info" dialog, or by editing the StartChar: line that
 * begins each character chunk in lichess.sfd
 *
 * To make these characters visible in your editor, install the lichess.ttf font (which is also generated by
 * licon.py) and then add it to your editor's font list.
 */
/* Uniboard: keep the same page layout across pages */
/* text printed directly on the page background deserves special treatment (transp theme) */
.board-editor__tools .actions .button, .board-editor__tools select {
  color: var(--c-font-clearer);
}

.board-editor__tools .actions .button, .board-editor__tools select {
  text-shadow: 0 1px 0 var(--c-font-shadow);
}

.copy-me__target {
  white-space: nowrap;
}

.copy-me__target {
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-editor .spare .no-square div {
  position: relative;
  display: block;
  height: 0;
  padding-bottom: 100%;
  width: 100%;
}

.board-editor__tools .metadata .chess960-position-row {
  /* extends %flex-wrap */
  display: flex;
  flex-flow: row wrap;
  align-items: center;
}

.board-editor .copyables p, .copy-me {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
}

.board-editor__tools .metadata .enpassant, .board-editor__tools .metadata .castling div {
  /* extends %flex-center */
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
}

.board-editor__tools .actions, .board-editor__tools, .continue-with {
  display: flex;
  flex-flow: column;
}

.board-editor .spare, .copy-me, .board-editor__tools .metadata {
  border-radius: 7px;
}

/* helps with clipping background into border-radius */
.board-editor .spare .no-square.pointer, .copy-me__target:is(a):focus-visible, .copy-me__target {
  border-radius: 7px 0 0 7px;
}

.board-editor .spare .no-square.trash, .copy-me__button {
  border-radius: 0 7px 7px 0;
}

.board-editor__tools .metadata {
  box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.08), 0 3px 1px -2px rgba(0, 0, 0, 0.18), 0 1px 5px 0 rgba(0, 0, 0, 0.1);
}

html.transp .board-editor__tools .metadata, .board-editor__tools html.transp .metadata {
  backdrop-filter: blur(6px);
}

coords {
  font-size: 8px;
}
@media (min-width: 300px) {
  coords {
    font-size: calc(8px + 4 * (100vw - 300px) / 900);
  }
}
@media (min-width: 1200px) {
  coords {
    font-size: 12px;
  }
}
coords {
  user-select: none;
  /* handle inner coords */
  position: absolute;
  display: flex;
  pointer-events: none;
  color: #fff;
  text-shadow: 0 1px 2px #000;
  font-weight: bold;
  /* handle hidden coords */
}
.coords-no coords {
  display: none;
}
coords.ranks {
  flex-flow: column-reverse;
  top: 1px;
  right: 0;
  height: 100%;
  width: 0.8em;
}
coords.ranks.black {
  flex-flow: column;
}
coords.files {
  bottom: 0;
  left: 0;
  text-align: left;
  flex-flow: row;
  width: 100%;
  height: 1.4em;
}
coords.files.black {
  flex-flow: row-reverse;
}
coords.files coord {
  padding-left: 4px;
}
coords coord {
  flex: 1 1 auto;
}
coords {
  /* negate inner coords colors */
}
coords .is3d .cg-wrap coords coord {
  color: #fff !important;
  text-shadow: 0 1px 2px #000 !important;
}
coords .is3d .cg-wrap coords.files {
  bottom: calc(1px - 2.5%);
}
coords .is3d .cg-wrap coords.files coord {
  padding-left: 3px;
}

coords {
  text-shadow: var(---cg-cs, 0 1px 2px #000);
}

/** Alternating colors in rank/file/square labels */
coords .coord-light {
  color: var(---cg-ccb, #fff);
}

coords .coord-dark {
  color: var(---cg-ccw, #fff);
}

/* handle outer coords */
@media (min-width: 799.3px), (orientation: landscape) {
  .coords-out coords {
    text-shadow: none;
  }
  .coords-out coords.ranks {
    right: -15px;
    top: 0;
    width: 12px;
  }
  .coords-out coords.ranks coord {
    transform: translateY(42%);
  }
  .coords-out coords.files {
    bottom: -15px;
    left: 0;
    text-align: center;
  }
  .coords-out coords.ranks coord,
  .coords-out .is2d coords.files coord {
    color: var(--c-font-page) !important;
  }
}
body {
  ---board-scale: 1;
}
@media (min-width: 799.3px) and (min-height: 499.3px) {
  body {
    ---board-scale: calc((var(---zoom) / 100) * 0.75 + 0.25);
  }
}
body {
  ---col2-uniboard-width: calc(min(calc(100vw - var(---block-gap) - 240px - 2 * var(---main-margin, 0px) - 20px), calc(100vh - calc(var(---site-header-height) + var(---site-header-margin) + var(---sticky-gap)) - 1rem)) * var(---board-scale));
  ---col3-uniboard-width: calc(min(calc(100vw - var(---col3-uniboard-side-min, 250px) - var(---block-gap) - 240px - 2 * var(---main-margin, 0px) - 20px), calc(100vh - calc(var(---site-header-height) + var(---site-header-margin) + var(---sticky-gap)) - 1rem)) * var(---board-scale));
}

@media (max-width: 799.29px) and (orientation: portrait) {
  .main-board cg-board {
    border-radius: 0;
  }
}
body.resizing {
  user-select: none;
}

cg-resize {
  display: none;
}
@media (min-width: 799.3px) {
  cg-resize {
    display: block;
    position: absolute;
    right: -9px;
    bottom: -9px;
    width: 22px;
    height: 22px;
    cursor: nwse-resize;
    z-index: 10;
  }
  cg-resize::before, cg-resize::after {
    background: #000;
    content: "";
    position: absolute;
    width: 12px;
    height: 1px;
    left: 0;
  }
  cg-resize::before {
    width: 5px;
    transform: translate(7px, 8px) rotate(-45deg);
  }
  cg-resize::after {
    transform: translate(1px, 6px) rotate(-45deg);
  }
  cg-resize:hover {
    border-radius: 50%;
    background: var(--m-accent--fade-50);
  }
  .resizing cg-resize {
    border-radius: 50%;
    background: var(--m-secondary--fade-50);
  }
}

@media (hover: none) {
  .continue-with {
    padding: 2em;
  }
}
.continue-with > *:not(:first-child) {
  margin-top: 1em;
}

html.transp .copy-me {
  backdrop-filter: blur(6px);
}
.copy-me__target {
  flex: 1 1 auto;
  padding: 0 1em;
  outline: 0;
  background: none;
  border: 1px solid var(--c-border);
  border-right: 0;
  min-height: 44px;
}
.copy-me__target:is(a) {
  line-height: 40px;
}
.copy-me__target:is(a):focus-visible {
  outline-offset: -2px;
}
.copy-me__button {
  flex: 0 0 auto;
  border: 1px solid var(--c-border);
  border-left: 0;
  min-height: 44px;
}

#main-wrap {
  ---main-max-width: auto;
}

.board-editor {
  display: grid;
  grid-template-columns: minmax(0, calc((100vh - 4vmin) * var(---board-scale) * 0.8 - calc(var(---site-header-height) + var(---site-header-margin) + var(---sticky-gap))));
  grid-template-areas: "spare-top" "board" "spare-bottom" "tools" "copyables";
}
@media (min-width: 649.3px) {
  .board-editor {
    grid-template-columns: minmax(30vmin, calc((100vh - 4vmin) * var(---board-scale) * 0.8 - calc(var(---site-header-height) + var(---site-header-margin) + var(---sticky-gap)))) 2vmin minmax(200px, 300px);
    grid-template-rows: min-content auto min-content;
    grid-template-areas: ".            . tools" "spare-top    . tools" "board        . tools" "spare-bottom . tools" ".            . tools" "copyables    . .    ";
  }
}

.board-editor .spare {
  display: flex;
  background: var(--c-font-dimmer);
  box-shadow: 0 3px 5px rgba(0, 0, 0, 0.3) inset;
}
.board-editor .spare-top {
  grid-area: spare-top;
  margin-bottom: 2vh;
}
.board-editor .spare-bottom {
  grid-area: spare-bottom;
  margin-top: 2vh;
}
.board-editor .spare .no-square {
  flex: 0 0 12.5%;
  transition: all 150ms ease;
}
.board-editor .spare .no-square:hover {
  background: var(--m-primary--fade-80);
}
.board-editor .spare .no-square.selected-square {
  background: var(--m-primary--fade-50);
}
.board-editor .spare .no-square.pointer:hover {
  background: var(--m-secondary--fade-80);
}
.board-editor .spare .no-square.pointer.selected-square {
  background: var(--m-secondary--fade-40);
}
.board-editor .spare .no-square.pointer piece {
  background-image: url("../hashed/pointer.f71f8d2b.svg");
}
.board-editor .spare .no-square.trash:hover {
  background: var(--m-bad--fade-80);
}
.board-editor .spare .no-square.trash.selected-square {
  background: var(--m-bad--fade-40);
}
.board-editor .spare .no-square.trash piece {
  background-image: url("../hashed/trash.a9947e00.svg");
}
.is3d .board-editor .spare .no-square div {
  padding-bottom: 90.72%;
}
.board-editor .spare piece {
  display: block;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.is3d .board-editor .spare piece {
  /* original size: width: 140.625%; height: 179.6875%; size on 3D board, with height/width = 90.78571% */
  width: 100%;
  height: 140.7465%;
}
html:not([dir=rtl]) .is3d .board-editor .spare piece {
  left: 0;
}
html[dir=rtl] .is3d .board-editor .spare piece {
  right: 0;
}
.is3d .board-editor .spare piece {
  top: -34%;
}
.board-editor .spare piece.pointer,
.board-editor .spare piece.trash {
  margin: 14%;
  width: 72%;
  height: 72%;
}
.is3d .board-editor .spare piece.pointer,
.is3d .board-editor .spare piece.trash {
  width: 62%;
  top: 0;
}

.board-editor__tools {
  cursor: default;
}
.board-editor__tools button,
.board-editor__tools .button,
.board-editor__tools select,
.board-editor__tools label,
.board-editor__tools input[type=checkbox] {
  cursor: pointer;
}
.board-editor__tools input[type=text],
.board-editor__tools input[type=number] {
  cursor: text;
}
.board-editor__tools button:disabled,
.board-editor__tools select:disabled,
.board-editor__tools input:disabled {
  cursor: not-allowed;
}
.board-editor__tools {
  grid-area: tools;
  align-self: center;
}
.board-editor__tools > * {
  margin: 0.5rem 0;
}
.board-editor__tools select {
  width: 100%;
}
.board-editor__tools select.positions option:checked {
  font-style: italic;
}
.board-editor__tools .metadata {
  background: var(--c-bg-box);
  padding: 1rem;
  white-space: nowrap;
}
.board-editor__tools .metadata .color {
  margin-bottom: 1em;
}
.board-editor__tools .metadata .castling label,
.board-editor__tools .metadata .castling input {
  display: inline-block;
  margin: 3px;
  vertical-align: middle;
}
.board-editor__tools .metadata .castling input.not-allowed {
  visibility: hidden;
}
.board-editor__tools .metadata .enpassant {
  margin-top: 1em;
}
.board-editor__tools .metadata .enpassant label {
  font-weight: bold;
}
.board-editor__tools .metadata .enpassant select {
  width: 9ch;
}
.board-editor__tools .metadata .chess960-position-row {
  gap: 0.5rem;
}
.board-editor__tools .metadata .chess960-position-row .form-label {
  flex: 0 0 100%;
  margin: 0;
}
.board-editor__tools .metadata .chess960-position-row .button {
  width: auto;
}
.board-editor__tools .metadata #chess960-position-id:invalid {
  border-color: var(--c-error);
}
html.transp .board-editor__tools .actions {
  backdrop-filter: blur(6px);
}
.board-editor__tools .actions {
  justify-content: stretch;
}
.board-editor__tools .actions .button {
  width: 100%;
  text-align: start;
  display: flex;
  align-items: center;
  text-transform: none;
}
.board-editor__tools .actions .button.disabled {
  cursor: default;
}
.board-editor__tools .actions .button::before {
  color: var(--c-font);
}

body {
  /* prevents scroll bar flicker when dragging a piece out */
  overflow-y: scroll;
}

.board-editor {
  user-select: none;
}
.board-editor .main-board {
  grid-area: board;
}
.board-editor cg-board {
  cursor: inherit;
}
.board-editor .copyables {
  grid-area: copyables;
  margin: 2rem 0 0 1rem;
}
.board-editor .copyables p {
  gap: 1em;
}
.board-editor .copyables p > *:not(strong) {
  flex: 1 1 auto;
}

/*# sourceMappingURL=editor.css.map */
