﻿body {
  user-select: none;
  margin: 0;
  background: #262522;
  color: #eee;
  font-family: Arial, Helvetica, sans-serif;
}

#aboutheader {
  text-align: center;
  color: rgb(133, 102, 102);
  font-size: 20px; 
  font-weight:100;
}

#maindiv {
  position: absolute;
  z-index: 9;
  top: 40px;
  background-color: #fff;

}

#mydivheader {
  margin-left: 200px;

  color: rgb(133, 102, 102);
  font-size: 20px; 
  font-weight:100;
}
.enco { 

  display: flex; 
  flex-wrap: nowrap; 
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-bottom: 6px; 
}

#ecotx {

  font-size: 16px; 
  color: blue;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;  
}

#eco {
  color: #fff;
  font-size: 14px;
  cursor:pointer;
  background-color: rgb(181, 135, 99);

}

.boardTables {
  margin-top: 0px;
  display: grid; 
  grid-column-gap: 16px;

}

.board1 {
    cursor:pointer;
    position: absolute;
    z-index: 0;
}

#Table1ramk {

  width: 160px;
  height: 550px;

  background-color: #eee;

}
#Table2ramk {
  width: 240px;
  height: 550px;
  background-color: #eee;

}

#Table1div {
  position: relative;
  height: 470px;
  margin-top: 6px;
  overflow-y: scroll;
  scrollbar-color: rebeccapurple #eee;
  scrollbar-width: thin;
}

#Table2div {
  position: relative;
  height: 470px;
  margin-top: 6px;
  overflow-y: scroll;
  scrollbar-color: rebeccapurple #eee;
  scrollbar-width: thin;

}

#myTabl1 {
margin-top: -3px;
}

#myTabl2 {
  margin-top: -3px;
  }

.Table1 {
  width: 88%;
  font-size: 14px; 
  border-collapse: collapse; 
  color: #000;
  margin: 6%;

}
.Table2 {
  width: 92%;
  font-size: 14px; 
  border-collapse: collapse;
  color: #000;
  margin: 4%;

}
.cap {

  color: rgb(84, 15, 196);
  font-size: 16px;  
}

thead {
  color: rgb(175, 135, 240);
  font-style: normal;
  font-weight: 100;
}

td {
  text-align: right;
  font-size: 14px; 
  cursor:pointer;
  height: 14px;
}

tr {
  border-bottom:1px groove #fff;
}

.drag { 
  position:relative;
  cursor:pointer;
  z-index: 21;

} 

#divHom {
  display: inline;
  position: relative;
  margin-right: 6px;
  width: 16px;
  cursor:pointer;
}

#divPre {
  display: inline;
  position: relative;
  margin-right: 6px;
  width: 16px;
  cursor:pointer;
}

#divNex {
  display: inline;
  position: relative;
  margin-right: 6px;
  width: 16px;
  cursor:pointer;
}

#divEnd {
  display: inline;
  position: relative;
  width: 16px;
  cursor:pointer;
}
textarea {
width: 99%;
height: 60px;
margin-top: 10px;
resize: none;
background-color: #eee;
border: none;
scrollbar-color: rebeccapurple #eee;
  scrollbar-width: thin;
}

#butPgn,
#LoadPgn {
  color: #fff;
  background-color: rgb(181, 135, 99);
  visibility: hidden;
  cursor:pointer;
}

#LoadPgn {
  visibility: visible;
}

#butPgn {
  display: none;
}

#pgnActions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

#infbut {

  color: #fff;
  background-color: rgb(181, 135, 99);
  cursor:pointer;
}

#engbut {
  width: 80px;
  color: #fff;
  background-color: rgb(181, 135, 99);
  float:right;
  margin-left: 4px;
  cursor:pointer;
}

#engres {
  height: 14px;
  width: 80px;
  background-color: #eee;
  border: 0;
  margin-top: 4px;
  margin-left: 8px;
  color: blue;
  cursor:pointer;
}
.page {
  margin-top: 30px;
  margin-left: 10%;
  width: 80%;
  background-color: #eee;
  font-family:'Roboto', Sans-Serif;
  font-weight:Normal;

}
p {
  font-size: 18px; 
}

.dept {
  width: 20px;
  background-color: #eee;
  margin-top: 2px;
}

.inkdec {
  height: 10px;
  font-size: 11px;
  cursor: pointer;
}

.num {
  width: 20px;
}
.move {
  width: 58px;
}
.score {
  width: 46px;
}
.Wmove {
  width: 50px;
}
.Wscore {
  width: 46px;
}
.Bmove {
  width: 50px;
}
.Bscore {
  width: 46px;
}
#playbordtab {
  display: grid;
  grid-column-gap: 16px;
  margin-top: 40px;
}

#Tablramk {
  width: 100%;
  height: 504px;
  background-color: #eee;
}

  .numb {
    width: 20px;
  }

  .white {
    width: 46px;
  }
  .black {
    width: 46px;
  }

  #movTabl {
    margin-top: -3px;
    }

  .Tablem {
    width: 92%;
    font-size: 14px; 
    border-collapse: collapse; 
    color: #000;
    margin: 4%;
  }

  #Tabldiv {
    position: relative;
    height: 460px;
    margin-top: 6px;
    overflow-y: scroll;
    scrollbar-color: rebeccapurple #eee;
    scrollbar-width: thin;
  }
#result {
    width: 156px;
    height: 24px; 
    font-size: 20px; 
    font-weight: bold;
    border: none; 
    background-color: #eee; 
    color: red;
    text-align: center;
    visibility: hidden;
  }

  #PStart {
    width: 160px; 
    height: 24px;  
    font-size: 20px; 
    border: none; 
    background-color: #eee; 
    cursor:pointer;
    color: blue;
  }

  #Draw {
    width: 80px;
    height: 22px;  
    font-size: 18px; 
    border: none; 
    background-color: #eee; 
    cursor:pointer;
    color: blue;
    visibility: hidden;
  }

  #Resign {
    width: 80px;
    height: 22px;  
    font-size: 18px; 
    border: none; 
    background-color: #eee; 
    cursor:pointer;
    color: red;
    visibility: hidden;
  }

  #nerqev {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }

  #timeControl {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    align-items: center;
    width: 100%;
  }

  #colorChoice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
  }

  #sameTimeLabel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #e5e5e5;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
  }

  .timeRow {
    display: grid;
    grid-template-columns: 28px 70px 52px;
    gap: 4px;
    align-items: center;
    justify-content: center;
  }

  .timeRow span {
    color: #e5e5e5;
    font-size: 12px;
    font-weight: 600;
    text-align: right;
  }

  .timeRowHidden {
    visibility: hidden;
    pointer-events: none;
  }

  #playerTime,
  #playerInc,
  #engineTime,
  #engineInc {
    height: 30px;
    border: 1px solid #9b9b9b;
    border-radius: 6px;
    background: #f8f8f8;
    color: #202020;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
  }

    #input {
    display: flex;
    margin-bottom: 10px;
  }

  #input #command {
    width: 80%;
    padding: 2px 0 2px 6px;
    border: 1px solid #ddd;
    border-right: 0;
  }

  #input #send {
    display: inline-block;
    padding: 3px 6px 3px 6px;
    background: #888;
    color: #fff;
    font-weight: bold;
    margin-right: 6px;
    cursor: pointer;
  }

  #input #examples {
    width: 120px;
    background: #eee;
  }

  #misc {
    margin-bottom: 10px;
  }

  #output {
    flex: 1 1 auto;
    width: 100%;
    border: 1px solid #ddd;
    padding: 10px;
    overflow: scroll;
    box-shadow: inset 1px 1px 2px #eee;
    font-size: 11px;
  }

