@import 'hamburger.css';
:root {
  --main-margin: 0;
  --main-max-width: 1400px;
  --feature-btn: #d0e0bd;
  --invalid-queen: #ffa07a;
  --gauge-gap: 17px;
  --site-header-height: 60px;
  --site-header-margin: 0px;
  --base-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
    0 3px 1px -2px rgba(0, 0, 0, 0.2), 0 1px 5px 0 rgba(0, 0, 0, 0.12);
  --btn-shadow: 2px 1px 2px 0 rgba(0, 0, 0, 0.1);
  --dark-mode: 0;
  --font-color: #4d4d4d;
  --link-color: #5e5e5e;
  --link-hover: #1b78d0;
  --text-shadow: #fff;
  --bg-body: #edebe9 linear-gradient(to bottom, #dbd7d1, #edebe9 116px)
    no-repeat;
  --bg-color0: #fff;
  --bg-color1: White;
  --bg-color2: WhiteSmoke;
  --bg-seek: rgba(255, 255, 255, 0.8);
  --bg-meta: #f7f6f5;
  --bg-input: #fafaf9;
  --game-hover: #d1e6fa;
  --green-hover: #89b25b;
  --green-switch: #629924;
  --blue-active: #d1e4f6;
  --blue-passive: #c5d8e9;
  --blue-hover: #1b78d0;
  --invite-game: #eff5e9;
  --notify-new: #d5e3c4;
  --good: #629924;
  --bad: #c33;
  --gold: #d59020;
  --rusty: #d64f00;
  --rusty-rgb: 214, 79, 0;
  --ct-current: #e2834d;
  --clock-hurry-bg: MistyRose;
  --clock-overtime-bg: #fffbad;
  --clock-running-bg: rgb(208, 224, 189);
  --clock-running-color: Black;
  --white-text: #d0d0d0;
  --black-text: #606060;
  --blue-text: RoyalBlue;
  --red-text: Crimson;
  --gold-text: GoldenRod;
  --pink-text: Pink;
  --green-text: Green;
  --time-text: #757575;
  --drop-down: #fff;
  --modal-bg: #fff;
  --box-header: #f5f5f5;
  --button-new-game: linear-gradient(to bottom, #f5f5f5 0%, #ededed 100%);
  --button-new-game-hover: linear-gradient(to bottom, #fafafa 0%, #f2f2f2 100%);
  --button-text: #787878;
  --button-text-hover: #787878;
  --scrollbar-thumb: #dbdbdb;
  --scrollbar-thumb-hover: #b3b3b3;
  --input-border: #ccc;
  --leaderboard: #bf811d;
  --leaderboard-even: #302e2c;
  --btn-controls: #fff;
  --rematch: linear-gradient(to bottom, #f5f5f5 0%, #ededed 100%);
  --rematch-hover: #5fa1de;
  --link-color-blue: #004f98;
  --janggi-setup: #ccc;
  --border-color: #d9d9d9;
  --checkbox-bg: #a1c27c;
  --checkbox-border: #e3e3e3;
  --checkbox-checked: #7daa49;
  --post-hover: #ddebf8;
  --vpanel-button: #fbfbfb;
  --vpanel-button-hover: #fdfdfd;
  --vpanel-heading: #737373;
  --box-shadow-panel-btn: 0px 2px 3px #7b7b7b85;
  --chat-entry-border-top: #d9d9d9;
  --chat-entry-bg: #fafaf9;
  --toggle-bg: #c0c0c0;
  --slider-border: #a9a9a9;
  --anal-clock: #bbd7f1;
  --pv-hover: #e0ebd3;
  --table-even: rgb(235, 235, 235);
  --bug-waiting: #787878;
  --zoom: 100;
  --zoom-a: 100;
  --zoom-b: 100;
  --block-gap: 15px;
}
[data-theme='dark'] {
  --dark-mode: 1;
  --feature-btn: #384722;
  --invalid-queen: #b22222;
  --font-color: #bababa;
  --link-color: #999;
  --link-hover: #3692e7;
  --text-shadow: none;
  --bg-body: #161512 linear-gradient(to bottom, #2e2a24, #161512 116px)
    no-repeat;
  --bg-color0: #262421;
  --bg-color1: #2e2a24;
  --bg-color2: #302e2c;
  --bg-seek: rgb(46, 42, 36,0.8);
  --bg-meta: #302e2c;
  --bg-input: #24221e;
  --game-hover: #223344;
  --green-hover: #537c23;
  --blue-active: #293a49;
  --blue-passive: #33312e;
  --blue-hover: #3692e7;
  --invite-game: #2c3021;
  --notify-new: #465330;
  --gold: #bf811d;
  --rusty: #d64f00;
  --ct-current: #f16e22;
  --clock-hurry-bg: #502826;
  --clock-overtime-bg: #474722;
  --clock-running-bg: #384722;
  --clock-running-color: #e3e3e3;
  --drop-down: #3c3934;
  --modal-bg: rgb(38, 36, 33);
  --box-header: linear-gradient(to bottom, #3c3934, #33312e 100%);
  --button-new-game: linear-gradient(to bottom, #3c3934, #33312e 100%);
  --button-new-game-hover: linear-gradient(
    rgb(68, 65, 59),
    rgb(59, 57, 53) 100%
  );
  --button-text: #999;
  --button-text-hover: #ccc;
  --scrollbar-thumb: #4d4d4d;
  --scrollbar-thumb-hover: #6b6b6b;
  --input-border: #444;
  --leaderboard: #bf811d;
  --leaderboard-even: #302e2c;
  --btn-controls: rgb(48, 46, 44);
  --rematch: linear-gradient(to bottom, #3c3934, #33312e 100%);
  --rematch-hover: #3171ac;
  --link-color-blue: #3692e7;
  --janggi-setup: #5d5d5d;
  --border-color: #404040;
  --checkbox-bg: #3b5c16;
  --checkbox-border: #4f7a1d;
  --post-hover: #29353f;
  --vpanel-button: #3c3a35;
  --vpanel-button-hover: #464440;
  --vpanel-heading: #a3a3a3;
  --panel-link-hover: rgb(179, 179, 179);
  --box-shadow-panel-btn: none;
  --chat-entry-border-top: #404040;
  --chat-entry-bg: #262421;
  --time-text: #8C8C8C;
  --toggle-bg: #696969;
  --slider-border: #7a7a7a;
  --anal-clock: #2b455d;
  --pv-hover: #323c22;
  --table-even: rgba(255, 255, 255, 0.05);
  --bug-waiting: #404040;
}
[data-theme='dark'] .icon-black:before {
  content: '\63';
}
[data-theme='dark'] .icon-white:before {
  content: '\62';
}
[data-icon]:before, [class*=' icon-']:before {
  font-size: 1.2em;
  vertical-align: middle;
  opacity: 0.6;
}
ul.guide [data-icon]:before {
  margin-inline: 0 0.3em;
  opacity: 0.8;
}
ul.guide li a {
  display: block;
  position: relative;
  padding: 12px 24px 12px 0;
}
@media (min-width: 800px) {
  ul.guide li a::after {
    content: "";
    background-color: var(--rusty);
    position: absolute;
    width: 4px;
    height: 100%;
    top: 1%;
    right: -1px;
    transform: scale(0);
    transition: all 0.25s;
  }
  ul.guide li a.active::after,
  ul.guide li a:hover::after {
    transform: scale(1);
  }
}
.modal-content [data-icon]:before, header [data-icon]:before, [class*=' icon-']:before {
  opacity: 0.9;
}
.icon-puzzle:before {
  content: '🎯';
  color: var(--font-color);
}
.icon-sente:before {
  content: '☗';
  vertical-align: unset;
}
.icon-gote:before {
  content: '☖';
  vertical-align: unset;
}
[data-theme='dark'] .icon-sente:before {
  content: '☖';
  vertical-align: unset;
}
[data-theme='dark'] .icon-gote:before {
  content: '☗';
  vertical-align: unset;
}
img {
  max-width: 100%;
  height: auto;
}

.hide {
  display: none !important;
}

.hamburger-inner,
.hamburger-inner::before,
.hamburger-inner::after,
.hamburger.is-active .hamburger-inner,
.hamburger.is-active .hamburger-inner::before,
.hamburger.is-active .hamburger-inner::after {
  background-color: var(--link-color);
}

html {
  font-size: 12px;
  min-height: 100%;
  font-family: 'Noto Sans', Sans-Serif;
  box-sizing: border-box;
}
*,
::before,
::after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}
body {
  margin: 0;
  color: var(--font-color);
  background: var(--bg-body);
  cursor: default;
  margin-bottom: 2vmin;
}
body.no-select {
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
}
::-webkit-scrollbar-track {
  background-color: var(--bg-color2);
}
::-webkit-scrollbar {
  width: 8px;
  background-color: #fff;
}
::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb);
}
::-webkit-scrollbar-thumb:hover {
  background-color: var(--scrollbar-thumb-hover);
}

div#preload {
  /* preload board .svg images */
  display: none;
}

h1,
h2,
h3 {
  font-weight: normal;
  font-family: 'Roboto', Sans-Serif;
}
h1 {
  padding: 4vh 0vh;
}
h2,
p {
  padding: 1vh;
}
.box {
  background: var(--bg-color0);
  box-shadow: var(--base-shadow);
  border-radius: 3px;
}
table,
tbody,
tfoot,
thead,
tr,
th,
td {
  font-size: 100%;
  font: inherit;
  text-align: inherit;
}
header {
  display: flex;
  justify-content: space-between;
  position: relative;
  height: var(--site-header-height);
  z-index: 106;
  max-width: 1800px;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

iframe {
  border: none;
  display: block;
  margin: auto;
  max-width: 100%;
}

.center {
  display: block;
  margin: auto;
}

.flat-bg {
  background-color: var(--bg-color0);
  padding: 1em;
}

.cont-link {
  display: block;
  text-align: right;
  margin: 0.5em 1em 0.5em 0;
}

@media (min-width: 320px) {
  html {
    font-size: calc(12px + 2 * ((100vw - 320px) / 880));
  }
}
@media (min-width: 1220px) {
  html {
    font-size: 14px;
  }
}
@media (min-width: 800px) {
  body {
    --main-margin: 1vw;
  }
}
#main-wrap {
  display: grid;
  grid-template-columns:
    var(--main-margin) 1fr minmax(auto, var(--main-max-width))
    1fr var(--main-margin);
  grid-template-areas: '. . main . .';
  margin-top: var(--site-header-margin);
  place-content: center;
  --main-max-width: 1300px;
}

@media (max-width: 799px) {
  #main-wrap {
    --main-max-width: calc(
      100vh - calc(var(--site-header-height) + var(--site-header-margin)) -
        100px - 2.5em
    );
  }
  .modal {
      width: min(400px, 80vw);
  }
}
@media (max-width: 599px) {
  #main-wrap {
    --main-max-width: 100%;
  }
}
.round {
  grid-area: main;
  display: grid;
  grid-template-columns: 1fr;
  --board-scale: 1;
  grid-template-areas: 'app' 'uboard' 'side' 'uside';
}

