.noselect {
  cursor: default;
  -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
     -khtml-user-select: none; /* Konqueror HTML */
       -moz-user-select: none; /* Firefox */
        -ms-user-select: none; /* Internet Explorer/Edge */
            user-select: none; /* Non-prefixed version, currently
                                  supported by Chrome and Opera */
}

:root {
  --safe-area-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --safe-area-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --safe-area-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --safe-area-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px)); 
  --safe-area-width: calc(var(--safe-area-left) + var(--safe-area-right));
  --safe-area-height: calc(var(--safe-area-top) + var(--safe-area-bottom));
}

html, body {
  overflow: hidden;
  width: 100%;
  height: 100%;
  margin: 0;
}

#app {
  overflow-y: auto;
  height: 100%;
}

#content {
  padding-top: var(--safe-area-top);
  padding-bottom: var(--safe-area-bottom);
  padding-right: var(--safe-area-right);
  padding-left: var(--safe-area-left);
}

.status-shim {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--safe-area-top);
  background-color: var(--bg-color);
  z-index: 1000;
}

.button-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.625rem;
}
#chat-tabContent .tab-pane {
  max-height: 100%;
  min-height: 100%;
}

.chat-scroll-container {
  overflow-y: auto;
}
.chat-text {
  width: 100%;
}
.chat-text .chat-message {
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-text strong {
  font-weight: bold;
}
.chat-text-suffix {
  font-style: italic;
}

#collapse-chat-arrow {
  display: none;
}
@media (min-width: 768px) {
  #collapse-chat-arrow {
    display: none !important;
  }
}

.chat-info {
  display: none;
  height: 31px;
  padding-left: 8px;
  padding-right: 8px;
  border-bottom: 1px solid;
}
.chat-info .btn-outline-secondary {
  font-weight: bold;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .game-chat-info .chat-members-text {
    display: none;
  }
}
.chat-members-text {
  display: block;
  font-style: italic;
  margin-right: 6px;
}
.chat-members-tooltip .tooltip-inner {
  max-width: none;
}
.chat-members-list {
  display: flex;
  gap: 16px;
}

#add-remove-channels {
  padding-left: 0.75rem; 
  padding-right: 0.75rem; 
  padding-top: 0.5rem; 
  padding-bottom: 0.5rem;
}
#add-remove-channels button {
  white-space: nowrap; 
  --bs-btn-border-radius: 0.9rem;
}

.table-standard th {
  user-select: none;
}
.table-standard td,
.table-standard th {
  white-space: pre;
  padding-inline-start: 1rem;
  padding-inline-end: 1rem;
}
.table-standard th.text-end,
.table-standard td.text-end {
  padding-inline-start: 1rem; 
  padding-inline-end: 1rem;
}
.table-standard thead {
 position: sticky; 
 top: 0;
 z-index: 10;
 box-shadow: 0 1px 0 var(--box-shadow-color);
}

.sort-header-wrapper {
  display: flex;
  justify-content: space-between; 
  align-items: baseline;
  gap: 0.75rem;
}
.sortable-column {
  cursor: pointer;
}
.sortable-column i {
  opacity: 0.3;
}
.sortable-column.sort-primary[data-sort="asc"] i {
  opacity: 1;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.3) 50%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8) 50%, rgba(0,0,0,0.3) 50%);
}
.sortable-column.sort-primary[data-sort="desc"] i {
  opacity: 1;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.8) 50%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.8) 50%);
}

#channels-modal table td:nth-child(2),
#channels-modal table th:nth-child(2) {
  text-align: center;
}

.dialog-container {
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#fixed-dialog-container {
  position: fixed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  top: 50%; 
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 101;
}

#left-panel {
  height: 546px;
}
#left-panel.list-view-showing {
  height: 232px;
}
#left-panel.shrunk-explorer-showing {
  height: 200px;
}
#left-panel-bottom {
  width: 100%;
  --content-height: 160px;
  cursor: pointer;
}
@media (max-width: 767px) {
  #left-panel-bottom:not(.analyzing) {
    --content-height: 5rem;
  }
  #left-panel-bottom.trainingbot-active:not(.analyzing) {
    --content-height: 7rem;
  }
  #left-panel-bottom:not(.analyzing) #status-panel {
    --padding-y: 0px;
  }
}

#status-panel .game-info {
  margin-block: auto;
}
#left-panel-bottom-content {
  height: var(--content-height);
  cursor: initial;
}
#left-panel-bottom.minimized #left-panel-bottom-content {
  display: none;
}
#left-panel-bottom.minimizing * {
  overflow: hidden;
}

#close-status {
  font-size: 20px;
  top: 6px;
  right: 9px;
  line-height: 0px;
  padding: 0px;
}

#status-panel {
  --padding-y: 0.25rem;
  padding-top: var(--padding-y);
  padding-bottom: 0.25rem;
}
.game-status-outer {
  padding-top: var(--padding-y);
  padding-bottom: var(--padding-y);
}
.game-status {
  font-weight: bold;
}
.game-status:empty::before {
  content: "\00a0";
}
.game-status .game-id {
  font-weight: normal;
}
.trainingbot-objective,
.trainingbot-feedback {
  white-space: pre-line;
}
.game-watchers {
  white-space: pre-wrap;
  padding-top: calc(var(--padding-y) + 0.25rem);
  padding-bottom: var(--padding-y);
}