.home {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px 24px 56px;
    box-sizing: border-box;
}

.hero {
    text-align: center;
    width: min(900px, 100%);
    margin-top: 24px;
}

.hero h1 {
    color: #ffffff;
    font-size: 52px;
    line-height: 1.05;
    margin: 0 0 14px;
}

.hero p {
    color: #aaa;
    margin-bottom: 20px;
}

.home-kicker {
    margin: 0 0 8px !important;
    color: #86a85f !important;
    font-size: 14px !important;
    font-weight: 700;
    text-transform: uppercase;
}

.hero-lead {
    max-width: 760px;
    margin: 0 auto 24px !important;
    color: #d8d8d8 !important;
    font-size: 20px !important;
    line-height: 1.55;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.main-btn {
    background: #769656;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
}

.main-btn:hover {
    background: #8bbf5a;
}

.secondary-btn {
    background: #444;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    text-decoration: none;
}

.secondary-btn:hover {
    background: #666;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    width: min(980px, 100%);
    margin-top: 44px;
}

.card {
    background: #312e2b;
    padding: 22px;
    border-radius: 8px;
    text-align: left;
    border: 1px solid #45413d;
}

.card h3 {
    color: #ffffff;
    margin-bottom: 10px;
}

.card p {
    color: #aaa;
    font-size: 16px;
    line-height: 1.5;
}

.home-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
    gap: 28px;
    width: min(980px, 100%);
    margin-top: 30px;
    padding: 28px;
    box-sizing: border-box;
    background: #312e2b;
    border: 1px solid #45413d;
    border-radius: 8px;
}

.home-panel h2 {
    margin: 0 0 12px;
    color: #ffffff;
    font-size: 28px;
}

.home-panel p {
    margin: 0;
    color: #d6d6d6;
    font-size: 17px;
    line-height: 1.65;
}

.home-steps {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.home-steps li {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 10px;
    align-items: center;
    color: #e6e6e6;
    font-size: 16px;
    line-height: 1.35;
}

.home-steps span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    color: #ffffff;
    background: #769656;
    border-radius: 50%;
    font-weight: 700;
}

.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    margin-top: 28px;
}

@media (max-width: 768px) {

    .features {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 40px;
    }

    .hero-lead {
        font-size: 17px !important;
    }

    .home-panel {
        grid-template-columns: 1fr;
        padding: 22px;
    }

}

.site-header {
  height: 64px;
  background: #312e2b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid #45413d;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f5f5f5;
  font-size: 20px;
  font-weight: 700;
}

.logo img {
  width: 40px;
  height: 40px;

}

.main-nav {
  display: flex;
  gap: 10px;
}

.main-nav a {
  color: #c7c7c7;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
}

.main-nav a:focus,
.main-nav a:focus-visible {
  outline: none;
}

.main-nav a:hover,
.main-nav a.active {
  background: #3d3935;
  color: #fff;
}

.account-menu {
  position: relative;
}

.account-button {
  min-width: 82px;
  padding: 9px 14px;
  border: 1px solid #769656;
  border-radius: 8px;
  background: transparent;
  color: #f2f2f2;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.account-button:hover,
.account-button.signed-in {
  background: #769656;
}

.account-popover {
  position: absolute;
  top: calc(100% + 9px);
  right: 0;
  z-index: 130;
  width: 220px;
  padding: 14px;
  box-sizing: border-box;
  background: #312e2b;
  border: 1px solid #45413d;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.account-popover strong,
.account-popover span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-popover strong {
  color: #fff;
  margin-bottom: 4px;
}

.account-popover span {
  color: #aaa;
  font-size: 13px;
}

.account-popover button {
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  background: #45413d;
  color: #fff;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.auth-dialog {
  width: min(430px, calc(100vw - 28px));
  padding: 28px;
  box-sizing: border-box;
  background: #312e2b;
  color: #eee;
  border: 1px solid #54504b;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.65);
}

.auth-dialog::backdrop {
  background: rgba(12, 12, 12, 0.72);
  backdrop-filter: blur(3px);
}

.auth-close {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 2px 8px;
  background: transparent;
  color: #aaa;
  border: 0;
  font-size: 28px;
  cursor: pointer;
}

.auth-heading h2 {
  margin: 0 30px 8px 0;
  color: #fff;
  font-size: 27px;
}

.auth-heading > p:last-child {
  margin: 0 0 20px;
  color: #bdbdbd;
  font-size: 14px;
  line-height: 1.5;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 18px;
  padding: 4px;
  background: #262522;
  border-radius: 8px;
}

.auth-tabs button {
  padding: 9px;
  background: transparent;
  color: #aaa;
  border: 0;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
}

.auth-tabs button.active {
  background: #45413d;
  color: #fff;
}

.auth-form,
.auth-field {
  display: grid;
  gap: 7px;
}

.auth-form {
  gap: 14px;
}

.auth-field label {
  color: #ddd;
  font-size: 14px;
  font-weight: 700;
}

.auth-field input {
  height: 42px;
  padding: 0 12px;
  box-sizing: border-box;
  background: #262522;
  color: #fff;
  border: 1px solid #54504b;
  border-radius: 7px;
  font-size: 16px;
}

.auth-field input:focus {
  outline: 2px solid #769656;
  outline-offset: 1px;
}

.auth-message {
  min-height: 18px;
  margin: -3px 0;
  color: #e6a3a3;
  font-size: 13px;
}

.auth-message.success {
  color: #a9d57d;
}

.auth-submit {
  width: 100%;
  border: 0;
  font-size: 16px;
  cursor: pointer;
}

.guest-button {
  padding: 8px;
  background: transparent;
  color: #bbb;
  border: 0;
  cursor: pointer;
}

.guest-button:hover {
  color: #fff;
}

@media (max-width: 600px) {
  .site-header {
    height: auto;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
  }

  .main-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
  }

  .account-menu {
    position: absolute;
    top: 10px;
    right: 10px;
  }
}
.play-layout {
  display: grid;
  grid-template-columns: 180px 400px 180px;
  gap: 20px;
  align-items: start;
}

#righttab,
#Tablramk {
  background: #312e2b;
  border-radius: 8px;
  height: 510px;
  padding: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  color: #e5e5e5;
  overflow-anchor: none;
}