@media (min-width: 800px) and (min-height: 500px) {
  .round {
    --board-scale: calc((var(--zoom) / 100));
  }
}

@media (min-width: 800px) {
  .round {
    grid-template-columns:
      minmax(250px, 350px) minmax(
        calc(70vmin * var(--board-scale)),
        calc(
          100vh * var(--board-scale) -
            calc(var(--site-header-height) + var(--site-header-margin)) - 3rem
        )
      )
      minmax(240px, 400px);
    grid-template-rows: fit-content(0);
    grid-template-areas: 'side app app' 'uleft uboard .';
    grid-gap: 2vmin;
  }
}

.embed {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
}
.embed iframe {
  position: absolute;
  width: 100%;
  height: 100%;
}

#mainboard {
  grid-area: board;
  position: relative;
}

.lobby {
  grid-area: main;
  display: grid;
  grid-gap: 2vmin;
}
@media (min-width: 800px) {
  .lobby {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(2, fit-content(0));
    grid-template-areas: 'side app app table' 'uleft blog blog utable';
  }
}
div.seeks {
  display: grid;
  grid-area: app;
  border-radius: 3px;
}
span[role=tab], div.seeks-table thead {
  font-family: "Roboto", sans-serif;
}
.seeks [data-icon]:before {
  font-size: 20px;
}
.seeks [class*=' icon-']:before {
  font-size: 18px;
}
.page-menu {
  grid-area: main;
  display: grid;
  grid-template-columns: max-content auto;
  grid-template-rows: min-content;
  grid-template-areas: 'side content';
}
@media (max-width: 799px) and (orientation: portrait) {
  .page-menu {
    display: block;
  }
}
.sidebar-first {
  grid-area: side;
  display: flex;
  flex-flow: column nowrap;
  justify-content: right;
}
.sidebar-second {
  grid-area: table;
  flex: 1;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  margin: 2em 0 0 0;
  position: relative;
}
under-left {
  grid-area: uleft;
  display: flex;
  align-content: flex-start;
  justify-content: center;
  flex-flow: row wrap;
}
.internalLinks {
  display: flex;
  flex: 1 0 100%;
  justify-content: center;
  margin-top: 0.5em;
}
under-board {
  grid-area: uboard;
  margin-top: 23px;
}
div#fentext {
  display: flex;
  flex-flow: row;
}
div#fentext strong {
  align-self: center;
}
input#fullfen {
  width: 100%;
  border: 0;
  margin: 0;
  padding: 0.3em;
  background: none;
}
textarea {
  white-space: pre-wrap;
  font-family: monospace;
  width: 100%;
  color: var(--font-color);
  background-color: var(--bg-color1);
  resize: none;
}
div.pgn {
  width: calc(var(--cg-width));
}
#pgnpaste {
  width: 90%;
  height: 30vh;
  background-color: var(--bg-color2);
  border: 1px solid var(--input-border);
  margin: 2em 1em 0;
}

div.about,
div.guide,
div.patron,
div.closed,
div.paste,
div.invite,
div.blogs,
div.memory,
div.not-found {
  grid-area: main;
  margin: 0 auto;
  border-radius: 5px;
  font-size: 1.1em;
  box-shadow: var(--base-shadow);
  background-color: var(--bg-color0);
  padding: 2rem;
}

div.guide,
div.blogs {
  grid-area: content;
}

div.guide,
div.blogs,
div.about {
  padding: 20px 40px;
  font-size: 1.2em;
}

div.guide h1,
div.guide h2,
div.guide h3 {
  text-align: center;
}

div.guide h1 {
  display: flex;
  justify-content: center;
  align-items: center;
}

div.guide h1 img {
  margin-right: 10px;
  height: 1em;
}

div.guide h2,
div.guide p,
div.blogs h2,
div.blogs p {
  line-height: 1.8;
}

div.guide h2 {
  font-size: 30px;
  font-weight: 600;
}

div.guide h2,
div.guide p {
  padding: 1.2rem;
}

div.guide ul {
  margin-left: 15px;
}

div.guide li {
  margin: 5px 0px;
}