.chat-text strong.mine {
  font-weight: bold;
}
.chat-user-playing::after {
  content: '';
  display: inline-block;
  width: 0.45em;
  height: 0.45em;
  margin-left: 0.35em;
  border-radius: 50%;
  background-color: currentColor;
  opacity: 0.55;
  vertical-align: middle;
}
.chat-text strong.mention {
  font-weight: bold;
}
.chat-text strong.chat-notification {
  font-style: italic;
}
.chat-text span.timestamp {
  font-size: 0.75em;
  font-variant: small-caps;
}
.chat-text a {
  text-decoration: none;
}

#chat-scroll-button {
  display: none;
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
}

@media (min-width: 768px) {
  #left-col {
    min-width: 340px;
  }
  #right-col {
    min-width: 390px;
  }

  body.chat-hidden #right-col {
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    height: auto;
  }
  body.chat-hidden #main-row {
    padding-top: var(--right-col-height, 3.5rem);
  }
  body.chat-hidden #left-col {
    width: 50%;
    flex-shrink: 0;
    padding-left: 2rem;
    padding-right: 1rem;
  }
  body.chat-hidden #mid-col {
    width: 50%;
    flex-shrink: 0;
    padding-left: 1rem;
    padding-right: 2rem;
  }
}

#fake-input-text:focus-within {
  color: #212529;
  background-color: #fff;
  border-color: #86b7fe;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}
#input-text {
  overflow-x: hidden;
  resize: none;     
  border: none;
  box-shadow: none;
  padding-right: 0.375rem;
  background-color: transparent;
  min-height: calc(1.5em + .75rem);
}

@keyframes flash {
  0%, 100% { background-color: var(--form-control-bg, white); }
  50% { background-color: var(--flash-color, #ffcccc); } 
}
.flash {
  animation: flash 0.3s ease;
}

#emoji-button-container {
  align-self: end;
}
#emoji-button {
  font-size: 1.375rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.25rem;
  padding-left: 0.375rem;
  border: none;
}
#emoji-button svg {
  display: block;
  width: 1em;
  height: 1em;
  fill: currentColor;
}
#emoji-panel {
  display: flex;
  flex-direction: column;
  position: absolute;
  align-items: end;
  justify-content: end;
  right: 0;
  bottom: 100%;
  z-index: 6;
  visibility: hidden;
}
.emoji-panel-arrow {
  position: relative;
  width: 0;
  height: 0;
  right: 0.5rem;
  bottom: 1px;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 16px solid; 
}

.counter-number {
  font-size: 8px;
}

#session-status {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
}

.player-status .name {
  display: inline-block;
  white-space: nowrap;
  font-size: 1.6rem;
  line-height: 21px;
  padding: 0.5rem;
}

.clickable-user {
  cursor: pointer;
}

.captured {
  white-space: nowrap;
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.captured-piece {
  padding-top: 0.35em;
  padding-bottom: 0.65em;
  line-height: 2.6em;
}

.captured .captured-piece-img {
  display: inline-block;
  background-size: cover;
  vertical-align: middle;
  margin: -15px -5px 0 2px;
  width: 23px;
  height: 23px;
  opacity: 0.6;
  pointer-events: none;
}

.captured small {
  position: relative;
  left: -10px;
  top: 12px;
  opacity: 0.6;
}

.clock {
  align-items: baseline;
  padding-left: 15px;
  padding-right: 15px;
}

.clock-time {
  font-size: 1.6rem;
}
.fractional-clock-time {
  font-size: 1.0rem;
}

.clock.my-turn {
  box-shadow: inset 0 0 0 1px var(--box-shadow-color);
}

.top-panel, .bottom-panel {
  height: 3.5rem;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  flex-shrink: 0;
}

.setup-board {
  padding-left: 0.5em;
  padding-right: 0.5em;
  font-size: calc(min(var(--panel-width) / 32, var(--panel-height) / 3.5));
}
.setup-board-white::after, .setup-board-black::after {
  all: unset;
}
.setup-board-buttons {
  min-width: 8.25em;
}
.setup-board-buttons button {
  font-size: calc(min(var(--panel-width) / 16, var(--panel-height) / 1.8));
  padding: 0.25em;
}
.color-to-move-button {
  font-size: calc(min(var(--panel-width) / 32, var(--panel-height) / 3.5));
  --bs-btn-padding-x: 0.75em;
  --bs-btn-padding-y: 0.375em;
}
.setup-board .can-castle {
  margin-left: 0.75em;
  margin-right: 0.75em;
}
.setup-board .setup-board-piece {
  display: inline-block;
  position: static;
  flex: 1;
  max-width: calc(var(--panel-height) - 8px);
  height: auto;
  aspect-ratio: 1 / 1;
  pointer-events: auto;
  cursor: pointer;
}

.game-card {
  --border-expand-width: 2px;
}

.game-card .player-status {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.game-card .title-bar {
  display: none;
  padding-top: 0px;
  padding-bottom: 0px;
  padding-left: 5px;
  padding-right: 5px;
}

.game-card .title-bar-text {
  font-size: 0.8em;
  line-height: 1;
  user-select: none;
  cursor: default;
  white-space: nowrap;
  overflow: hidden;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.game-card .title-bar .btn {
  padding: 2px;
  line-height: 1;
  font-size: 1em;
}

.game-card .title-bar .game-close-button {
  padding-left: 1px;
  padding-right: 1px;
}

.game-card-sm .player-status {
  padding-left: 0.25rem;
  padding-right: 0.25rem;
}

.game-card-sm .top-panel,
.game-card-sm .bottom-panel {
  height: 32px;
}

.game-card-sm .name {
  font-size: inherit;
  padding: 0.5rem;
}

.game-card-sm .rating {
  font-size: 0.6rem;
}

.game-card-sm .clock {
  padding-left: 10px;
  padding-right: 10px;
}

.game-card-sm .clock-time {
  font-size: 1.0rem;
}

.game-card-sm .fractional-clock-time {
  font-size: 0.625rem;
}

.game-card-sm .captured {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.game-card-sm .captured-piece {
  font-size: 0.75rem;
  padding-top: 0.38em;
  padding-bottom: 0.38em;
}

.game-card-sm .captured .captured-piece-img {
  margin: -13px -6px 0 -1px;
  width: 15px;
  height: 15px;
}

.game-card-sm .captured small {
  left: -4px;
  top: 6px;
}

#secondary-board-area {
  display: none;
  gap: 8px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.board-sprites {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.btn-transparent {
  --bs-btn-active-bg: transparent;
  --bs-btn-hover-bg: transparent;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-active-border-color: transparent;
  --bs-btn-disabled-bg: transparent;
  --bs-btn-disabled-border-color: transparent;
}

#game-toolbar {
  padding-top: 3px;
  padding-bottom: 3px;
  padding-right: 0.5rem;
  border-bottom: 1px solid;
}
.menu-icon {
  display: inline-block;
  width: 1.25rem;
}
#game-tools-open-games .dropdown-icon {
  transform: translateX(-0.25rem);
}
#game-tools-close .dropdown-icon {
  transform: translateX(0.125rem);
}

#game-list-button > .label {
  display: inline-flex;
  overflow: hidden;
  max-width: calc(100% - 20px);
}
#game-list-dropdown {
  min-width: 100%;
  max-width: 100vw;
  width: 1400px;
}
#game-list-scroll-container {
  list-style: none;
  overflow: auto;
  max-height: calc(100vh - 300px);
}