.board {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;

  width: 400px;
}

#vs {
  width: 100%;
  height: 36px;

  background: #312e2b;
  color: #f0f0f0;

  border: 1px solid #4a4642;
  border-radius: 8px;

  padding: 0 10px;

  font-size: 17px;
  font-weight: 600;

  text-align: center;

  margin-bottom: 10px;
}

#chessBoard {
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
}
#clockB,
#clockW {
  width: 95%;
  height: 48px;

  background: #1f1f1f;
  color: #f5f5f5;

  border: 2px solid #4a4642;
  border-radius: 8px;

  font-size: 30px;
  font-weight: bold;

  text-align: center;

  box-shadow: inset 0 0 8px rgba(0,0,0,0.4);
  overflow-anchor: none;
}

#PStart {
  width: 95%;
  height: 42px;
  margin-top: 12px;
  background: #769656;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

#PStart:hover {
  background: #86a85f;
}

#PStart.resign-mode {
  background: #9d3f3f;
}

#PStart.resign-mode:hover {
  background: #b74c4c;
}

#Draw,
#Resign {
  width: 50%;
  height: 34px;
  margin-top: 8px;
  background: #45413d;
  color: #eee;
  border: none;
  border-radius: 7px;
  cursor: pointer;
}

#Resign {
  background: #7f1d1d;
  color: #fff;
  font-weight: 800;
}

#Draw:hover,
#Resign:hover {
  background: #5a554f;
}

#Resign:hover {
  background: #a52525;
}

#result {
  width: 100%;
  margin-top: 10px;
  background: #262421;
  color: #f2c94c;
  border: none;
  border-radius: 8px;
  text-align: center;
}

#pgnarea {
  width: 96%;
  background: #1f1f1f;
  color: #ddd;
  border: 1px solid #4a4642;
  border-radius: 8px;
  padding: 8px;
}

#Tabldiv {
  background: #262421;
  border-radius: 8px;
  overflow-y: auto;
  overflow-anchor: none;
}

.Tablem {
  width: 100%;
  margin: 0;
  color: #ddd;
}

.Tablem td {
  padding: 5px;
  border-bottom: 1px solid #3c3936;
}

#selwt,
#selwb,
#selbl {
  border-radius: 8px;
  transition: transform 0.15s ease;
}

#selwt:hover,
#selwb:hover,
#selbl:hover {
  transform: scale(1.08);
}

@media (max-width: 800px) {
.play-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  #chessBoard {
    width: 94vw !important;

    max-width: 400px;
  }

  #fig {
    transform-origin: top left;
  }
}
#maindiv {
  margin: 24px auto;
  width: fit-content;
  background: transparent;
}

#nodes {
  background: #312e2b;
  color: #ddd;

  width: auto;
}

.boardTables {
  display: grid;
  grid-template-columns: 260px 400px 190px !important;
  gap: 20px;
  align-items: start;
}

#Table1ramk,
#Table2ramk {
  background: #312e2b;
  color: #ddd;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.35);
  overflow-anchor: none;
}

#Table1div,
#Table2div {
  background: #262421;
  border-radius: 8px;
  overflow-y: auto;
  overflow-anchor: none;
}

.Table1,
.Table2 {
  color: #ddd;
}

.Table1 td,
.Table2 td {
  padding: 4px;
  border-bottom: 1px solid #3c3936;
}

.enco {
  background: #312e2b;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  align-items: center;
  gap: 8px;
}

#ecotx {
  color: #f0f0f0;
  flex: 1;
}

#eco,
#ecoButton,
#infbut,
#engbut,
#butPgn,
#LoadPgn {
  background: #769656;
  color: #fff;
  border: none;
  border-radius: 7px;
  cursor: pointer;
}

#pgnActions #butPgn,
#pgnActions #LoadPgn {
  width: auto;
  min-width: 62px;
  padding: 0 8px;
}

#engres,
#vdep,
#edep {
  background: #262421;
  color: #eee;
  border: 1px solid #4a4642;
  border-radius: 5px;
}

#pgnarea {
  background: #1f1f1f;
  color: #ddd;
  border: 1px solid #4a4642;
  border-radius: 8px;
  padding: 8px;
}

#chessBoard {
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.55);
}

.board1 {
  position: relative;
  z-index: 1;
}

#fig {
  z-index: 2;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
}

.board {
  position: relative;
}

#futer {
  margin-top: 12px !important;
}

button:hover,
select:hover {
  filter: brightness(1.08);
}

.Table1 tr:hover,
.Table2 tr:hover {
  background: rgba(255,255,255,0.06);
}

#eco {
  display: none;
}

#ecoButton {
  padding: 5px 8px;
  width: 54px;
}

#futer,
.analysis-page .enco {
  position: relative;
}

#ecoMenu {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  bottom: auto;
  z-index: 120;
  width: 60px;
  max-width: calc(100vw - 16px);
  max-height: 404px;
  overflow-y: auto;
  scrollbar-color: rebeccapurple #1d1919;
  scrollbar-width: thin;
  grid-template-columns: 1fr;
  gap: 4px;
  padding: 8px;
  box-sizing: border-box;
  background: #312e2b;
  border: 1px solid #45413d;
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(0,0,0,0.42);
}

#ecoMenu.open {
  display: grid;
}

#ecoMenu::-webkit-scrollbar {
  width: 8px;
}

#ecoMenu::-webkit-scrollbar-track {
  background: #1d1919;
}

#ecoMenu::-webkit-scrollbar-thumb {
  background: rebeccapurple;
  border-radius: 8px;
}

.eco-menu-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  box-sizing: border-box;
  background: #262421;
  color: #e6e6e6;
  border: 1px solid #45413d;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

.eco-menu-item:hover {
  background: #769656;
  color: #ffffff;
}
/*
#flip {
  width: 24px;
  height: 24px;
  background: url("../img/flip.png") center / contain no-repeat;
}
*/
#flip {
  display: inline;
  position: relative;
  margin-right: 6px;
  width: 16px;
  cursor:pointer;
}

#ecotx {
  font-size: 14px;

}

#maindiv {
  margin: 24px auto !important;
  width: fit-content;
  position: relative !important;
  z-index: auto;
  top: 0 !important;
  left: auto !important;
}

.boardTables {
  margin: 0 auto;
  display: grid;
  justify-content: center;
  align-items: start;
}