div.closed {
  width: 610px;
}
under-lobby {
  grid-area: blog;
}
div.blogs {
  margin: 0;
  padding: 5vh;
}
a.blogs {
  margin-right: 0.4em;
}
posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  grid-gap: 1em;
  grid-template-rows: auto;
  font-size: 0.9em;
  line-height: 1.5;
  grid-auto-rows: 0;
}
a.post {
  background-color: var(--bg-color0);
  align-items: center;
  position: relative;
  box-shadow: var(--base-shadow);
  border-radius: 5px;
}
a.post:hover {
  color: var(--link-color);
  background: var(--post-hover);
  box-shadow: none;
}
a.post img {
  max-width: none;
  width: 100%;
  height: auto;
  object-fit: cover;
  aspect-ratio: 1.5;
}
a.post span.text {
  display: flex;
  flex-direction: column;
  max-height: 12em;
  padding: 3% 3% 4% 6%;
  margin: 0;
}
a.post span.text strong {
  font-size: 1.2em;
  margin-bottom: 10px;
  color: var(--font-color);
}
a.post time {
  font-size: 90%;
  opacity: 1;
  position: absolute;
  top: 0;
  left: 0;
  padding: 0.2em 0.5em 0.3em 0.5em;
  background: rgba(0, 0, 0, 0.65);
  color: #ddd;
  text-shadow: 1px 1px 1px black;
}
a.post span.author {
  font-size: 90%;
  opacity: 1;
  position: absolute;
  padding: 0.2em 0.5em 0.3em 0.5em;
  background: rgba(0, 0, 0, 0.65);
  color: #ddd;
  text-shadow: 1px 1px 1px black;
  top: 0;
  right: 0;
}

.meta-headline {
  background: var(--bg-meta);
  text-align: center;
  box-shadow: var(--base-shadow);
  padding: 1rem;
}
.meta {
  text-align: center;
  margin-bottom: 1.4rem;
}
.headline {
  display: block;
  font-size: 1.3em;
  font-style: italic;
  font-weight: normal;
}
span.text {
  display: inline-block;
  margin-right: 2em;
}
ul.guide {
  list-style: none;
}
ul.guide li {
  font-size: 1.1em;
}
@media (max-width: 799px) and (orientation: portrait) {
  ul.guide {
    margin: 4vmin;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    padding: 0;
    grid-gap: 6px;
  }
  ul.guide li {
    font-size: 1rem;
    margin: 0;
  }
  ul.guide li a {
    padding: 8px 0px;
  }
}
.login.nav-link {
  align-self: center;
  display: inline-block;
  font-size: 1.2em;
  border-radius: 3px;
  text-transform: uppercase;
  white-space: nowrap;
  padding: 5px;
  line-height: normal;
}
.login.nav-link:hover {
  background-color: var(--bg-color2);
  box-shadow: var(--base-shadow);
}
.nav-link {
  line-height: var(--site-header-height);
  padding: 0 0.7rem;
}
.nav-link:link,
.nav-link:visited {
  color: var(--link-color);
}
.drp .nav-link {
  color: var(--font-color);
}
.nav-link:hover,
.nav-link:active {
  color: var(--blue-hover);
}
.nav-link.home {
  font-size: 25px;
}

.nav-link.active.home {
  color: var(--font-color);
}

.nav-link.active.home:hover {
  color: var(--blue-hover);
}

.site-title-nav {
  display: flex;
  justify-content: flex-start;
  padding-left: 14px;
}
@media (max-width: 799px) {
  .site-title-nav {
    padding-left: 0;
    flex-direction: column;
  }
}
.topnav {
  display: flex;
  margin: 0;
  padding: 0;
  height: var(--site-header-height);
  color: var(--font-color);
}

.topnav a {
  float: left;
  height: var(--site-header-height);
  font-size: 14px;
}
.topnav section > a {
    text-transform: uppercase;
}
.topnav span {
  position: relative;
  top: -12px;
  margin-left: 5px;
  font-size: 14px;
  color: red;
}

.hamburger {
  display: none;
  width: 100%;
}

@media (max-width: 799px) {
  .site-title-nav {
    width: 64px;
  }
  .topnav {
    flex-direction: column;
    height: initial;
    transform: translateX(-100%);
  }
  .topnav a {
    transform: translateX(-100%);
    transition: transform 200ms;
    width: 20rem;
  }
  .hamburger {
    display: block;
  }
  .hamburger.is-active {
    background-color: var(--bg-color0);
  }
  .topnav a.navbar-show {
    transform: translateX(calc(0% + 64px));
    color: var(--font-color);
    background-color: var(--bg-color0);
  }
  .site-buttons {
    margin-left: 0;
  }
  .variant-name {
    display: none;
  }
  .topnav section > a {
    display: none;
  }
}

/* Dropdown */
@media (min-width: 800px) {
  .topnav section {
    position: relative;
  }

  section a:first-child:hover {
    color: var(--font-color);
  }

  div.topnav section:hover {
    background-color: var(--drop-down);
  }

  .drp {
    visibility: hidden;
    background-color: var(--drop-down);
    position: absolute;
    left: 0;
    top: 50px;
    min-width: 12rem;
    border-left: 2px solid #3692e7;
    border-radius: 0 3px 3px 3px;
    text-align: left;
    box-shadow: 2px 5px 6px rgba(0, 0, 0, .3);
  }

  .drp a {
    width: 100%;
    display: flex;
    height: 40px;
    align-items: center;
  }

  .drp a:first-child {
    border-top-right-radius: 3px;
  }

  .drp a:last-child {
    border-bottom-left-radius: 1px;
    border-bottom-right-radius: 3px;
  }
  /* longhand because /puzzles is both first and last child */

  .drp a:hover {
    background-color: #3692e7;
    color: var(--font-color);
  }

  .topnav section:hover {
    box-shadow: inset 2px 0px 0px 0px #3692e7;
  }

  .topnav section:hover > a {
    color: var(--font-color);
  }

  .drp .nav-link:hover {
    color: white;
  }

  .topnav section:hover .drp {
    visibility: visible;
  }
}
/* Site buttons */

.site-buttons {
  display: flex;
  flex-flow: row nowrap;
  margin: 0;
  padding: 0;
}

#btn-settings, #btn-notify {
  padding: 8px;
  height: var(--site-header-height);
}
#btn-notify.shown, #notify-app,
#btn-settings.shown, #settings {
  background-color: var(--drop-down);
}
#settings, #notify-app {
  display: none;
  flex-direction: column;
  color: var(--font-color);
  background-color: var(--drop-down);
  box-shadow: -1px 5px 6px rgba(0, 0, 0, .3);
  position: absolute;
  top: var(--site-header-height);
  right: 0;
  border-radius: 5px 0px 0px 5px;
}
#settings-lang, #settings-board {
  overflow: auto;
  max-height: min(100vh - 70px, 91vh);
}
#settings-lang {
  max-height: 400px;
}
#notify-app {
  overflow: hidden;
  width: 25rem;
  max-width: 100vw;
  right: 0;
}
.data-count {
  position: relative;
}
.data-count::after {
  content: attr(data-count);
  top: 6px;
  right: 0;
  position: absolute;
  padding: 0 3px;
  height: 15px;
  line-height: 15px;
  font-weight: bold;
  font-size: 13px;
  border-radius: 3px;
  background: #d64f00;
  color: #fff;
}
.noread.data-count::after {
  position: relative;
  top: 0;
  margin-left: 3px;
}
.data-count[data-count="0"]::after {
  display: none
}