#game-list-menu th,
#game-list-menu td {
  overflow: hidden;
  white-space: nowrap;
  width: 1%;
}
#game-list-menu th:nth-child(8),
#game-list-menu td:nth-child(8) {
  width: auto;
}

#game-opening-name {
  text-align: center;
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  border-top: 1px solid;
}

#move-table {
  padding: 0;
  text-align: center;
  table-layout: fixed;
}
#move-table th {
  border: 0;
  width: 20%;
  opacity: 0.5;
}
#move-table td {
  border: 0;
  width: 40%;
  padding-top: 3px;
  padding-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
}
#move-table .move {
  display: inline-block;
  vertical-align: top;
  padding-top: 1px;
  padding-bottom: 1px;
  padding-left: 15px;
  padding-right: 15px;
  text-decoration: none;
}
#move-table .selectable {
  cursor: pointer;
}
#move-table .selectable:has(.selected) {
  cursor: default;
}
#move-table .selectable:hover .move {
  font-weight: bold;
}
#move-table .subvariation .move {
  font-weight: normal;
}
#move-table .subvariation td {
  padding-right: 0;
}
#move-table .subvariation table {
  background-image: linear-gradient(var(--bracket-color), var(--bracket-color)),
                    linear-gradient(var(--bracket-color), var(--bracket-color)),
                    linear-gradient(var(--bracket-color), var(--bracket-color)),
                    linear-gradient(var(--bracket-color), var(--bracket-color));
  background-repeat: no-repeat;
  background-size: 8px 3px;
  background-position: top left, bottom left;
  border: 1px solid;
  border-right: none;
  border-width: 0 3px;
}
#move-table .selected {
  font-weight: bold;
  box-shadow: inset 0 0 0 1px var(--box-shadow-color);
}

.movelist .move:not(.selected) {
  cursor: pointer;
}
.movelist .comment {
  cursor: text;
}
.movelist .subvariation {
  display: block;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  position: relative;
  padding-top: 2px;
  padding-bottom: 2px;
}
.movelist .subvariation:not(:has(+ .subvariation)) {
  padding-bottom: 3px;
}
.movelist .subvariation:not(.subvariation + .subvariation) {
  padding-top: 3px;
}
.movelist .subvariation::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0px;
  bottom: 0px;
  width: 1px;
  border-left: 1px solid;
}
.movelist .subvariation:has(+ .subvariation)::before {
  bottom: 2px;
}
.movelist .subvariation + .subvariation::before {
  top: 2px;
}

.comment {
  outline: none;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.comment[data-before-content]:after {
  content: attr(data-before-content) " ";
  font-style: italic;
}
.comment:after {
  content: " "; /* use trailing space to allow text wrapping to work properly */
}

.annotations-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 5 columns for symbols */
}
.annotations-menu .dropdown-item {
  text-align: center;
  padding-left: 6px;
  padding-right: 6px;
}
.annotation {
  font-family: "Segoe UI Symbol", var(--bs-body-font-family), "Noto Sans Symbols 2", "Noto Sans Math";
}

.piece-glyph::before {
  font-size: 1.3rem;
  font-weight: normal;
  font-family: "Noto Sans Symbols 2", var(--bs-body-font-family);
  margin-left: -0.2rem;
  margin-right: -0.03rem;
  line-height: 1rem; /* Ensure line-height is smaller than for regular text, so that it aligns to regular text's baseline */
}

.flex-line-break {
  flex-basis: 100%;
}

.nav-pills {
  border: 1px solid transparent;
}

#pills-tab .nav-link {
  white-space: nowrap;
  padding-inline: 0;
}