.board {
  position: relative;
  width: 400px;
  min-width: 400px;
  overflow-anchor: auto;
}

#chessBoard {
  display: block;
  width: 400px;
}

#fig {
  position: absolute !important;
  top: 40px;
  left: 0;
  z-index: 2;
  width: 400px;
  height: 400px;
}

.score-progress {
  position: absolute;
  top: 40px;
  left: calc(100% + 3px);
  z-index: 3;
  width: 10px;
  height: 400px;
  overflow: hidden;
  background: #262421;
  border: 1px solid #45413d;
  border-radius: 6px;
  box-sizing: border-box;
}

.score-progress-fill {
  position: absolute;
  left: 0;
  width: 100%;
  height: var(--score-fill-size, 0%);
  background: #b794f4;
  transition: top 0.2s ease, height 0.2s ease, background-color 0.2s ease;
}

.score-progress-fill.positive {
  top: calc(50% - var(--score-fill-size, 0%));
}

.score-progress-fill.negative {
  top: 50%;
  background: #769656;
}

.score-progress-center {
  position: absolute;
  top: calc(50% - 1px);
  left: 0;
  z-index: 1;
  width: 100%;
  height: 2px;
  background: #eee;
  opacity: 0.7;
}

.analysis-page #fig {
  position: absolute !important;
  top: 40px;
  left: 0;
  z-index: 2;
}

.play-page-body #fig {
  position: absolute !important;
  top: 52px;
  left: 0;
  z-index: 2;
}

.board1 {
  position: relative !important;
  z-index: 1;
}

.analysis-page #Table1ramk,
.analysis-page #Table2ramk {
  background: #312e2b;
  border-radius: 8px;
}

.analysis-page .Table1,
.analysis-page .Table2 {
  color: #f0f0f0;
}

.analysis-page td {
  color: #dddddd;
}

.analysis-page thead,
.analysis-page .cap {
  color: #9f7aea;
}

.analysis-page input[disabled] {
  color: #cfcfcf;
}

.analysis-page #engres,
.analysis-page #vdep,
.analysis-page #edep {
  background: #3b3836;
  color: #ffffff;
}

.analysis-page #noddan {
  color: #b794f4 !important;
  font-weight: normal;
}

.analysis-tabs {
  display: none;
}

#pgnPanel {
  display: contents;
}

.analysis-tab {
  min-height: 38px;
  padding: 0 12px;
  background: #262421;
  color: #e6e6e6;
  border: 1px solid #45413d;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
}

.analysis-tab.active {
  background: #769656;
  color: #ffffff;
  border-color: #769656;
}

.about-page {
  background: #262522;
  color: #e5e5e5;
}

.about-page .page {
  max-width: 900px;
  width: calc(100% - 40px);
  margin: 32px auto;
  background: #312e2b;
  border-radius: 14px;
  padding: 28px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.about-content {
  padding: 5%;
}

.about-kicker {
  margin: 0 0 6px;
  color: #86a85f !important;
  font-size: 14px !important;
  font-weight: 700;
  letter-spacing: 0;
  text-align: center;
  text-transform: uppercase;
}

.about-page #aboutheader {
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 24px;
}

.about-page p {
  color: #d6d6d6;
  font-size: 17px;
  line-height: 1.65;
}

.about-lead {
  color: #f0f0f0 !important;
  font-size: 19px !important;
}

.about-highlight {
  margin: 26px 0;
  padding: 18px 20px;
  background: #262421;
  border-left: 4px solid #86a85f;
  border-radius: 8px;
  color: #f2f2f2;
  font-size: 18px;
  line-height: 1.55;
}

.about-page h2 {
  margin: 28px 0 10px;
  color: #ffffff;
  font-size: 21px;
}

.about-list {
  margin: 0 0 18px;
  padding-left: 22px;
  color: #d6d6d6;
  font-size: 17px;
  line-height: 1.6;
}

.about-list li {
  margin-bottom: 8px;
}

.about-cooperation {
  margin-top: 28px;
  color: #eeeeee !important;
  font-weight: 700;
}

.about-contact {
  text-align: right;
}

.about-page b {
  color: #86a85f;
}

.about-page .about-content a {
  color: #86a85f;
  font-weight: 700;
  text-decoration: none;
}

.about-page .about-content a:hover {
  color: #a8c97b;
}

.technical-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 26px 0;
}

.technical-stats div,
.record-layout div {
  background: #262421;
  border: 1px solid #45413d;
  border-radius: 8px;
  padding: 16px;
  box-sizing: border-box;
}

.technical-stats strong {
  display: block;
  color: #ffffff;
  font-size: 30px;
  line-height: 1.1;
}

.technical-stats span,
.record-layout span {
  display: block;
  margin-top: 7px;
  color: #d6d6d6;
  font-size: 14px;
  line-height: 1.35;
}

.record-layout {
  display: grid;
  grid-template-columns: 2fr 1fr 5fr;
  gap: 10px;
  margin: 18px 0 20px;
}

.record-layout b {
  display: block;
  color: #ffffff;
  font-size: 18px;
}

.technical-list b {
  color: #ffffff;
}

@media (max-width: 700px) {
  .about-page .page {
    width: calc(100% - 24px);
    padding: 18px;
  }

  .about-page #aboutheader {
    font-size: 24px;
  }

  .about-page p {
    font-size: 15px;
  }

  .technical-stats,
  .record-layout {
    grid-template-columns: 1fr;
  }

  .about-content {
    padding: 0;
  }

  .about-lead {
    font-size: 17px !important;
  }

  .about-highlight {
    padding: 14px 16px;
    font-size: 16px;
  }

  .about-list {
    font-size: 15px;
  }
}

.download-page {
  background: #262522;
  color: #e5e5e5;
}

.download-container {
  max-width: 1000px;
  margin: 32px auto;
  padding: 0 20px;
}

.download-card {
  background: #312e2b;
  border-radius: 14px;
  padding: 28px;
  margin-bottom: 22px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35);
}

.download-card h1 {
  margin: 0 0 10px;
  color: #fff;
}

.download-card p {
  color: #cfcfcf;
}