.notification {
  display: flex;
  padding: .6rem .6rem .6rem 1rem;
  border-bottom: 1px solid var(--bg-color2);
  position: relative;
}
.notification.new {
  background: var(--notify-new);
}
.notification:hover {
  color: var(--font-color);
  background: var(--bg-color2);
}
 .notification:hover .icon {
  color: var(--blue-hover);
  opacity: .9;
}
.notification .icon {
  font-size: 2em;
  opacity: .5;
  margin-right: 1rem;
}
.notification.new .icon {
    color: var(--good);
    opacity: .7;
}
.notification .content {
  flex: 0 1 100%;
  overflow: hidden;
}
span.notification.empty span.text {
  align-self: center;
}
#notify-app .content span:first-child {
  display: flex;
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
}
#notify-app .content span:last-child {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
#settings div {
  display: flex;
  flex-direction: column;
}
#settings-main, #settings-lang,
#settings-background, #settings-sound,
#settings-zen {
  width: 200px;
}
#settings-board {
  width: 300px;
}
#settings-board div {
  margin: 5px;
}

#btn-logout {
  border-radius: 5px 0px 0px 0px;
}
#settings-lang label:last-child,
#soundtheme label:last-child,
#settings-background label:last-child,
#zen-selector label:last-child,
#btn-zen {
  border-radius: 0px 0px 0px 5px;
}

#sound-volume {
  width: 90%;
}
#settings div.labelled, div.labelled, div.arrow-toggle, div.infiniteAnalysis-toggle, div.nnue-toggle, div.fsfDebug-toggle, div.alice-mirror-toggle {
  display: flex;
  align-items: center;
  flex-direction: row;
}
.labelled label {
  padding-left: 0;
}
div.labelled input[type="range"] {
  margin-right: 1ch;
}
div.labelled > div {
  direction: ltr;
  flex: 0 0 auto;
  display: block;
  text-align: right;
}
#settings-buttons button {
  text-align: left;
  padding-left: 1rem;
  padding-right: 2rem;
}
#settings-buttons button:hover {
  color: #fff;
}
button#btn-logout:hover {
  background-color: #c33;
}
button#btn-lang:hover,
button#btn-sound:hover,
button#btn-background:hover,
button#btn-board:hover,
button#btn-zen:hover {
  background-color: var(--green-hover);
}

#settings input[type='radio']:checked + label {
  background-color: var(--green-hover);
}

#settings input[type='radio']:hover + label {
  background-color: var(--green-hover);
  opacity: 0.7;
}

#settings-lang > form, #settings-background > form {
  display: flex;
  flex-direction: column;
}

#settings-sound > div > div {
  flex-direction: column;
}

#board-settings > div {
  flex-direction: row;
  align-items: center; /* in Safari the inputs and labels are not vertically aligned */
}

#style-settings {
  display: flex;
}
settings-board,
settings-pieces {
  display: grid;
  grid-template-columns: auto auto;
  grid-gap: 0.5em;
  border: 1px solid var(--border-color);
}
settings-board {
  grid-template-rows: auto auto;
}

button.back {
  display: flex;
}

#username,
.login {
  line-height: var(--site-header-height);
  font-size: 17px;
}
.site-buttons > div > button:hover {
  color: var(--blue-hover);
}
.site-buttons button {
  color: var(--font-color);
  background-color: inherit;
  font-size: 17px;
  height: 3rem;
  line-height: 3rem;
  border: none;
  border-radius: unset;
}
.site-buttons button.back {
  font-size: 15px;
  height: unset;
  line-height: unset;
  padding: 1rem;
}
.site-buttons #settings-main button{
font-size: 14px;
}
.user-link {
  padding-right: 8px;
}
@media only screen and (max-width: 799px) {
.user-link {font-size: 0.8em;}
.site-buttons #settings-main button {font-size: 12px;}
}
a {
  white-space: break-spaces;
}
a,
.user-link:link,
.user-link:visited {
  color: var(--font-color);
  text-decoration: none;
  white-space: break-spaces;
  overflow: hidden;
}
a,
.user-link,
.user-link:active {
  color: var(--link-color);
}
a:hover,
.user-link:hover {
  color: var(--link-hover);
}
p a,
.blogs ul li a,
div.guide li a {
  color: var(--link-hover);
}
div a {
  cursor: pointer;
}
.disabled {
  pointer-events: none;
  cursor: default;
  opacity: 0.6;
}
.reflist {
  margin-right: 1.2em;
  font-weight: bold;
  text-decoration: none;
  font-size: 0.85em;
}
.movelist-block {
  grid-area: moves;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  background: var(--bg-color0);
  box-shadow: var(--base-shadow);
}

div.result, div.status {
  width: 100%;
  display: block;
  font-size: 1.2em;
  text-align: center;
}
div.result {
  font-weight: bold;
  border-top: 1px solid var(--bg-color2);
}
div.status {
  font-style: italic;
}
.lobby-button,
.donate-button,
button.request-analysis,
button#import,
button.paste-url {
  background-color: var(--bg-color2);
  border: none;
  color: var(--font-color);
  padding: 15px 2px;
  text-align: center;
  text-decoration: none;
  font-size: 18px;
  margin: 4px 2px;
  box-shadow: var(--base-shadow);
}
.lobby-button {
  width: 100%;
  margin: 20px 2px;
}
@media (max-width: 799px) {
  .lobby-button {
    padding: 0.5em;
    margin: 0.2em 0;
  }
}
button.request-analysis,
button#import,
button.join,
button.submit {
  padding: 0.8em 1em;
  margin: 2px 2px;
  border-radius: 4px;
  color: White;
  background-color: var(--blue-hover);
  white-space: nowrap;
}
button.paste-url {
  padding: 4px;
  margin: 5px 5px;
  border-radius: 4px;
  color: White;
  background-color: var(--blue-hover);
}
div.import {
  padding-top: 1.5rem;
}
.lobby-button:hover {
  background-color: var(--bg-color1);
}

button.rematch {
  border: none;
  color: var(--font-color);
  background: var(--rematch);
  padding: 18px 0;
}
button.rematch:hover {
  color: #fff;
  background: var(--rematch-hover);
}

button.newopp,
button.analysis {
  border: none;
  color: var(--font-color);
  background-color: var(--bg-color0);
  padding: 12px 0;
}
button.newopp:hover,
button.analysis:hover {
  color: #fff;
  background-color: var(--green-hover);
}

.i-pgn {
  float: left;
  padding: 6px;
  color: var(--link-color-blue);
}