.nav-tabs .nav-item .closeTab {
  opacity: 0;
  margin: 0px;
  padding: 0px;
  font-size: 0.85em;
}
.nav-tabs .nav-item:hover .closeTab {
  opacity: 1;
}
.nav-tabs .nav-link {
  font-size: 0.85em;
  padding-top: 1px;
  padding-bottom: 1px;
}

#tabs .nav-link {
  height: 32px
}

.tab-unviewed {
  color: tomato !important;
  font-weight: bold;
}

.dropdown-icon {
  margin-right: 6px;
}

.hide-caret.dropdown-toggle::after {
  display: none;
}

#variants-button {
  border-bottom-right-radius: 0;
  border-top-right-radius: 0;
}

.color-box {
  margin: 0 5px;
  width: 10px;
  height: 10px;
  display: inline-block;
  position: relative;
}

.movetime {
  display: inline-block;
  text-align: left;
  margin-left: 0.75rem;
  font-size: 0.75em;
  min-width: 10ch;
}

#textsize-range {
  width: 60px;
  height: auto;
  padding-left: 5px;
}

#engine-pvs {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: auto;
}
#engine-pvs > li {
  padding: 6px;
}

#engine-pvs {
  font-size: 0.4em;
  white-space: nowrap;
  width: 100%;
  height: 100%;
}
#engine-pvs > li {
  font-size: 2.3em;
}
.btn-engine {
  font-family: monospace;
  font-weight: bold;
}

.pane-status {
  padding: 10px;
  text-align: center;
}

@media (max-width: 767px) {
  .collapse-init {
    display: none;
  }
}

/* Turn hover state off for buttons on devices with no mouse (mobile) because it looks stupid */
/* We achieve this by setting the hover color to match the normal button color */
@media (hover: none) {
  .btn-outline-secondary:hover {
    --bs-btn-hover-color: var(--bs-btn-color);
    --bs-btn-hover-bg: var(--bs-btn-bg);
  }
}

.eval-line-above {
  fill: none;
  stroke-width: 3;
}
.eval-line-below {
  fill: none;
  stroke-width: 3;
}
.eval-area-above {
  stroke-width: 0;
}
.eval-area-below {
  stroke-width: 0;
}
.eval-axis .tick line {
  stroke-width: 1;
}
.eval-circle  {
  stroke-width: 2;
}
#eval-progress {
  padding: 20px;
}

.game-card .eval-bar {
  display: none;
  width: 34px;
  font-size: 0.8rem;
  font-weight: bold;
}
@media (max-width: 767px) {
  .game-card .eval-bar {
    width: 26px;
  }
}

.game-card-sm .eval-bar {
  width: 17px;
}
@media (max-width: 767px) {
  .game-card-sm .eval-bar {
    width: 12px;
  }
}

.eval-bar-text {
  display: none;
  text-box-trim: trim-both;
  text-box-edge: cap alphabetic;
}
.game-card:not(.game-card-sm) .side-ahead.eval-bar-text {
  display: block;
}
.eval-bar-segment:first-child .eval-bar-text {
  padding-bottom: 0.75rem;
  margin-top: auto;
}
.eval-bar-segment:last-child .eval-bar-text {
  padding-top: 0.75rem;
}
.eval-bar-white {
  height: 50%;
  transition: height 0.7s linear;
  color: #212529;
}
.eval-bar-black {
  flex-grow: 1;
  min-height: 0;
  color: whitesmoke;
}

.promotion-panel {
  display: none;
  flex-direction: column;
  position: absolute;
  z-index: 10;
  height: 50%;
  width: 12.5%;
  top: 0;
  left: 0;
  box-sizing: border-box;
  box-shadow: 0 0 4px var(--box-shadow-color),
              0 0 6px var(--box-shadow-color),
              0 4px 6px -4px var(--box-shadow-color),
              0 -4px 6px -4px var(--box-shadow-color);
}
.promotion-panel::after {
  all: unset;
}
.promotion-panel .promotion-piece {
  flex: 1;
  position: static;
  width: 100%;
  pointer-events: auto;
  cursor: pointer;
}

/* Fix margin collapse glitch */
#lobby-table .btn:not(:last-child) {
  margin: 0px;
  border-bottom: none;
}

#notifications {
  position: fixed; 
  z-index: 2000; 
  top: var(--safe-area-top); 
  right: var(--safe-area-right);
  max-height: calc(100dvh - var(--safe-area-height)); 
  overflow-y: auto;
}
.notification-panel {
  transition: none;
  width: 100%;
  position: relative;
  z-index: 0;
}
#notifications.slide-up {
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.notification-panel.slide-down {
  transition: opacity 0.8s ease, margin-top 0.8s ease, z-index 0s ease 0.8s;
}
.notification-panel.slide-sideways {
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.notification-panel.slide-up {
  transition: opacity 0.8s ease, margin-top 0.8s ease;
}
.notifications-panel.notification .toast-header {
  padding-top: 6px;
  padding-bottom: 6px;
}
.notifications-panel.notification .toast-body {
  padding-top: 10px;
  padding-bottom: 10px;
}
#notifications-header .toast-body {
  padding-top: 1px;
  padding-bottom: 1px;
}
#notifications-close-icon {
  font-size: 19px;
  transform: translate(-4.8px, -3.2px);
}
#notifications-footer .toast-body {
  padding-top: 3px;
  padding-bottom: 4px;
}
.toast-body .body-text {
  word-break: break-word;
}

.close {
  padding-left: 6px;
  padding-right: 6px;
  padding-top: 1px;
  padding-bottom: 1px;
}

#play-computer-modal .modal-dialog {
  max-width: 400px;
}