.download-date {
  color: #86a85f;
  font-weight: bold;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.download-item {
  background: #312e2b;
  border: 1px solid #45413d;
  border-radius: 12px;
  padding: 16px;
  color: #eee;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.download-item:hover {
  background: #3b3733;
  border-color: #86a85f;
}

.download-item b {
  color: #fff;
  font-size: 18px;
}

.download-item span {
  color: #bdbdbd;
}

.download-page a {
  color: #eeeeee;
}

.download-page a:visited {
  color: #eeeeee;
}

.download-page a:hover {
  color: #86a85f;
}

.download-item {
  color: #eeeeee !important;
}

.analysis-page input[disabled][value*="#"],
.play-page-body input[disabled][value*="#"] {
  width: calc(100% - 20px) !important;
  height: 30px;
  margin: 8px 10px 6px !important;

  background: #262421 !important;
  color: #f0f0f0 !important;

  border: 1px solid #45413d !important;
  border-radius: 8px;

  font-size: 13px !important;
  font-weight: 400;
  text-align: center;

  box-sizing: border-box;
}

.analysis-page #Table1ramk > div:not(#engi),
.analysis-page #Table2ramk > div:not(#infi) {
  color: #ffffff !important;
  font-weight: 400;
  text-align: center;

}
.analysis-page .Table1 td,
.analysis-page .Table2 td,
.play-page-body .Tablem td {
  color: #e6e6e6;
  font-size: 14px;
  padding: 5px 4px;
  font-weight: normal;
}

.analysis-page .cluster-analysis-marker {
  color: #f2c94c;
  font-weight: 800;
}

.analysis-page .Table1 tr:hover,
.analysis-page .Table2 tr:hover,
.play-page-body .Tablem tr:hover {
  background: rgba(134, 168, 95, 0.12);
  font-weight: normal;
}

.analysis-page .Table1.table-disabled td,
.analysis-page .Table2.table-disabled td {
  color: rgb(84, 15, 196);
  cursor: default;
  opacity: 0.72;
}

.analysis-page .Table1.table-disabled tr:hover,
.analysis-page .Table2.table-disabled tr:hover {
  background: transparent;
}
.play-page-body #playmain {
  width: 100%;
  margin: 24px 0 !important;
  padding: 0 !important;

  display: flex !important;
  justify-content: center !important;
}

.play-page-body #playbordtab {
  margin: 0 auto !important;

  display: grid !important;
  grid-template-columns: 200px 400px 200px !important;
  gap: 20px !important;

  width: max-content !important;
  justify-content: center !important;
  align-items: start;
}

.play-page-body .board {
  width: 400px !important;
  min-width: 400px !important;
  max-width: 400px !important;
}

@media (max-width: 700px) {
  body {
    overflow-x: hidden;
  }

  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 8px;
  }

  .logo {
    display: none;
  }

  .account-menu {
    position: static;
  }

  .account-popover {
    position: fixed;
    top: 98px;
    right: 12px;
  }

  .main-nav {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
  }

  .main-nav a {
    margin-left: 0 !important;
    padding: 6px 8px;
    font-size: 13px;
  }

  .home {
    padding: 24px 14px;
    box-sizing: border-box;
  }

  .hero {
    width: 100%;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-buttons {
    flex-direction: column;
    align-items: center;
    width: 90%;
  }

  .main-btn,
  .secondary-btn {
    width: min(280px, 100%);
    text-align: center;
    box-sizing: border-box;
  }

  .features {
    width: 100%;
    grid-template-columns: 1fr !important;
  }

  .card {
    box-sizing: border-box;
  }
}
@media (max-width: 700px) {
  body.download-page .site-header {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  body.download-page .main-nav {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
  }

  body.download-page .main-nav a {
    margin: 0 !important;
    margin-left: 0 !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 900px) {
  .analysis-page .site-header,
  .play-page-body .site-header {
    position: relative;
  }

  body.analysis-page {
    overflow-x: auto;
  }

  .analysis-page #maindiv {
    width: 100% !important;
    margin: 16px 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box;
  }

  .analysis-page #tabbordtab {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 14px !important;
    transform: none;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .analysis-page .board {
    order: 1;
    position: relative !important;
    transform: none;
    z-index: 1;
    background: #262522;
    padding-bottom: 8px;
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
  }

  .analysis-page #Table2ramk,
  .analysis-page #Table1ramk {
    width: min(400px, calc(100vw - 24px)) !important;
    max-width: 400px;
    height: auto !important;
    min-height: 0;
    box-sizing: border-box;
  }

  .analysis-page #Table2ramk {
    order: 3;
  }

  .analysis-page #Table1ramk {
    order: 3;
  }

  .analysis-page .analysis-tabs {
    order: 2;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    width: min(400px, calc(100vw - 24px));
    box-sizing: border-box;
  }

  body.analysis-page #pgnPanel {
    display: none;
  }

  body.analysis-page[data-analysis-tab="variant"] #Table2ramk,
  body.analysis-page[data-analysis-tab="moves"] #Table1ramk {
    display: block;
  }

body.analysis-page[data-analysis-tab="variant"] #Table1ramk,
body.analysis-page[data-analysis-tab="moves"] #Table2ramk,
body.analysis-page[data-analysis-tab="pgn"] #Table1ramk,
body.analysis-page[data-analysis-tab="pgn"] #Table2ramk {
    display: none;
  }

  body.analysis-page[data-analysis-tab="pgn"] #pgnPanel {
    display: block;
  }

  .analysis-page #Table2div,
  .analysis-page #Table1div {
    height: 240px !important;
    max-height: 40vh;
  }

  .analysis-page #chessBoard,
  .analysis-page #fig {
    width: 400px !important;
    height: 400px !important;
  }

  .analysis-page #futer {
    width: 100%;
    box-sizing: border-box;
  }

  .analysis-page #pgnarea {
    width: 100%;
    box-sizing: border-box;
  }
}

@media (max-width: 430px) {
  body.analysis-page {
    overflow-x: hidden;
  }

  .analysis-page {
    --analysis-board-size: calc(100vw - 32px);
    --analysis-square-size: calc(var(--analysis-board-size) / 8);
  }

  .analysis-page #maindiv {
    padding: 0 !important;
  }

  .analysis-page #tabbordtab {
    align-items: center;
    width: 100% !important;
    min-width: 100%;
  }

  .analysis-page .board {
    width: var(--analysis-board-size) !important;
    min-width: 0 !important;
    max-width: var(--analysis-board-size) !important;
    margin-left: auto;
    margin-right: auto;
  }

  .analysis-page #chessBoard,
  .analysis-page #fig {
    width: var(--analysis-board-size) !important;
    height: var(--analysis-board-size) !important;
  }

  .analysis-page .score-progress {
    left: calc(100% + 3px);
    right: auto;
    height: var(--analysis-board-size);
  }

  .analysis-page #fig {
    grid-template-columns: repeat(8, var(--analysis-square-size)) !important;
    grid-template-rows: repeat(8, var(--analysis-square-size)) !important;
  }

  .analysis-page .drag {
    width: var(--analysis-square-size) !important;
  }

  .analysis-page #futer {
    margin-top: 12px !important;
  }

  .analysis-page #ecoMenu {
    position: absolute;
    left: 0;
    top: calc(100% + 6px);
    bottom: auto;
    width: 60px;
    max-height: calc(var(--analysis-board-size) + 12px);
    grid-template-columns: 1fr;
  }

  .analysis-page #Table2ramk,
  .analysis-page #Table1ramk {
    width: calc(100vw - 8px) !important;
  }

  .analysis-page .analysis-tabs {
    width: calc(100vw - 8px);
  }
}