.game-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-color0);
  box-shadow: var(--base-shadow);
  margin-bottom: 16px;
  padding: 12px;
  font-size: 14px;
  border-radius: 3px;
}
.game-info section:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.33333vmin;
  padding-bottom: 1.33333vmin;
}
.tourney .icon-trophy::before {
  padding-right: 8px;
}
.tourney {
  padding: 2px 6px;
}
.tourney a, .posnum a {
  color: var(--link-color-blue);
}
div.info1.icon,
div.info0.icon::before {
  opacity: 0.6;
}
div.info0,
div.info1 {
  display: flex;
  flex-flow: row;
  margin-bottom: 6px;
}
div.info0.games {
  padding-top: 16px;
}
div.info2 {
  padding-left: 10px;
  padding-bottom: 6px;
}
@media only screen and (max-width: 799px) {
  div.info2 { padding-left: 4px;}
}
div.info2 a, div.info2 .user-link {
  color: var(--link-color-blue);
}
div.info2 a, div.info2 .user-link:hover {
  color: var(--blue-hover);
}
div.info2.games {
  padding-top: 26px;
}
div.info0::before {
  content: [data-icon];
  font-size: 42px;
}
div.info1::before {
  content: [data-icon];
  font-size: 42px;
  margin-right: 5%;
}
span.icon {
  padding-right: 6px;
}
.games-info {
  display: flex;
  flex-direction: column;
  flex: 1 1 100%;
  justify-content: space-between;
  padding: 12px;
  margin: 0 auto;
}
div.info-middle {
  align-items: center;
  justify-content: center;
}
div.versus {
  display: flex;
  justify-content: center;
}
player.left {
  text-align: right;
}
player.right {
  text-align: left;
}
vs {
  padding: 0 6px 0 6px;
}
.info-result {
  text-align: center;
}
div.info-result {
  padding: 8px;
}
.info-result.win {
  color: var(--good);
}
.info-result.lose {
  color: var(--bad);
}
tc {
  padding: 8px;
  vertical-align: top;
}
round-player {
  padding: 8px;
  font-size: 16px;
  background-color: var(--bg-color0);
}
.player-data {
  display: block;
  justify-content: center;
  padding: 2px 6px;
}
div.highscore .player-data,
table#players .player-data {
  padding: 8px 6px;
}
player-title {
  color: var(--gold);
  font-weight: bold;
}
@media (max-width: 799px) {
  variant-name {
    display: none;
  }
}
.variant {
  font-size: 18px;
  margin-top: 0.5em;
  margin-left: 0.5em;
}
button .icon-cloud-upload:before,
button .icon-bar-chart:before {
  margin-right: 12px;
}
i-side {
  margin-right: 3px;
}
.online.icon.icon-online {
  margin-right: 0px;
}
.icon-blue:before {
  content: '\62';
  color: var(--blue-text);
}
.icon-red:before {
  content: '\62';
  color: var(--red-text);
}
.icon-gold:before {
  content: '\62';
  color: var(--gold-text);
}
.icon-pink:before {
  content: '\62';
  color: var(--pink-text);
}
.icon-green:before {
  content: '\62';
  color: var(--green-text);
}
.icon-online::before {
  color: var(--good);
  margin-right: 0.3em;
  font-size: 0.85em;
}
.icon-offline::before {
  color: LightGray;
  margin-right: 0.4em;
}
.icon-left:before {
  color: var(--green-hover);
  margin-right: 0.4em;
}
rating {
  float: right;
  font-size: 16px;
}
rating span {
  font-size: 12px;
}
good {
  color: var(--good);
}
bad {
  color: var(--bad);
}
vs-swords {
  padding: 4px 8px 0px 8px;
}
.seeks vs-swords {
  color: var(--good);
}
.seeks vs-swords.opp {
  color: var(--bad);
}
.sub-ratings {
  display: flex;
  flex-flow: row;
}
.sub-ratings a.empty {
  opacity: 0.3;
}
.sub-ratings a.active {
  background: var(--bg-color1);
  opacity: 1;
}
.sub-ratings h3 {
  font-size: 12px;
  letter-spacing: 1.1px;
  margin: 0;
}
.sub-ratings a {
  display: flex;
  flex: 1 1 100%;
  flex-flow: row;
  align-items: center;
  color: var(--font-color);
  text-decoration: none;
  padding: 0.7em 2vmin 0.7em 0.4em;
  opacity: 1;
}
.sub-ratings a:hover {
  background: var(--game-hover);
}
.sub-ratings a:hover::before {
  color: LightSkyBlue;
}
.sub-ratings a::before {
  font-size: 3em;
  margin-right: 0.2em;
}
.sub-ratings a .info2 {
  display: flex;
}
.sub-ratings a span rating {
  float: left;
}

ul.header {
  margin: 0;
  padding: 0;
  overflow: hidden;
}

li.header {
  float: right;
}

table.seeks {
  border-collapse: collapse;
  border-spacing: 0;
  border-radius: 3px;
  font-size: 14px;
  width: 100%;
}
.seeks-table {
  box-shadow: var(--base-shadow);
  background-position: center;
  background-image: url('images/seek-bg.svg');
  background-color: var(--bg-seek);
  background-blend-mode: overlay;
  background-size: 100% 100%;
  width: 100%;
  height: 100%;
}
.seeks-wrapper {
  height: 320px;
  overflow-y: scroll;
  -ms-overflow-style: scrollbar;
}
.seeks th {
  background: var(--bg-color2);
}
/*
#santa {
    display: inline-block;
    width: 28px;
    height: 20px;
    background-size: contain;
    background-position: center;
    background-image: url('images/Santa_hat.svg');
}
*/
.seeks th,
.seeks td {
  white-space: nowrap;
  font-weight: inherit;
  padding: 0.5em 0.7em 0.5em 0.7em;
}
.seeks thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--button-text);
}
.seeks tbody tr {
  cursor: pointer;
  border-bottom: 1px solid var(--chat-entry-border-top);
  z-index: 1;
}
.seeks tbody tr:hover {
  background-color: rgba(var(--rusty-rgb), 0.5);
}
.seekbuttons {
  display: flex;
  flex-flow: column;
  flex: 1 1 auto;
  justify-content: center;
}
.seekbuttons > button {
  color: var(--button-text);
  background: var(--button-new-game);
  font-size: 1.1rem;
  text-transform: uppercase;
  font-weight: 300;
  text-shadow: 0 1px 0 var(--text-shadow);
}
.seekbuttons > button:hover {
  color: var(--button-text-hover);
  background: var(--button-new-game-hover);
}
.seekbuttons > button:focus {
  background: #ff4f00;
  color: #fff;
  text-shadow: 0 1px 1px #000000;
}
/* The Modal (background) */
.modal {
  align-items: center;
  position: fixed; /* Stay in place */
  z-index: 999; /* Sit on top */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin-top: 16px;
  color: var(--font-color);
  border: 0;
}

dialog::backdrop {
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  background-color: rgb(0, 0, 0); /* Fallback color */
  background-color: rgba(0, 0, 0, 0.4); /* Black w/ opacity */
}
/* Input fields */
select,
input {
  padding: 0.6em 1em;
  border-radius: 3px;
  margin: 0px;
  display: inline;
  border: 1px solid var(--input-border);
  box-sizing: border-box;
  color: var(--font-color);
  background: var(--bg-color0);
}

/* Center the image and position the close button */
#closecontainer {
  width: 100%;
  text-align: center;
  margin: 0;
  padding: 0;
  position: relative;
}

.container {
  text-align: center;
  padding: 24px 0 24px;
}

#misc-infow,
#misc-infob {
  font-family: 'Roboto Mono', 'Roboto';
  font-size: 40px;
  font-weight: bold;
  text-align: right;
  padding: 0 4px 0 4px;
}
@media (max-width: 799px) and (orientation: portrait) {
  #misc-infow,
  #misc-infob {
    font-size: 2.3em;
  }
}
#misc-info-center {
  font-family: 'Roboto Mono', 'Roboto';
  font-size: 40px;
  font-weight: bold;
  text-align: center;
}

#misc-info {
  display: flex;
  justify-content: center;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-color0);
}

.text-color-blue {
  color: var(--blue-text);
}

.text-color-red {
  color: var(--red-text);
}

/* Modal Content/Box */
.modal-content {
  display: flex;
  flex-flow: column;
  background-color: var(--modal-bg);
  margin: 0 auto;
  max-width: min(calc(60vw + 100px), 450px);
  border: 1px solid var(--bg-color2);
}
.modal-content > div {
  overflow: auto;
}

.modal-content h2{
  font-size: 2em;
  padding: 0;
}

.modal-content select,
.modal-content input#fen {
  border-radius: 7px;
}

/* The Close Button (x) */
.close {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: -0px;
  color: #999;
  background: var(--bg-color1);
  width: 32px;
  height: 32px;
  font-size: 18px;
  border-radius: 50%;
}