.settings-pane {
  max-height: calc(100vh - 180px - 1rem);
  overflow: auto;
  padding-left: var(--bs-modal-padding);
  padding-right: var(--bs-modal-padding);
}
.settings-pane .form-check-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
}
#settings-modal .modal-dialog {
  max-width: 680px;
}
#settings-modal .tab-pane {
  overflow: hidden;
}
#settings-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bs-modal-bg);
  flex-wrap: wrap;
  row-gap: 0.25rem;
}
#settings-tabs .nav-link {
  white-space: nowrap;
}

@media (max-width: 767px) {
  #settings-tabs {
    row-gap: 0.2rem;
    column-gap: 0.2rem;
  }

  #settings-tabs .nav-item {
    margin-bottom: 0;
  }

  #settings-tabs .nav-link {
    padding: 0.25rem 0.45rem;
    font-size: 0.85rem;
    line-height: 1.2;
  }

  #settings-shortcuts-tab {
    display: none;
  }

  #settings-shortcuts {
    display: none !important;
  }

  #main-settings .form-group.row > .col {
    flex: 0 0 100%;
    max-width: 100%;
  }

  #main-settings .form-group.row {
    row-gap: 0.35rem;
  }

  .settings-toggle-help {
    font-size: 0.75rem;
  }
}

.settings-back {
  font-size: 1.5rem;
}

.info-icon {
  cursor: pointer;
  vertical-align: middle;
  width: 1em;
  height: 1em;
}

.settings-info-icon {
  vertical-align: text-top;
}

.settings-toggle-help {
  margin-top: 0.2rem;
  margin-left: 0;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--bs-secondary-color, #6c757d);
}

.settings-shortcuts-layout {
  min-height: 0;
}

.settings-shortcuts-body {
  min-height: 0;
  gap: 20px;
  align-items: flex-start;
}

#settings-shortcuts #shortcut-settings-right-col {
  flex: 0 0 360px;
  width: 360px;
  max-width: 100%;
}

#settings-shortcuts #shortcut-buttons {
  white-space: nowrap;
  display: flex;
  gap: 0.625rem;
}

#settings-shortcuts #shortcut-input-group {
  margin-bottom: 0.75rem;
}

#shortcuts-list {
  position: static;
  align-self: stretch;
  flex: 1 1 auto;
  min-width: 0;
  max-height: 340px;
  overflow-y: auto; 
  overflow-x: hidden;
  z-index: 0;
}

#macros-key {
  font-size: 0.8rem;
}
.macros-key-description {
  font-style: italic;
}

.tooltip-separator {
  margin-top: 4px;
  margin-bottom: 4px;
}

.tooltip-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

input[type="number"] {
  appearance: initial;
  -moz-appearance: textfield;
}
input[type="number"]:hover,
input[type="number"]:focus {
  appearance: initial;
}

.premove-target::before {
  content: attr(data-order);
  position: absolute;
  top: 0.6em;
  left: 0.2em;
  font-size: 1.4vh;
  pointer-events: none;
}

.eye-toggle {
  --eye-toggle-icon-width: 1.125rem;
}
.eye-toggle label {
  white-space: nowrap;
  --bs-btn-hover-border-color: transparent;
  --bs-btn-border-color: transparent;
  --bs-btn-active-border-color: transparent;
}
.eye-toggle-icon {
  display: inline-block; 
  width: var(--eye-toggle-icon-width);  
  margin-right: 0.5rem;
} 
.eye-toggle-help {
  margin-top: -0.25rem; 
  margin-left: calc(var(--eye-toggle-icon-width) + 1.25rem);
}

.not-signed-in-notice {
  position: absolute; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%);
  border: 1px solid;
  z-index: 2;
  padding: 2rem;
  border-radius: 8px;
  white-space: nowrap;
}

.banner-alert {
  position: fixed; 
  width: fit-content; 
  white-space: nowrap;
  top: var(--safe-area-top);
  left: var(--safe-area-left);
  transform: translateY(-100%);
  transition: opacity 0.8s ease, transform 0.8s ease;
  z-index: 1050;
  background: #000;
  color: #fff;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
  padding-left: 1rem;
  padding-right: 1rem;
  font-weight: bold;
}
.banner-alert.show {
  transform: translateY(0); 
}

.tournament-group {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  padding-top: 0;
  padding-bottom: 0.75rem;
}
.tournament-group-header {
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}
.tournament-group-title {
  display: inline-block;
  font-weight: bold;
}
.tournament-group-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card.tournament-card {
  --bs-card-color: var(--fg-color);
}

@media (max-width: 767px) {
  .card.tournament-card {
    font-size: 0.9rem;
  }

  .settings-shortcuts-body {
    flex-direction: column;
    gap: 0.75rem;
  }

  #settings-shortcuts #shortcut-settings-right-col {
    width: 100%;
  }

  #settings-shortcuts #shortcut-buttons {
    display: flex;
    width: 100%;
    gap: 0.5rem;
    white-space: normal;
  }

  #settings-shortcuts #shortcut-buttons .btn {
    flex: 1 1 0;
  }

  #shortcuts-list {
    max-height: 180px;
  }
}

#tournaments-pane-status {
  position: sticky;
  top: 0;
  z-index: 2;
  background-color: var(--bg-color, white);
}

.tournament-table-modal .modal-dialog {
  width: fit-content;
  max-width: min(calc(100vw - var(--bs-modal-margin) * 2));
}
.tournament-table-container {
  min-height: 100px;
  max-height: 500px; 
  overflow: auto;
}
.tournament-table-container table {
  width: auto;
}