@media (max-width: 900px) {
  .play-page-body #playmain {
    width: 100% !important;
    margin: 16px 0 !important;
    padding: 0 12px !important;
    box-sizing: border-box;
  }

  .play-page-body #playbordtab {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    position: relative;
    gap: 14px !important;
    width: 100% !important;
    margin: 0 auto !important;
  }

  .play-page-body .board {
    order: 2;
    position: sticky !important;
    top: 0;
    z-index: 50;
    background: #262522;
    padding-bottom: 8px;
    width: 400px !important;
    min-width: 400px !important;
    max-width: 400px !important;
  }

  .play-page-body #righttab,
  .play-page-body #Tablramk {
    width: min(400px, calc(100vw - 24px)) !important;
    max-width: 400px;
    height: auto !important;
    min-height: 0;
    box-sizing: border-box;
  }

  .play-page-body #righttab {
    order: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 8px;
  }

  .play-page-body #Tablramk {
    order: 3;
  }

  .play-page-body #Tabldiv {
    height: 240px !important;
    max-height: 40vh;
  }

  .play-page-body #nerqev {
    margin-top: 0 !important;
    justify-content: center;
    grid-column: 1 / -1;
  }

  .play-page-body #pgnarea {
    width: 100%;
    box-sizing: border-box;
    margin-top: 12px !important;
  }

  .play-page-body #clockB,
  .play-page-body #clockW {
    width: 100% !important;
    height: 34px !important;
    font-size: 20px !important;
    box-sizing: border-box;
  }

  .play-page-body #clockB {
    order: 1;
  }

  .play-page-body #clockW {
    order: 2;
  }

  .play-page-body #result,
  .play-page-body #PStart {
    grid-column: 1 / -1;
    width: 100% !important;
    height: 32px !important;
    margin-top: 0 !important;
    font-size: 16px !important;
  }

  .play-page-body #result {
    order: 4;
  }

  .play-page-body #Draw,
  .play-page-body #Resign {
    width: 100% !important;
    height: 30px !important;
    margin-top: 0 !important;
    font-size: 15px !important;
  }

  .play-page-body #righttab > div:not(#nerqev) {
    order: 5;
    grid-column: 1 / -1;
  }

  .play-page-body #nerqev {
    order: 6;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-height: none;
    overflow: hidden;
  }

  .play-page-body #colorChoice {
    gap: 5px;
  }

  .play-page-body #selwt,
  .play-page-body #selbl {
    width: 32px !important;
    height: 32px !important;
    margin: 0 !important;
  }

  .play-page-body #selwb {
    width: 38px !important;
    height: 38px !important;
    margin: 0 !important;
  }

  .play-page-body #timeControl {
    width: auto;
    min-width: 158px;
    margin: 0 !important;
  }

  .play-page-body .timeRow {
    grid-template-columns: 24px 64px 48px;
  }

  .play-page-body #playerTime,
  .play-page-body #playerInc,
  .play-page-body #engineTime,
  .play-page-body #engineInc {
    height: 28px;
    font-size: 13px;
  }

  .play-page-body #PStart {
    order: 3;
  }

  .play-page-body.play-game-active #righttab {
    grid-template-columns: 1fr 42px 1fr;
    align-items: center;
    gap: 6px;
    padding: 6px;
  }

  .play-page-body.play-game-active #clockB {
    grid-column: 1;
    order: 1;
  }

  .play-page-body.play-game-active #righttab > div:not(#nerqev):not(#flip) {
    grid-column: 2;
    order: 2;
    display: flex !important;
    justify-content: center;
  }

  .play-page-body.play-game-active #clockW {
    grid-column: 3;
    order: 3;
  }

  .play-page-body.play-game-active #PStart,
  .play-page-body.play-game-active #result,
  .play-page-body.play-game-active #nerqev,
  .play-page-body.play-game-active #Draw {
    display: none !important;
  }

  .play-page-body.play-game-active #Resign {
    display: block;
    width: 34px !important;
    height: 34px !important;
    border-radius: 50%;
    margin: 0 !important;
    padding: 0;
    font-size: 18px !important;
    line-height: 34px;
  }

  .play-page-body #flip {
    display: none;
  }

  .play-page-body:not(.play-game-active) .board {
    order: 1;
  }

  .play-page-body:not(.play-game-active) #righttab {
    position: absolute;
    top: 54px;
    left: 50%;
    z-index: 80;
    transform: translateX(-50%);
    width: min(360px, calc(100vw - 40px)) !important;
    max-width: min(360px, calc(100vw - 40px));
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 10px;
    background: rgba(49, 46, 43, 0.94);
    border: 1px solid rgba(238, 238, 238, 0.16);
    box-shadow: 0 8px 24px rgba(0,0,0,0.42);
  }

  .play-page-body:not(.play-game-active) #clockB,
  .play-page-body:not(.play-game-active) #clockW,
  .play-page-body:not(.play-game-active) #righttab > div:not(#nerqev) {
    display: none !important;
  }

  .play-page-body:not(.play-game-active) #result,
  .play-page-body:not(.play-game-active) #PStart,
  .play-page-body:not(.play-game-active) #nerqev {
    grid-column: 1 / -1;
    width: 100% !important;
  }

  .play-page-body:not(.play-game-active) #result {
    order: 1;
    height: 28px !important;
  }

  .play-page-body:not(.play-game-active):not(.play-game-finished) #result {
    display: none !important;
  }

  .play-page-body:not(.play-game-active) #nerqev {
    order: 2;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
  }

  .play-page-body:not(.play-game-active) #timeControl {
    width: 100%;
    min-width: 0;
  }

  .play-page-body:not(.play-game-active) #colorChoice {
    width: 100%;
  }

  .play-page-body:not(.play-game-active) #PStart {
    order: 3;
    height: 36px !important;
  }
}

@media (max-width: 430px) {
  body.play-page-body {
    overflow-x: hidden;
  }

  .play-page-body {
    --play-board-size: calc(100vw - 16px);
    --play-square-size: calc(var(--play-board-size) / 8);
  }

  .play-page-body #playmain {
    padding: 0 !important;
  }

  .play-page-body #playbordtab {
    width: 100% !important;
    min-width: 100%;
  }

  .play-page-body .board {
    width: var(--play-board-size) !important;
    min-width: 0 !important;
    max-width: var(--play-board-size) !important;
  }

  .play-page-body #vs {
    width: 100% !important;
    box-sizing: border-box;
  }

  .play-page-body #chessBoard,
  .play-page-body #fig {
    width: var(--play-board-size) !important;
    height: var(--play-board-size) !important;
  }

  .play-page-body #fig {
    grid-template-columns: repeat(8, var(--play-square-size)) !important;
    grid-template-rows: repeat(8, var(--play-square-size)) !important;
  }

  .play-page-body .drag {
    width: var(--play-square-size) !important;
  }

  .play-page-body #pgnarea {
    margin-top: 12px !important;
  }

  .play-page-body #righttab,
  .play-page-body #Tablramk {
    width: calc(100vw - 8px) !important;
  }
}