.close:hover,
.close:focus {
  cursor: pointer;
  color: #fff;
  background: var(--bad);
}

#color-button-group {
  margin-top: 1.2em;
}

#color-button-group > button {
  color: var(--font-color);
  background: var(--button-new-game);
}
#create-button {
  margin-top: 1.2em;
}
#create-button > button {
  color: var(--font-color);
  background: var(--button-new-game);
  text-transform: uppercase;
  padding: 0.3em;
}
#btn-controls-top {
  grid-area: move-controls;
}
div.btn-controls {
  grid-area: game-controls;
  display: flex;
  justify-content: space-between;
}
div.btn-controls.after {
  grid-area: game-controls;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  background: var(--bg-color1);
  box-shadow: var(--btn-shadow);
}

#btn-controls-top button {
  font-size: 14px;
  background: var(--bg-color2);
}
#btn-controls-top button:hover {
  background: var(--green-hover);
}

.btn-controls button {
  flex: 1;
  height: 40px;
  border: none;
  color: var(--font-color);
  background-color: var(--bg-color0);
}

button {
  cursor: pointer;
  border-radius: 5px;
}
button:disabled {
  color: var(--bg-color1);
}
button[disabled] i {
  opacity: 0.5;
  color: var(--font-color);
}
.btn-controls button:not([disabled]):hover {
  color: #fff;
  background-color: var(--green-hover);
}

.btn-controls button#gear.selected {
  background-color: var(--green-hover);
}

.btn-controls button:focus {
  outline: none;
}
.btn-controls button::-moz-focus-inner {
  border: 0;
}

.btn-controls i {
  font-size: 1.8em;
}

#btn-controls-top i {
  font-size: 1em;
}

.icon-hand-paper-o {
  display: inline-block;
  transform: scaleY(-1) rotate(-90deg);
}

/* Clock */
.info-wrap0,
.info-wrap1 {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.info-wrap0 {
  grid-area: clock-top;
}
.info-wrap1 {
  grid-area: clock-bot;
}
@media (max-width: 799px) and (orientation: portrait) {
  .info-wrap0 {
    grid-area: 4 / 1 / 4 / 2;
    justify-self: flex-end;
  }
  .info-wrap1 {
    grid-area: 8 / 1 / 8 / 2;
    justify-self: flex-end;
  }
}
round-player0,
round-player1 {
  display: flex;
  justify-content: left;
  font-size: 1.2em;
  padding: 0 0.3em;
  line-height: 50px;
  align-self: center;
  background: var(--bg-color0);
}
@media (max-width: 799px) and (orientation: portrait) {
  round-player0,
  round-player1 {
    background: none;
    font-size: 1em;
    line-height: 36px;
  }
}
round-player0 {
  grid-area: user-top;
}
round-player1 {
  grid-area: user-bot;
}
.clock-wrap {
  display: flex;
  flex-direction: row;
  flex-grow: 1;
}
#more-time {
  float: right;
  font-size: 32px;
  display: flex;
}
button.icon.icon-plus-square {
  border: none;
  opacity: 0.4;
  color: var(--link-color-blue);
  background-color: var(--bg-body);
  font-size: 32px;
  margin: 0;
  padding: 0 0 0 4px;
}
button.icon.icon-plus-square:hover {
  opacity: 1;
}
button.icon:focus {
  outline: none;
}
button.icon::-moz-focus-inner {
  border: 0;
}

.clock {
  display: inline-flex;
  text-align: center;
  font-family: 'Roboto Mono', 'Roboto';
  font-size: 2.9em;
  font-weight: bold;
  box-shadow: var(--btn-shadow);
  background-color: var(--bg-color0);
}

@media (max-width: 799px) and (orientation: portrait) {
  .clock {
    font-size: 2em;
  }
}
.clock.running {
  color: var(--clock-running-color);
  background-color: var(--clock-running-bg);
}

.clock.hurry {
  background-color: var(--clock-hurry-bg) !important;
}

.clock.connecting {
  animation: clock-blink 0.5s cubic-bezier(0.5, 0, 1, 1) infinite alternate;
}
@keyframes clock-blink {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.clock.overtime {
  background-color: var(--clock-overtime-bg);
}

.clock-time.min {
  padding-left: 12px;
  box-sizing: border-box;
}
@media (max-width: 799px) and (orientation: portrait) {
  .clock-time.min {
    padding-left: 4px;
  }
}

.clock-time.sec {
  padding-right: 12px;
  box-sizing: border-box;
}

.clock.running > .clock-sep.low {
  color: Gray;
}

.clock-time.byo.byoyomi {
  display: block;
  align-self: center;
  font-size: medium;
  padding-right: 12px;
}
@media (max-width: 799px) and (orientation: portrait) {
  .clock-time.byo.byoyomi {
    padding-right: 4px;
  }
}

.clock-time.byo:not(.byoyomi) {
  display: none;
}

/* Material */
.material {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  align-self: center;
  height: 40px;
  line-height: 0;
  white-space: nowrap;
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}
.material-top {
  grid-area: mat-top;
}
.material-bottom {
  grid-area: mat-bot;
}
.material.disabled {
  height: 0px;
}

/* Playing color */
button.icon {
  margin: 5px 8px;
  padding: 8px;
}

button.icon.icon-black,
button.icon.icon-white {
  font-size: 29px;
}

button.icon.icon-adjust {
  font-size: 43px;
}

/* Casual/Rated and A.I. Level https://codepen.io/skeddles/pen/PbROLK */
input[type='radio'] {
  position: absolute;
  visibility: hidden;
  display: none;
}

label {
  display: inline-block;
  cursor: pointer;
  padding: 8px 12px;
}

form.modal-content span {
  font-weight: bold;
}

.radio-group input[type='radio']:checked + label {
  box-shadow: inset 0 2px 5px #537c23;
  color: White;
  background: var(--good);
  text-shadow: 0 1px 1px #003d00;
}

.radio-group label + input[type='radio'] + label {
  border-left: 1px solid var(--border-color);
}

.radio-group {
  box-shadow: var(--base-shadow);
  display: inline-block;
  margin: 20px auto 5px;
  overflow: hidden;
  border-radius: 4px;
  color: var(--font-color);
  background-color: var(--bg-color2);
  text-shadow: 0 1px 0 var(--text-shadow);
}

form#game-mode label {
  padding: 10px 30px;
}

/* Chat */
.chat {
  grid-area: chat;
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  background: var(--bg-color0);
  min-height: 15em;
  border-radius: 3px;
  box-shadow: var(--base-shadow);
}

.chat .time {
  display: inline-flex;
  margin-right: 3px;
  color: var(--time-text);
}

.chat .discord-icon-container {
  display: inline-flex;
  align-items: center;
  margin-right: 3px;
  width: 0.8em;
  height: 0.55em;
  background: white;
  background-position: center;
  transform: translateY(2px);
}
.chat .discord-icon {
  fill: #5865f2;
}

user {
  padding-right: 6px;
  font-weight: bold;
}
div.chatroom {
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5em 10px;
  letter-spacing: 0.011em;
  font-weight: 300;
}

#checkbox {
  -webkit-appearance: none;
  display: block;
  background: var(--bg-color2);
  padding: 0.5em;
  border-radius: 3px;
  border: 1px solid var(--checkbox-border);
  cursor: pointer;
}
#checkbox:checked {
  background: var(--checkbox-bg);
  border-color: var(--checkbox-checked);
}

ol#lobbychat-messages,
ol#bugroundchat-messages,
ol#roundchat-messages {
  flex: 2 1 0;
  order: 1;
  overflow-x: hidden;
  overflow-y: auto;
}