.tournament-players-modal {
  --bs-modal-width: 1000px;
} 
.tournament-players-modal .modal-dialog {
  width: fit-content;
} 
.tournament-players {
  min-height: 100px;
  max-height: 500px; 
  overflow: auto;
}
.tournament-players table {
  width: auto;
}

.tournament-table-result { font-weight: bold; }

#profile-modal {
  --bs-modal-width: 600px;
}
#profile-tabs-content  {
  height: 400px;
}

#finger-notes-table {
  border: 1px solid;
  table-layout: fixed;
  width: 100%;
}
#finger-notes-table th {
  width: 5ch;
  text-align: right;
  user-select: none;
}
#finger-notes-table td {
  outline: none; 
  white-space: pre-wrap;
}
#finger-notes-table th, #finger-notes-table td {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}
#finger-notes-table tbody {
  counter-reset: row;
}
#finger-notes-table tbody th::before {
  counter-increment: row;
  content: counter(row);
}

#users-modal {
  --bs-modal-width: 600px;
}

.users-table {
  table-layout: fixed;
}
.users-table th,
.users-table td {
  overflow: hidden;
}
.users-table td:nth-child(1),
.users-table th:nth-child(1) {
  width: 45%;
}
.users-table td:nth-child(2),
.users-table th:nth-child(2) {
  width: 11ch;
}
.users-table td:nth-child(3),
.users-table th:nth-child(3) {
  width: auto;
  min-width: 0;
}
.users-table .user-status {
   flex-grow: 1;
   overflow: hidden; 
   min-width: 0; 
   white-space: nowrap;
}
.users-table .user-buttons {
  display: none;
  padding-left: 3ch;
  white-space: normal;
}
.users-table tr:hover .user-buttons {
  display: inline-flex;
}

.info-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  --bs-toast-max-width: 800px;
  --bs-toast-color: var(--fg-color);
}
@media (max-width: 767px) {
  .info-dialog {
    font-size: 0.7rem;
  }
}

.eval-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 12.5%;
  height: 12.5%;
  pointer-events: none;
  z-index: 3;
}
.eval-icon::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 30%;
  height: 30%;
  transform: translate(50%, -50%);
  border-radius: 50%;
  background-color: var(--eval-icon-bg); 
  box-shadow:
    inset 0 0.5px 0.75px rgba(255, 255, 255, 0.25),
    inset 0 0 0 0.75px rgba(255, 255, 255, 0.18),
    inset 0 -0.75px 1px rgba(0, 0, 0, 0.45),
    0 1px 1.25px rgba(0, 0, 0, 0.35);
}
.eval-icon::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 20%;
  height: 20%;
  transform: translate(50%, -50%);
  background-color: white;
  -webkit-mask: var(--eval-icon-url) center / contain no-repeat;
  mask: var(--eval-icon-url) center / contain no-repeat; 
  pointer-events: none;
}