.analysis-page #maindiv {
  display: grid;
  justify-items: center;
}

.analysis-page #nodes {
  flex: 0 0 auto;
  min-width: 76px;
  padding: 0 2px;
  box-sizing: border-box;
  background: transparent;
  color: #b794f4;
  border: 0;
  border-radius: 0;
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
}

.analysis-page #nodes .nodes-label {
  color: #d6d1c7;
}

.analysis-page #nodes #noddan {
  font-size: 14px !important;
}

.analysis-page #tabbordtab {
  --analysis-column-height: 616px;
  grid-template-columns: 260px 400px 210px !important;
  gap: 16px !important;
  align-items: stretch;
}

.analysis-page #Table1ramk,
.analysis-page #Table2ramk {
  height: var(--analysis-column-height);
  box-sizing: border-box;
}

.analysis-page #Table1ramk {
  width: 100% !important;
}

.analysis-page #Table2ramk {
  width: 240px !important;
}

.analysis-page #Table1ramk {
  margin-left: 0;
}

.analysis-page #Table1div,
.analysis-page #Table2div {
  height: calc(var(--analysis-column-height) - 92px);
}

.analysis-page .board {
  gap: 0;
  min-height: var(--analysis-column-height);
  transform: translateX(-12px);
}

.analysis-page .enco {
  align-self: stretch;
  width: 100%;
  height: 20px;
  padding: 0;
  margin-bottom: 2px;
  box-sizing: border-box;
  background: transparent;
  border-radius: 0;
  display: flex;
  justify-content: flex-start;
  gap: 6px;
  align-items: center;
  text-align: left;
  overflow: visible;
}

.analysis-page #ecotx {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  direction: ltr;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}

.analysis-page #fig {
  top: 22px;
}

.analysis-page .score-progress {
  top: 22px;
}

.analysis-page #futer {
  width: 100%;
  margin-top: 10px !important;
  padding: 8px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: center;
  background: #312e2b;
  border: 1px solid #45413d;
  border-radius: 8px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.3);
}

.analysis-page .board-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.analysis-page .board-nav img {
  margin: 0 !important;
  width: 18px !important;
  height: 18px;
  object-fit: contain;
}

.analysis-page #divHom,
.analysis-page #divPre,
.analysis-page #divNex,
.analysis-page #divEnd {
  opacity: 0.68;
  transition: opacity 0.15s ease;
}

.analysis-page #divHom:hover,
.analysis-page #divPre:hover,
.analysis-page #divNex:hover,
.analysis-page #divEnd:hover {
  opacity: 1;
}

.analysis-page #infi {
  grid-column: 1 / -1;
  display: grid !important;
  grid-template-columns: auto auto 34px auto 34px minmax(96px, 1fr) 54px;
  gap: 6px;
  align-items: center;
  height: auto !important;
}

.analysis-page #infi > div {
  margin-left: 0 !important;
}

.analysis-page #infbut,
.analysis-page #engbut,
.analysis-page #ecoButton {
  min-height: 28px;
}

.analysis-page #ecoButton {
  min-height: 20px;
  width: 48px;
  padding: 1px 6px;
  font-size: 12px;
  line-height: 18px;
}

.analysis-page #engbut {
  width: 54px !important;
  margin: 0 !important;
}

.analysis-page #engres {
  width: 100%;
  min-width: 0;
  height: 28px;
  margin: 0 !important;
  box-sizing: border-box;
}

.analysis-page .dept {
  width: 34px;
  height: 28px;
  margin: 0;
  box-sizing: border-box;
  text-align: center;
}

.analysis-page .inkdec {
  height: 12px;
  line-height: 10px;
  color: #d8d8d8;
}

.analysis-page #pgnPanel {
  display: block;
  grid-column: 1 / -1;
  width: 100%;
}

.analysis-page #pgnGameInfo {
  flex: 1;
  min-width: 0;
  color: #f2c94c;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analysis-page #pgnarea {
  margin-top: 0;
}

@media (max-width: 900px) {
  .analysis-page #LoadPgn {
    display: none;
  }

  .analysis-page #nodes {
    width: auto;
  }

  .analysis-page .board {
    min-height: 0;
  }

  .analysis-page #Table2ramk,
  .analysis-page #Table1ramk {
    height: auto !important;
    margin-left: 0;
  }

  .analysis-page #Table2div,
  .analysis-page #Table1div {
    height: 240px !important;
    max-height: 40vh;
  }

  .analysis-page #futer {
    display: grid;
    grid-template-columns: auto 1fr;
  }

  .analysis-page #infi {
    grid-template-columns: 1fr auto 34px auto 34px;
  }

  .analysis-page #engres,
  .analysis-page #engbut {
    grid-column: auto;
  }

  .analysis-page #engres {
    grid-column: 1 / 5;
  }
}

@media (max-width: 430px) {
  .analysis-page #nodes {
    min-width: 24px;
    padding-left: 0;
    padding-right: 2px;
  }

  .analysis-page #futer {
    padding: 7px;
  }

  .analysis-page #infi {
    grid-template-columns: 1fr auto 32px auto 32px;
    gap: 5px;
  }

  .analysis-page #infbut {
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
  }

  .analysis-page #engres {
    grid-column: 1 / 5;
  }

  .analysis-page #engbut {
    width: 48px !important;
  }
}

/* Travelling salesperson live experiment */
.tsp-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 12%, rgba(242, 201, 76, 0.08), transparent 28rem),
    #1f1d1b;
  color: #f4f1eb;
}

.tsp-shell {
  width: min(1380px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

.tsp-heading {
  max-width: 820px;
  margin-bottom: 30px;
}

.tsp-heading h1 {
  margin: 4px 0 12px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.02;
}

.tsp-heading > p:last-child {
  max-width: 720px;
  color: #c7c1b8;
  font-size: 17px;
  line-height: 1.65;
}

.tsp-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.tsp-control-card,
.tsp-matrix-card,
.tsp-result-card {
  border: 1px solid #47423d;
  border-radius: 16px;
  background: rgba(49, 46, 43, 0.96);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.24);
}

.tsp-control-card {
  grid-column: 1 / -1;
  padding: 20px;
}

.tsp-worker-line {
  display: flex;
  gap: 10px;
  align-items: center;
  padding-bottom: 17px;
  border-bottom: 1px solid #45413d;
}

.tsp-worker-line > span:last-child {
  margin-left: auto;
  color: #aaa39a;
  font-size: 13px;
}

.tsp-status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #777;
  box-shadow: 0 0 0 4px rgba(119, 119, 119, 0.13);
}