li.message {
  word-break: break-word;
  padding-left: 6px;
  padding-right: 6px;
  padding-bottom: 6px;
  margin-top: 5px;
  margin-bottom: 5px;
  font-size: max(0.9em, 12px);
}

li.message.offer {
  color: DarkSeaGreen;
}

li.message.server {
  color: var(--bad);
}

#chat-entry {
  display: flex;
  order: 2;
  border: none;
  border-top: 1px solid var(--chat-entry-border-top);
  margin: 0;
  padding: 5px 20px 4px 4px;
  margin-top: auto;
  color: var(--font-color);
  background: var(--chat-entry-bg);
  letter-spacing: 0.035em;
  font-weight: 300;
}
#spectators {
  overflow-wrap: break-word;
  justify-content: normal;
}
#move-controls {
  grid-area: move-ctr;
}
#movelist {
  display: flex;
  height: var(--movelist-max-height);
  max-height: var(--movelist-max-height);
  overflow-y: auto;
  flex-flow: row wrap;
  position: relative;
  line-height: 1.7;
  font-size: 1.1em;
  align-items: center;
  align-content: flex-start;
  background: var(--bg-color0);
}
move {
  line-height: 1.9em;
  float: left;
  flex: 0 0 43.5%;
  padding-left: 6px;
  box-sizing: border-box;
  justify-content: center;
}
move.active {
  font-weight: bold;
}
movetime {
  font-size: 0.6em;
  padding-right: 8px;
  color: Gray;
  float: right;
}
eval {
  font-size: 0.8em;
  padding-right: 8px;
  color: Gray;
  float: right;
}

move.counter {
  color: Gray;
  flex: 0 0 13%;
  background-color: var(--bg-color2);
  text-align: center;
}

vari-move:hover,
move:hover,
move-bug:hover {
  color: var(--font-color);
  background-color: var(--blue-hover);
}
vari-move.active,
move.active,
move-bug.active {
  background-color: var(--blue-active);
}
move.hidden {
  visibility: hidden;
}
vari {
  flex: 0 0 100%;
  background-color: var(--bg-color2);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  max-width: 100%;
}
vari-move {
  padding-left: 4px;
}

/* range input slider */
.slider {
  -webkit-appearance: none;
  width: 98%;
  margin: 2px auto;
  height: 15px;
  border-radius: 10px;
  background: var(--toggle-bg);
  outline: none;
  /*  -webkit-transition: .2s;*/
  /*transition: opacity .2s;*/
  padding: 0.6em 0em;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 15px;
  border: 1px solid var(--slider-border);
  border-radius: 10px;
  background: var(--bg-color1);
  cursor: pointer;
}

.slider::-moz-range-thumb {
  width: 26px;
  height: 15px;
  border: 1px solid var(--slider-border);
  border-radius: 10px;
  background: var(--bg-color1);
  cursor: pointer;
}

#tc_settings .slider {
  width: 90%;
  margin: 5px auto;
  padding: 0.8em 0;
  border: none;
}

#tc_settings .slider::-webkit-slider-thumb {
  width: 35px;
  height: 22px;
  border-radius: 15px;
}

#tc_settings .slider::-moz-range-thumb {
  width: 35px;
  border-radius: 15px;
  padding: 0.3em 0;
}

input#fen {
  width: 100%;
  margin: 0;
}

/* crosstable */
div.ctable-container {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding-top: 1vmin;
  padding-bottom: 1vmin;
}
.crosstable {
  display: flex;
  width: 100%;
  line-height: 1.9em;
  background-color: var(--bg-color1);
  box-shadow: var(--base-shadow);
}
.crosstable povs {
  flex: 1 1 auto;
  display: flex;
  flex-flow: column;
  text-align: center;
}
.crosstable povs a {
  color: var(--font-color);
}
.crosstable povs .win {
  font-weight: bold;
}
.crosstable povs.current a {
  color: #fff;
  background-color: var(--ct-current);
}
.ct-users {
  flex: 7 1 auto;
  display: flex;
  flex-flow: column;
  max-width: 40vw;
  text-align: left;
  padding-left: 2vmin;
  background-color: var(--bg-color2);
}
.ct-users a {
  color: var(--font-color);
}
.ct-score {
  flex: 0 0 auto;
  display: flex;
  flex-flow: column;
  font-weight: bold;
  text-align: right;
  padding-right: 2vmin;
  background-color: var(--bg-color2);
}
.crosstable fill {
  flex: 14.25 1 auto;
}
.crosstable povs a {
  flex: 0 0 50%;
}

/* Tooltip container */
.tooltip {
  position: relative;
}

/* Tooltip text */
.tooltip .tooltiptext {
  visibility: hidden;
  position: absolute;
  right: 105%;
  z-index: 1;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
  visibility: visible;
}

.pocket-wrapper {
  justify-content: center;
  display: flex;
}
.pocketrow {
    width: calc(var(--cg-width)/var(--files) * var(--pocketLength));
    height: calc(var(--piecerows) * var(--cg-height) / var(--ranks));
    display: flex;
    flex-wrap: wrap;
}
.pocket-top {
  grid-area: pocket-top;
}
.pocket-bot {
  grid-area: pocket-bot;
}
@media (max-width: 799px) and (orientation: portrait) {
  .pocket.top {
    margin-bottom: 0;
  }
  .pocket.bottom {
    margin-top: 0;
  }
}
.langs select {
  padding: 0px 4px 0px 4px;
  margin: 10px 0;
  border: none;
  background-color: inherit;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* tournaments */
.tour-spotlight {
  display: flex;
  flex-flow: row nowrap;
  flex: 0 0 auto;
  padding: 0.3em;
  opacity: 0.8;
  transition: all 150ms;
  color: var(--font-color);
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  background: linear-gradient(
    to bottom,
    var(--blue-active),
    var(--blue-passive) 100%
  );
}

div#spotlights > div {
  border-radius: 7px;
  overflow: hidden;
  box-shadow: var(--base-shadow);
}

.tour-spotlight:hover {
  opacity: 1;
}

.tour-spotlight i.icon::before {
  color: #fff;
  font-size: 50px;
  margin: 0 5px 0 0;
  text-shadow: 1px 1px 2px #1b78d0;
}
.tour-spotlight .name {
  margin-top: 1px;
  line-height: 13px;
  display: block;
}
.tour-spotlight .headline {
  display: block;
  font-size: 0.85em;
  margin-bottom: -3px;
}
.tour-spotlight .more {
  font-size: 0.85em;
}

a#zen-button {
  display: none;
}
.shield-trophy {
  display: block;
  height: 80px;
  background: url(images/trophy/shield-gold.png) no-repeat;
  background-position: center;
  background-size: contain;
  font-family: 'pychess';
  font-size: 40px;
  line-height: 70px;
  text-align: center;
  color: #333 !important;
  text-shadow: 0 0 6px #fff;
  filter: drop-shadow(0 0 10px #d59020);
}
input:invalid {
  border: 1px solid red;
}

/* Search Bar  */

.search-bar {
  padding-right: 8px;
  position: relative;
  width: 50px;
  height: var(--site-header-height);
  border-radius: var(--site-header-height);
  transition: 0.25s;
  overflow: hidden;
}

.search-bar.active {
  width: 250px;
  overflow: inherit;
}

.search-icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 60px;
  height: var(--site-header-height);
  border-radius: var(--site-header-height);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  cursor: pointer;
}

.search-icon::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 3px solid var(--link-color);
  border-radius: 50%;
  transform: translate(-5px, -2px);
}