.eval-icon-book {
  --eval-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\3c !--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M320 205.3L320 514.6L320.5 514.4C375.1 491.7 433.7 480 492.8 480L512 480L512 160L492.8 160C450.6 160 408.7 168.4 369.7 184.6C352.9 191.6 336.3 198.5 320 205.3zM294.9 125.5L320 136L345.1 125.5C391.9 106 442.1 96 492.8 96L528 96C554.5 96 576 117.5 576 144L576 496C576 522.5 554.5 544 528 544L492.8 544C442.1 544 391.9 554 345.1 573.5L332.3 578.8C324.4 582.1 315.6 582.1 307.7 578.8L294.9 573.5C248.1 554 197.9 544 147.2 544L112 544C85.5 544 64 522.5 64 496L64 144C64 117.5 85.5 96 112 96L147.2 96C197.9 96 248.1 106 294.9 125.5z"/></svg>');
  --eval-icon-bg: #1E9E55;
}
.eval-icon-best {
  --eval-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\3c !--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M341.5 45.1C337.4 37.1 329.1 32 320.1 32C311.1 32 302.8 37.1 298.7 45.1L225.1 189.3L65.2 214.7C56.3 216.1 48.9 222.4 46.1 231C43.3 239.6 45.6 249 51.9 255.4L166.3 369.9L141.1 529.8C139.7 538.7 143.4 547.7 150.7 553C158 558.3 167.6 559.1 175.7 555L320.1 481.6L464.4 555C472.4 559.1 482.1 558.3 489.4 553C496.7 547.7 500.4 538.8 499 529.8L473.7 369.9L588.1 255.4C594.5 249 596.7 239.6 593.9 231C591.1 222.4 583.8 216.1 574.8 214.7L415 189.3L341.5 45.1z"/></svg>');
  --eval-icon-bg: #2F5FA7;
}
.eval-icon-ok {
  --eval-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\3c !--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M530.8 134.1C545.1 144.5 548.3 164.5 537.9 178.8L281.9 530.8C276.4 538.4 267.9 543.1 258.5 543.9C249.1 544.7 240 541.2 233.4 534.6L105.4 406.6C92.9 394.1 92.9 373.8 105.4 361.3C117.9 348.8 138.2 348.8 150.7 361.3L252.2 462.8L486.2 141.1C496.6 126.8 516.6 123.6 530.9 134z"/></svg>');
  --eval-icon-bg: #6FA84F;
}
.eval-icon-inaccuracy {
  --eval-icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Csvg x='0' y='0' width='1000' height='1000' viewBox='0 0 920 640' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cpath id='question-mark' d='M224 224C224 171 267 128 320 128C373 128 416 171 416 224C416 266.7 388.1 302.9 349.5 315.4C321.1 324.6 288 350.7 288 392L288 416C288 433.7 302.3 448 320 448C337.7 448 352 433.7 352 416L352 392C352 390.3 352.6 387.9 355.5 384.7C358.5 381.4 363.4 378.2 369.2 376.3C433.5 355.6 480 295.3 480 224C480 135.6 408.4 64 320 64C231.6 64 160 135.6 160 224C160 241.7 174.3 256 192 256C209.7 256 224 241.7 224 224zM320 576C342.1 576 360 558.1 360 536C360 513.9 342.1 496 320 496C297.9 496 280 513.9 280 536C280 558.1 297.9 576 320 576z'/%3E%3Cpath id='exclaimation-mark' d='M320 496C342.1 496 360 513.9 360 536C360 558.1 342.1 576 320 576C297.9 576 280 558.1 280 536C280 513.9 297.9 496 320 496zM320 64C346.5 64 368 85.5 368 112C368 112.6 368 113.1 368 113.7L352 417.7C351.1 434.7 337 448 320 448C303 448 289 434.7 288 417.7L272 113.7C272 113.1 272 112.6 272 112C272 85.5 293.5 64 320 64z'/%3E%3C/defs%3E%3Cg transform='translate(460,320) scale(1.1) translate(-460,-320)'%3E%3Cuse href='%23question-mark'/%3E%3Cuse href='%23exclaimation-mark' transform='translate(320, 0)'/%3E%3C/g%3E%3C/svg%3E%3C/svg%3E");
  --eval-icon-bg: #C39A06;
}
.eval-icon-mistake {
  --eval-icon-url: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 640">\3c !--!Font Awesome Free v7.2.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2026 Fonticons, Inc.--><path d="M224 224C224 171 267 128 320 128C373 128 416 171 416 224C416 266.7 388.1 302.9 349.5 315.4C321.1 324.6 288 350.7 288 392L288 416C288 433.7 302.3 448 320 448C337.7 448 352 433.7 352 416L352 392C352 390.3 352.6 387.9 355.5 384.7C358.5 381.4 363.4 378.2 369.2 376.3C433.5 355.6 480 295.3 480 224C480 135.6 408.4 64 320 64C231.6 64 160 135.6 160 224C160 241.7 174.3 256 192 256C209.7 256 224 241.7 224 224zM320 576C342.1 576 360 558.1 360 536C360 513.9 342.1 496 320 496C297.9 496 280 513.9 280 536C280 558.1 297.9 576 320 576z"/></svg>');
  --eval-icon-bg: #C65A11;
}
.eval-icon-blunder {
  --eval-icon-url: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1000 1000'%3E%3Csvg x='0' y='0' width='1000' height='1000' viewBox='0 0 1000 640' preserveAspectRatio='none'%3E%3Cdefs%3E%3Cpath id='icon' d='M224 224C224 171 267 128 320 128C373 128 416 171 416 224C416 266.7 388.1 302.9 349.5 315.4C321.1 324.6 288 350.7 288 392L288 416C288 433.7 302.3 448 320 448C337.7 448 352 433.7 352 416L352 392C352 390.3 352.6 387.9 355.5 384.7C358.5 381.4 363.4 378.2 369.2 376.3C433.5 355.6 480 295.3 480 224C480 135.6 408.4 64 320 64C231.6 64 160 135.6 160 224C160 241.7 174.3 256 192 256C209.7 256 224 241.7 224 224zM320 576C342.1 576 360 558.1 360 536C360 513.9 342.1 496 320 496C297.9 496 280 513.9 280 536C280 558.1 297.9 576 320 576z'/%3E%3C/defs%3E%3Cg transform='translate(500,320) scale(1.1) translate(-500,-320)'%3E%3Cuse href='%23icon'/%3E%3Cuse href='%23icon' transform='translate(360, 0)'/%3E%3C/g%3E%3C/svg%3E%3C/svg%3E%0A");
  --eval-icon-bg: #B83225;
}

.seek-graph-tooltip {
  pointer-events: none;
}
.seek-graph-tooltip .tooltip-inner {
  max-width: none;
}

.overlaid-close-btn {
  position: absolute;
  padding: 0;
  margin: 0;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  z-index: 1;
}
.overloaid-close-btn svg {
  display: block;
}

#boards-menu {
  gap: 0.75rem;
}
.boards-menu-btn-wrapper {
  display: inline-block;
  position: relative;
  margin-left: 0.5rem;
  flex: 0 0 40px; 
}
.boards-menu-btn {
  width: 100%;
  position: relative;
  z-index: 0;
  background:
    linear-gradient(var(--light-squares), var(--light-squares))
      left / 50% 100% no-repeat,
    linear-gradient(var(--dark-squares), var(--dark-squares))
      right / 50% 100% no-repeat;
  background-clip: padding-box;
}
.boards-menu-btn:hover {
  z-index: 1;
}

#pieces-menu {
  gap: 0.75rem;
}
.pieces-menu-btn-wrapper {
  display: inline-block;
  position: relative;
  margin-left: 0.5rem;
}
.pieces-menu-btn {
  position: relative;
  z-index: 0;
}
.pieces-menu-btn:hover {
  z-index: 1;
}
.pieces-menu-btn img {
  width: 36px;
}

