.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 */
}

/* Fixes problem of body width not updating properly after screen rotate on mobile */
html, body {
  overflow-x: hidden;
}

body {
  padding-top: var(--safe-area-inset-top);
  padding-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom));
}

.feature3 {
  min-height: 100vh;
}

#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;
}

#channels-modal table td:nth-child(1),
#channels-modal table th:nth-child(1) {
  padding-left: 0.75rem;
}
#channels-modal table td:nth-child(2),
#channels-modal table th:nth-child(2) {
  text-align: center;
}
#channels-modal table thead {
 position: sticky; 
 top: 0;
 box-shadow: 0 1px 0 var(--box-shadow-color);
}

#game-requests {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.game-status {
  font-weight: bold;
}
.game-status .game-id {
  font-weight: normal;
}
.opening-name {
  text-align: center;
}
.game-watchers {
  white-space: pre-wrap;
}

#left-panel {
  height: 502px;
}
#left-panel.list-view-showing {
  height: 200px;
}
#left-panel-bottom {
  height: 192px;
  width: 100%;
}

.chat-text strong.mine {
  font-weight: bold;
}
.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%);
}

#right-col {
  min-width: 374px;
}

@media (min-width: 768px) {
  body.chat-hidden #right-col {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: auto;
    z-index: 1000;
  }
  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;
}

.btn-toolbar .btn {
    margin-right: 10px;
}
.btn-toolbar .btn:last-child {
    margin-right: 0;
}

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

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

.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;
}

.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 .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;
}

.game-card .title-bar .game-maximize-icon {
  font-size: 1em;
}

.game-card .title-bar .game-close-icon {
  font-size: 1.39em;   /* Randomely tweaked some values until the icons aligned properly */
  line-height: 0.72em;
  vertical-align: -0.11em;
}

.game-card-sm .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;
}

.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;
}

#game-toolbar {
  padding-top: 3px;
  padding-bottom: 3px;
  padding-right: 0.5rem;
  border-bottom: 1px solid;
}
.tools-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: 1000px;
}
#game-list-scroll-container {
  list-style: none;
  overflow: auto;
  max-height: calc(100vh - 300px);
}
#game-list-menu {
  padding: 0;
}

#move-table {
  padding: 0;
  text-align: center;
}
#move-table th {
  border: 0;
  width: 20%;
  opacity: 0.5;
}
#move-table td {
  border: 0;
  width: 40%;
  padding-top: 3px;
  padding-bottom: 3px;
}
#move-table .move {
  display: inline-block;
  vertical-align: top;
  padding-top: 1px;
  padding-bottom: 1px;
  text-decoration: none;
}
#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 {
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  font-weight: bold;
}

.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 .nav-link.active,
.nav-pills .show > .nav-link {
  border: 1px solid;
}

.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: none;
  font-size: 0.75em;
  color: var(--bs-secondary-color, #6c757d);
}
#left-panel:not(.list-view-showing) .movetime {
  display: inline;
}
#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 {
  margin: 10px;
  text-align: center;
}

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

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

@media (min-width: 768px) {
  #close-status {
    font-size: 20px;
    top: 9px;
    right: 3px;
    line-height: 0px;
    padding: 0px;
  }
}

/* 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;
}

.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;
}

.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(-1.5px, -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;
}

#difficulty-selector .form-check {
  width: 2.5rem;
}

.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;
}

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

.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: 0; 
  left: 0; 
  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); 
}