.tsp-status-dot.connecting,
.tsp-status-dot.connected {
  background: #f2c94c;
  box-shadow: 0 0 0 4px rgba(242, 201, 76, 0.13);
}

.tsp-status-dot.online {
  background: #61c98b;
  box-shadow: 0 0 0 4px rgba(97, 201, 139, 0.13);
}

.tsp-status-dot.offline {
  background: #dc6b67;
  box-shadow: 0 0 0 4px rgba(220, 107, 103, 0.13);
}

.tsp-mode-picker {
  display: flex;
  gap: 20px;
  margin: 18px 0 16px;
  padding: 0;
  border: 0;
}

.tsp-mode-picker legend {
  margin-bottom: 9px;
  color: #aaa39a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tsp-mode-picker label {
  display: flex;
  gap: 7px;
  align-items: center;
  cursor: pointer;
}

.tsp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.tsp-controls label {
  display: grid;
  gap: 6px;
  color: #c7c1b8;
  font-size: 13px;
}

.tsp-controls input[type="number"] {
  width: 150px;
  min-height: 42px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid #5a554e;
  border-radius: 8px;
  outline: none;
  background: #262320;
  color: #fff;
  font: inherit;
}

.tsp-controls input:focus,
.tsp-matrix input:focus {
  border-color: #f2c94c;
  box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.12);
}

.tsp-controls button,
.tsp-controls .main-btn,
.tsp-controls .secondary-btn {
  min-height: 42px;
  box-sizing: border-box;
  cursor: pointer;
}

.tsp-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.tsp-cancel {
  padding: 9px 14px;
  border: 1px solid #8c514e;
  border-radius: 8px;
  background: transparent;
  color: #f0aaa6;
}

.tsp-message {
  min-height: 20px;
  margin: 15px 0 0;
  color: #c7c1b8;
  transition: color 0.15s ease;
}

.tsp-message.error {
  color: #f28b86;
}

.tsp-matrix-card,
.tsp-result-card {
  min-width: 0;
  padding: 20px;
}

.tsp-matrix-card:has(.tsp-empty:not([hidden])) {
  display: flex;
  align-self: stretch;
  flex-direction: column;
}

.tsp-section-title {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tsp-section-title h2 {
  margin: 2px 0 0;
  font-size: 24px;
}

.tsp-section-title > span {
  color: #aaa39a;
  font-size: 12px;
  white-space: nowrap;
}

.tsp-empty {
  display: grid;
  flex: 1;
  min-height: 64px;
  place-items: center;
  padding: 12px 16px;
  border: 1px dashed #575149;
  border-radius: 12px;
  color: #aaa39a;
  text-align: center;
}

.tsp-empty[hidden] {
  display: none;
}

.tsp-matrix-wrap {
  max-width: 100%;
  max-height: 590px;
  overflow: auto;
  border: 1px solid #45413d;
  border-radius: 10px;
}

.tsp-matrix {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.tsp-matrix th,
.tsp-matrix td {
  min-width: 45px;
  height: 42px;
  padding: 0;
  border-right: 1px solid #45413d;
  border-bottom: 1px solid #45413d;
  text-align: center;
}

.tsp-matrix th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: #272421;
  color: #f2c94c;
}

.tsp-matrix tbody th {
  left: 0;
}

.tsp-matrix thead th:first-child {
  left: 0;
  z-index: 3;
}

.tsp-matrix input {
  width: 45px;
  height: 42px;
  box-sizing: border-box;
  padding: 2px;
  border: 1px solid transparent;
  outline: 0;
  background: #312e2b;
  color: #f4f1eb;
  text-align: center;
  -moz-appearance: textfield;
}

.tsp-matrix input::-webkit-inner-spin-button,
.tsp-matrix input::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.tsp-matrix .diagonal,
.tsp-matrix input.diagonal {
  background: #252321;
  color: #77716a;
}

.tsp-result-card {
  position: sticky;
  top: 18px;
}

.tsp-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  margin: 0 0 16px;
  border: 1px solid #45413d;
  border-radius: 10px;
  background: #45413d;
}

.tsp-metrics div {
  padding: 12px;
  background: #292623;
}

.tsp-metrics dt {
  margin-bottom: 4px;
  color: #aaa39a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tsp-metrics dd {
  margin: 0;
  color: #f2c94c;
  font-size: 18px;
  font-weight: 800;
}

.tsp-route-box {
  display: grid;
  gap: 7px;
  min-height: 68px;
  padding: 13px;
  border: 1px solid #514b45;
  border-radius: 10px;
  background: #252321;
}

.tsp-route-box span {
  color: #aaa39a;
  font-size: 12px;
}

.tsp-route-box strong {
  overflow-wrap: anywhere;
  line-height: 1.55;
}

.tsp-progress-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
}

.tsp-progress-title h3 {
  margin: 0;
  font-size: 16px;
}

.tsp-progress-title span {
  overflow: hidden;
  max-width: 160px;
  color: #77716a;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tsp-progress-log {
  max-height: 230px;
  margin: 10px 0 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.tsp-progress-log li {
  display: grid;
  gap: 3px;
  padding: 9px 3px;
  border-bottom: 1px solid #45413d;
}

.tsp-progress-log li strong {
  color: #f2c94c;
}

.tsp-progress-log li span,
.tsp-progress-log .tsp-log-empty {
  color: #aaa39a;
  font-size: 12px;
}

@media (max-width: 900px) {
  .tsp-shell {
    width: min(100% - 24px, 760px);
    padding-top: 34px;
  }

  .tsp-workspace {
    grid-template-columns: 1fr;
  }

  .tsp-control-card {
    grid-column: auto;
  }

  .tsp-result-card {
    position: static;
  }
}

@media (max-width: 560px) {
  .tsp-shell {
    width: min(100% - 16px, 520px);
  }

  .tsp-heading h1 {
    font-size: 36px;
  }

  .tsp-worker-line {
    align-items: start;
    flex-wrap: wrap;
  }

  .tsp-worker-line > span:last-child {
    width: 100%;
    margin-left: 20px;
  }

  .tsp-mode-picker {
    display: grid;
  }

  .tsp-controls,
  .tsp-controls label,
  .tsp-controls input[type="number"],
  .tsp-controls button,
  .tsp-controls .main-btn,
  .tsp-controls .secondary-btn {
    width: 100%;
  }
}