.clickable-row {
  cursor: pointer;
  transition: background-color .15s ease;
}
.table-hover .clickable-row:hover > * {
  background-color: color-mix(in srgb, var(--bs-table-bg) 82%, rgb(var(--bs-primary-rgb)) 18%);
}
.clickable-row:active > *,
.clickable-row.table-active > * {
  background-color: color-mix(in srgb, var(--bs-table-bg) 72%, rgb(var(--bs-primary-rgb)) 28%);
}
.clickable-row:focus {
  outline: 2px solid var(--bs-primary);
}

#lobby-table {
  table-layout: fixed;
  width: 100%;
}
#lobby-table th,
#lobby-table td {
  padding-left: 0.75rem; 
  padding-right: 0.75rem;
  overflow: hidden;
}
#lobby-table col:nth-child(1) { 
  width: 10ch; /* Name min-width */
}
#lobby-table col:nth-child(2) { 
  width: 45%; /* Name extra width */
}
#lobby-table col:nth-child(3) { 
  width: 7ch; /* Rat min-width */
}
#lobby-table col:nth-child(4) { 
  width: 5%; /* Rat extra width */
}
#lobby-table col:nth-child(5) {
  width: 8ch; /* Time min-width */
}
#lobby-table col:nth-child(6) {
  width: 5%; /* Time extra width */
}
#lobby-table col:nth-child(7) {
  width: 6ch; /* Type min-width */
}
#lobby-table col:nth-child(8) {
  width: 45%; /* Type extra width */
}
.table-head-sm th {
  padding-top: 0.25rem; 
  padding-bottom: 0.25rem; 
}

#lobby-filter-menu .form-check-input,
#lobby-filter-menu .form-check-label {
  cursor: pointer;
}

#color-picker-btn {
  display: none;
  position: fixed;
  transform: translate(calc(-50% + 2px), calc(-50% - 2px));
  margin: 0;
  padding: 0;
  z-index: 1081;
}
#color-picker-btn img {
  height: 30px;
  width: 30px;
  transition: transform 120ms ease;
}
#color-picker-btn:hover img {
  transform: scale(1.5);
}

#color-picker-btn.inactive-hover {
  transition: opacity 1s ease-in;
}
#color-picker-btn.inactive-hover img {
  transform: none;
}

.color-picker-settings {
  display: grid;
  grid-template-columns: max-content auto;
  column-gap: 12px;
  row-gap: 8px;
  align-items: center;
  justify-content: center;
}
.color-picker-settings label {
  justify-self: end;
}

.mini-board {
  display: inline-grid;
  grid-template-columns: repeat(2, 50px);
  grid-template-rows: repeat(2, 50px);
  border: 1px solid var(--bs-border-color);
  justify-self: center;
  box-sizing: border-box;
  background-position: 0 0;
  background-size: 400% 400%;
  will-change: background-image;
  background-clip: padding-box;
}
.mini-board::after {
  all: unset;
}
.mini-board-square {
  width: 50px;
  height: 50px;
  position: relative;
}
.mini-board-square > .mini-board-piece, .mini-board-square > img {
  width: 100%;
  height: 100%;
}

.color-picker-btn, .open-color-picker {
  cursor: pointer;
}
.color-picker-btn {
  width: 48px;
  height: 28px;
  --swatch-color: #000000;
  --bs-btn-bg: var(--swatch-color);
  --bs-btn-active-bg: var(--bs-btn-bg);
  --bs-btn-hover-bg: var(--bs-btn-bg);
}
.color-picker-popover {
  z-index: 1082;
}

#explorer-navbar {
  position: sticky;
  top: 0;
  margin-bottom: 2px;
}
#explorer-opening-name {
  text-align: center;
}
#explorer-opening-name.starting-pos {
  font-style: italic;
}
@media (min-width: 768px) {
 #explorer-shrink-grow {
  visibility: hidden;
 } 
}

.explorer-table thead {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 0.5rem;
}

#explorer-moves {
  white-space: nowrap;
}
#explorer-moves > tbody td {
  vertical-align: baseline;
}
#explorer-moves td:nth-child(1) {
  font-weight: bold;
  font-size: 1.1rem;
}
#explorer-moves td:nth-child(2),
#explorer-moves th:nth-child(2) {
  text-align: right; 
}
#explorer-moves td:nth-child(3),
#explorer-moves th:nth-child(3) {
  text-align: right; 
}
#explorer-moves td:nth-child(4),
#explorer-moves th:nth-child(4) {
  text-align: center; 
  vertical-align: middle;
  width: 100%;
}

.explorer-results-bar {
  display: flex;
  width: 100%;
  font-size: 0.9rem;
  overflow: hidden;
  border: 1px solid;
  border-radius: 8px;
}
.explorer-results-bar > span {
  padding-left: 0.5rem;
  padding-right: 0.5rem;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
}

#explorer-games {
  white-space: nowrap;
}
#explorer-games > tbody td {
  vertical-align: middle;
}
#explorer-games th:nth-child(1) {
  text-align: left;
}
#explorer-games td:nth-child(1) {
  text-align: left;
}
#explorer-games td:nth-child(2) {
  text-align: center; 
}
#explorer-games td:nth-child(3) {
  text-align: center; 
}

.explorer-game-result {
  display: inline-block;
  width: 6ch;
  font-size: 0.9rem;
  border: 1px solid;
  border-radius: 8px;
}

.explorer-results-bar > .white, .explorer-game-result.white {
  color: #212529;
  background-color: #CCC;
}
.explorer-results-bar > .draw, .explorer-game-result.draw {
  color: whitesmoke;
  background-color: grey;
}
.explorer-results-bar > .black, .explorer-game-result.black {
  color: whitesmoke;
  background-color: #222;
}