.search-icon::after {
  content: '';
  position: absolute;
  width: 3px;
  height: 8px;
  background: var(--link-color);
  transform: translate(3px, 6px) rotate(315deg);
}

.search-bar .input {
  position: relative;
  width: 190px;
  height: 60px;
  left: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
  background: none;
}

.search-bar .input input {
  top: 0;
  width: 100%;
  border: none;
  outline: none;
  font-size: 17px;
  padding: 10px 0;
  background: none;
}

#ac-result {
  padding-left: 12px;
}

#ac-result ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}
#ac-result ul li:hover {
  background: var(--blue-active);
}

#ac-result ul li a {
  color: var(--text-color);
  display: inline-block;
  width: 100%;
  padding: 0.6em 0.5em;
  overflow: visible;
}
/* Search Bar End  */

div.tv cg-container, div.puzzle cg-container {
  right: unset;
}

.vstext {
  display: flex;
  flex-flow: row nowrap;
  align-items: center;
  justify-content: space-between;
  color: var(--font-color);
}

span.vstext {
  display: flex;
  flex-flow: column;
  align-items: center;
  color: var(--font-color);
}

/* Add pseudo-element only if data attribute is set */
input[data-file]::after {
  content: attr(data-file);
  margin-left: 0.375em;
}

games-grid {
    display: grid;
    --auto-grid-min-size: 200px;
    justify-content: center;
    overflow-x:hidden;
    grid-template-columns: repeat(auto-fill, minmax(var(--auto-grid-min-size), 1fr));
    grid-column-gap: 0.3em;
}
games-grid div {
    padding-left: 0.3em;
    padding-right: 0.3em;
}
div[role=tabpanel] {
    height: var(--panel-height);
    display: none;
    text-align: left;
    overflow-y: auto;
}
div[role=tabpanel] textarea {
    overflow-y: hidden;
    background-color: var(--bg-color);
    border: none;
    resize: none;
    outline: none;
}
div[role=tablist] {
    display: flex;
    flex-flow: row nowrap;
    justify-content: center;
    align-items: flex-start;
}
span[role=tab] {
    flex: 1 1 0;
    text-align: center;
    padding: 0.4em 0.1em;
    cursor: pointer;
    position: relative;
    transition: color .25s,border-color .25s;
}
span[aria-selected=true], div[role=tablist] span:hover::after {
    color: var(--rusty);
    border-color: var(--rusty);
    border-bottom: 2px solid var(--rusty);
    transform: scale(1);
}
div > span[role=tab]::after {
    content: '';
    background: var(--rusty);
    height: 2px;
    position: absolute;
    width: 100%;
    left: 0%;
    bottom: -2px;
    transition: all .25s;
    transform: scale(0)
}
.indicator {
    color: var(--rusty);
}

body.resizing {
  user-select:none;
  -webkit-user-select:none
}
cg-resize {
  display:none
}
@media(min-width: 799.3px) {
  cg-resize {
    display:block;
    position:absolute;
    right:-9px;
    bottom:-9px;
    width:22px;
    height:22px;
    cursor:nwse-resize;
    z-index:10
  }
  cg-resize::before,
  cg-resize::after {
    background:#000;
    content:"";
    position:absolute;
    width:12px;
    height:1px;
    left:0
  }
  cg-resize::before {
    width:5px;
    transform:translate(7px, 8px) rotate(-45deg)
  }
  cg-resize::after {
    transform:translate(1px, 6px) rotate(-45deg)
  }
  cg-resize:hover {
    border-radius:50%;
    background:hsla(22, 100%, 42%, 0.5);
  }
  .resizing cg-resize {
    border-radius:50%;
    background:hsla(88, 62%, 37%, 0.5);
  }
}
img.logo {
  height:1em;
}

/* Username Dialog Styles */
.modal-overlay {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  margin-top: 16px;
  background-color: var(--modal-bg);
  color: var(--font-color);
  display: none;
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal-overlay[style*="block"] {
  display: flex;
}

.username-dialog-content {
  background: var(--bg-color);
  border-radius: 8px;
  padding: 2rem;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  color: var(--text-color);
}

.username-dialog-content h2 {
  margin: 0 0 1rem 0;
  font-size: 1.5rem;
  text-align: center;
  color: var(--text-color);
}

.username-dialog-content p {
  margin: 0 0 1.5rem 0;
  text-align: center;
  color: var(--text-dim-color);
}

.username-input-container {
  position: relative;
  margin-bottom: 1rem;
}

.username-input-container input {
  width: 100%;
  padding: 0.75rem;
  padding-right: 2.5rem;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
  background: var(--bg-color);
  color: var(--text-color);
  box-sizing: border-box;
}

.username-input-container input:focus {
  outline: none;
  border-color: var(--link-color);
}

.username-status {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
}

.username-status.checking {
  color: #ffa500;
}

.username-status.available {
  color: #4caf50;
}

.username-status.unavailable {
  color: #f44336;
}

.error-message {
  color: #f44336;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  text-align: center;
}

.username-requirements {
  margin-bottom: 1.5rem;
}

.username-requirements ul {
  margin: 0;
  padding-left: 1.5rem;
  font-size: 0.875rem;
  color: var(--text-dim-color);
}

.username-requirements li {
  margin-bottom: 0.25rem;
}

.dialog-buttons {
  text-align: center;
}

.confirm-btn {
  background: var(--link-color);
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.2s;
}

.confirm-btn:hover:not(:disabled) {
  background: var(--link-hover-color);
}

.confirm-btn:disabled {
  background: #666;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Login Dropdown Styles */
.login-dropdown {
  position: relative;
  display: inline-block;
}

div button.login-btn {
  background: none;
  height: var(--site-header-height);
  border: none;
  color: var(--text-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  transition: background-color 0.2s;
}

.login-btn:hover {
  background-color: var(--bg-color-hover, rgba(255, 255, 255, 0.1));
}

.login-icon {
  font-size: 1.1rem;
}

.login-text {
  font-weight: 500;
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.login-dropdown.open .dropdown-arrow {
  transform: rotate(180deg);
}

.login-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
}

.login-dropdown.open .login-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.login-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: var(--text-color);
  text-decoration: none;
  transition: background-color 0.2s;
}

.login-option:hover {
  background-color: var(--bg-color-hover, rgba(255, 255, 255, 0.1));
}

.login-option:first-child {
  border-radius: 6px 6px 0 0;
}

.login-option:last-child {
  border-radius: 0 0 6px 6px;
}

.provider-icon {
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  font-weight: bold;
  font-size: 0.9rem;
  overflow: hidden;
}

.provider-icon svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

.login-option:hover .provider-icon svg {
  transform: scale(1.05);
}

.lichess-icon, .lishogi-icon {
  color: var(--font-color);
}

.lichess-icon svg, .lishogi-icon svg {
  fill: #fff;
}

.google-icon {
  background: #fff;
  padding: 2px;
  border: 1px solid #dadce0;
}

.google-icon svg {
  width: calc(100% - 4px);
  height: calc(100% - 4px);
}

.discord-icon {
  background: #5865f2;
  color: #fff;
}

.discord-icon svg {
  fill: #fff;
}

.microsoft-icon {
  background: #fff;
  padding: 2px;
  border: 1px solid #8c8c8c;
}

.microsoft-icon svg {
  width: calc(100% - 4px);
  height: calc(100% - 4px);
}


.facebook-icon {
  background: #1877f2;
  color: #fff;
}

.facebook-icon svg {
  fill: #fff;
}

.provider-name {
  font-weight: 500;
  flex: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .login-text {
    display: none;
  }

  .login-dropdown-menu {
    right: -10px;
    min-width: 160px;
  }
}
