:root {
  --right-menu-background-color: #eee;
  --right-menu-login-background-gradient: linear-gradient(0deg, #3d83b3, #76a3c1);
  --right-menu-history-background-gradient: linear-gradient(0deg, rgba(61, 131, 179, 0.5), rgba(118, 163, 193, 0.5));
}

html[data-theme="light"] {
  --right-menu-background-color: #eee;
  --right-menu-login-background-gradient: linear-gradient(0deg, #3d83b3, #76a3c1);
  --right-menu-history-background-gradient: linear-gradient(0deg, rgba(61, 131, 179, 0.5), rgba(118, 163, 193, 0.5));
}

html[data-theme="dark"] {
  --right-menu-background-color: #444;
  --right-menu-login-background-gradient: linear-gradient(0deg, #76a3c1, lightblue);
  --right-menu-history-background-gradient: linear-gradient(0deg, rgba(61, 131, 179, 0.25), rgba(118, 163, 193, 0.25));
}

#btp-tsumego-right-menu {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  top: 8vh;
  right: 0;
  bottom: 0;
  width: 50vh;
  max-width: 80vw;
  /* max-height: min(209vw, 154vh); */
  border-radius: 0 0 0 0.6vh;
  background-color: var(--right-menu-background-color);
  box-shadow: -1vh 1vh 2vh rgba(0, 0, 0, 0.4);
  z-index: 201;
}

.right-menu-animate-in {
  animation: right-menu-glidein 200ms linear forwards;
}

.right-menu-animate-out {
  animation: right-menu-glideout 200ms linear forwards;
}

@keyframes right-menu-glidein {
  from {
    right: -25vh;
    opacity: 0;
  }
  to {
    right: 0;
    opacity: 0.98;
  }
}

@keyframes right-menu-glideout {
  from {
    right: 0;
    opacity: 0.98;
  }
  to {
    right: -25vh;
    opacity: 0;
  }
}



@media (orientation: portrait) {
  #btp-tsumego-right-menu {
    max-height: 92vh;
  }
}

#btp-tsumego-right-menu-settings-content {
  position: absolute;
  top: min(27.5vh, 44vw);
  width: 50vh;
  max-width: 80vw;
  background-color: var(--right-menu-background-color);
  border-radius: 0 0 0 0.6vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  visibility: visible;
  opacity: 1;
  -webkit-transition: visibility 200ms, opacity 200ms ease-in;
  -moz-transition: visibility 200ms, opacity 200ms ease-in;
  transition: visibility 200ms, opacity 200ms ease-in;
  z-index: 220;
}

.settings-content-user {
  bottom: 0;
  justify-content: space-around;
}

.settings-content-visitor {
  bottom: 8vh;
  justify-content: center;
}

#right-menu-settings-icon-container {
  position: relative;
  width: 11vh;
  max-width: 24vw;
  height: 11vh;
  max-height: 24vw;
  margin-top: 2vh;
}

#right-menu-settings-icon {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #fbe8bf;
}

.right-menu-label-containers {
  width: 80%;
  height: min(7.6vh, 14vw);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
}

.right-menu-label-texts {
  width: 30%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: "Noto Sans",Sans-Serif;
  font-size: min(2.6vh, 4.8vw);
  line-height: min(2.6vh, 4.8vw);
  color: #555;
  opacity: 0.9;
}

.right-menu-label-selectors {
  position: relative;
  width: 58%;
  height: 100%;
  font-family: Inter, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: min(2.4vh, 4.7vw);
  line-height: min(2.4vh, 4.7vw);
  color: #111;
  padding-left: 6%;
}

#right-menu-settings-button-row {
  position: relative;
  width: 80%;
  height: min(8.6vh, 12vw);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 6vh;
  margin-top: 1vh;
}

.right-menu-setting-buttons {
  position: relative;
  width: 43%;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding-top: 0.2vh;
  font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
  font-size: min(2.5vh, 4vw);
  line-height: min(2.5vh, 4vw);
  text-align: center;
  background-image: var(--right-menu-login-background-gradient);
  border-radius: 0.6vh;
  box-shadow: 0 0 2vh rgba(0, 0, 0, 0.2);
  color: white;
  cursor: pointer;
}

#btp-tsumego-right-menu-user-image {
  position: absolute;
  top: 0;
  width: 50vh;
  max-width: 80vw;
  height: 27.5vh;
  max-height: 44vw;
  opacity: 0.93;
}

#btp-tsumego-right-menu-content-container {
  position: absolute;
  top: min(27.5vh, 44vw);
  left: 0;
  right: 0;
  bottom: 0;
}

#btp-tsumego-right-menu-rating-container {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 8vh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  background-color: var(--right-menu-background-color);
  -webkit-transition: visibility 200ms, opacity 200ms ease-in;
  -moz-transition: visibility 200ms, opacity 200ms ease-in;
  transition: visibility 200ms, opacity 200ms ease-in;
  padding-bottom: 1.6vh;
}

#btp-rating-canvas-container {
  position: relative;
  width: 90%;
  height: 22vh;
  max-height: 35.2vw;
  opacity: 0.5;
  order: 1;
}

#btp-rating-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.btp-rating-canvas-texts {
  position: absolute;
  font-family: "Noto Sans", Sans-Serif;
  font-size: min(2.14vh, 3.4vw);
  line-height: min(2.14vh, 3.4vw);
  color: rgba(100, 100, 100, 0.6);
}

#btp-rating-canvas-history-text {
  top: 6%;
  left: 1%;
}

#btp-rating-canvas-max-text {
  top: 6%;
  right: 2%;
}

#btp-rating-canvas-mid-text {
  top: 45%;
  right: 2%;
}

#btp-rating-canvas-min-text {
  bottom: 6%;
  right: 2%;
}

#btp-rating-correct-row {
  position: relative;
  width: 100%;
  height: 19vh;
  max-height: 29vw;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  order: 2;
  margin-bottom: 1.4vh;
}

#btp-rating-total-container {
  position: relative;
  width: 19vh;
  max-width: 29vw;
  height: 19vh;
  max-height: 29vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-right: min(2vh, 3.2vw);
}

.total-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 19vh;
  max-width: 29vw;
  height: 19vh;
  max-height: 29vw;
  opacity: 1;
}

#btp-rating-total-number {
  font-family: "Noto Sans",Sans-Serif;
  font-size: min(4.5vh, 6.5vw);
  line-height: min(4.5vh, 6.5vw);
  font-weight: bold;
  color: #555;
  opacity: 0.8;
}

#btp-rating-puzzles-text {
  font-family: "Noto Sans",Sans-Serif;
  font-size: min(2.3vh, 4vw);
  line-height: min(2.3vh, 4vw);
  color: #555;
  opacity: 0.6;
}

#btp-rating-percentage-container {
  position: relative;
  width: 19vh;
  max-width: 29vw;
  height: 19vh;
  max-height: 29vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.percentage-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 19vh;
  max-width: 29vw;
  height: 19vh;
  max-height: 29vw;
  transform: rotateY(-180deg) rotateZ(-90deg);
  opacity: 0.9;
}

#btp-rating-percentage-text {
  font-family: "Noto Sans",Sans-Serif;
  font-size: min(4.5vh, 6.5vw);
  line-height: min(4.5vh, 6.5vw);
  font-weight: bold;
  color: #555;
  opacity: 0.8;
}

#btp-rating-correct-text {
  font-family: "Noto Sans",Sans-Serif;
  font-size: min(2.3vh, 4vw);
  line-height: min(2.3vh, 4vw);
  color: #555;
  opacity: 0.6;
}

@media (orientation: portrait) {
  #btp-rating-total-number, #btp-rating-puzzles-text, #btp-rating-percentage-text, #btp-rating-correct-text, #btp-rating-high-low-max-text, #btp-rating-high-low-min-text, .history-list-texts{
    text-shadow: rgba(140, 140, 140, 0.16) 0 0.4vw 0;
  }
}

@media (orientation: landscape) {
  #btp-rating-total-number, #btp-rating-puzzles-text, #btp-rating-percentage-text, #btp-rating-correct-text, #btp-rating-high-low-max-text, #btp-rating-high-low-min-text, .history-list-texts{
    text-shadow: rgba(140, 140, 140, 0.16) 0 0.3vh 0;
  }
}

#btp-rating-high-low-container {
  width: 94%;
  height: 6.4vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  opacity: 0.9;
  order: 3;
}

.btp-rating-high-low-texts {
  font-family: "Noto Sans",Sans-Serif;
  font-size: min(2.3vh, 4vw);
  line-height: min(2.3vh, 4vw);
  color: #555;
  opacity: 0.6;
  white-space: nowrap;
  overflow: visible;
}

.high-low-bold {
  font-weight: bold;
}

#right-menu-history-cover-spinner-container {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  z-index: 2;
  background-color: rgba(245, 245, 245, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  -webkit-transition: visibility 100ms, opacity 100ms ease-in;
  -moz-transition: visibility 100ms, opacity 100ms ease-in;
  transition: visibility 100ms, opacity 100ms ease-in;
}

#right-menu-history-cover-spinner-icon {
  width: 10vh;
  height: 10vh;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 10vh;
  border-style: solid none solid none;
  border-color: #aaa;
  border-width: 3px;
  animation-name: history-spin;
  animation-duration: 1.5s;
  animation-iteration-count: infinite;
}

@keyframes history-spin {
  from {
    -ms-transform: rotate(0deg);
    -webkit-transform: rotate(0deg);
    transform: rotate(0deg);
  }
  to {
    -ms-transform: rotate(360deg);
    -webkit-transform: rotate(360deg);
    transform: rotate(360deg);
  }
}

#btp-tsumego-right-menu-history-container {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 8vh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-width: thin;
  overscroll-behavior: contain;
  background-color: var(--right-menu-background-color);
  -webkit-transition: visibility 200ms, opacity 200ms ease-in;
  -moz-transition: visibility 200ms, opacity 200ms ease-in;
  transition: visibility 200ms, opacity 200ms ease-in;
}

#right-menu-history-type-wrapper {
  position: relative;
  width: 55%;
  height: min(12vh, 16vw);
  margin-left: 22.5%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#right-menu-history-type-selector {
  position: relative;
  width: 100%;
  height: 66%;
  font-family: Inter, -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  font-size: min(2.4vh, 4.7vw);
  line-height: min(2.4vh, 4.7vw);
  padding-left: 8%;
}

#right-menu-history-list-container {
  position: relative;
  width: 100%;
  height: auto;
  padding-bottom: min(1vh, 1.5vw);
}

.history-list-items {
  position: relative;
  width: 100%;
  height: 19vh;
  max-height: 29vw;
  margin-top: min(0.5vh, 0.75vw);
  cursor: pointer;
  opacity: 0.9;
}

.history-list-items:hover {
  background-color: rgba(100, 120, 220, 0.06);
  opacity: 1;
}

.history-list-board-containers {
  position: absolute;
  top: 0;
  left: min(1vh, 1vw);
  width: 19vh;
  max-width: 29vw;
  height: 19vh;
  max-height: 29vw;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.history-list-info-containers {
  position: absolute;
  top: min(3vh, 4.5vw);
  left: min(21.5vh, 32.25vw);
  right: min(2vh, 3vw);
  bottom: min(2vh, 3vw);
  height: 12vh;
  max-height: 18vw;
}

.history-list-texts {
  font-family: "Noto Sans",Sans-Serif;
  font-size: min(2.3vh, 4vw);
  line-height: min(2.3vh, 4vw);
  color: #555;
  opacity: 0.9;
}

.history-list-titles {
  position: absolute;
  top: 0;
  left: 0;
  font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
  font-size: min(2.4vh, 4.2vw);
  line-height: min(2.4vh, 4.2vw);
  font-weight: bold;
}

.history-list-ratings {
  position: absolute;
  top: min(2.7vh, 4.8vw);
  left: 0;
  opacity: 0.7;
}

.history-list-types {
  position: absolute;
  top: min(5.2vh, 9.2vw);
  left: 0;
  opacity: 0.7;
}

.history-list-diff-containers {
  position: absolute;
  bottom: 0;
  right: 0;
  width: auto;
  height: auto;
  opacity: 0.7;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
}

.history-list-player-ratings-red {
  color: rgba(200, 0, 0, 0.8);
}

.history-list-player-ratings-black {
  color: #000000;
}

.history-list-player-ratings-green {
  color: green;
}

.history-list-player-ratings {
  margin-left: min(0.5vh, 0.75vw);
}

#btp-tsumego-history-load-button {
  position: relative;
  width: 40%;
  height: min(8vh, 12vw);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding-top: 0.2vh;
  margin-left: 30%;
  font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
  font-size: min(2.5vh, 4vw);
  line-height: min(2.5vh, 4vw);
  text-align: center;
  background-image: var(--right-menu-login-background-gradient);
  border-radius: 0.6vh;
  box-shadow: 0 0 2vh rgba(0, 0, 0, 0.2);
  color: white;
  cursor: pointer;
  margin-top: 1.4vh;
  margin-bottom: 4.4vh;
}


#btp-tsumego-right-menu-statistics-container {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 8vh;
  width: 100%;
  overflow-y: scroll;
  padding-top: 1.4vh;
  padding-bottom: 1.4vh;
  -webkit-transition: visibility 200ms, opacity 200ms ease-in;
  -moz-transition: visibility 200ms, opacity 200ms ease-in;
  transition: visibility 200ms, opacity 200ms ease-in;
}

.right-menu-statistics-row-even {
  position: relative;
  width: 86%;
  margin-left: 7%;
  height: min(3.55vh, 6vw);
  color: #555;
}

.right-menu-statistics-row-odd {
  position: relative;
  width: 86%;
  margin-left: 7%;
  height: min(3.55vh, 6vw);
  background-color: rgba(0, 0, 0, 0.08);
  border-radius: 1.2vh;
  color: #000;
}

.right-menu-statistics-label {
  position: absolute;
  top: 0;
  left: 0;
  width: auto;
  max-width: 30%;
  padding-left: 4%;
  height: 100%;
  font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
  text-shadow: rgba(40, 40, 40, 0.1) 0 0.1vh 0;
  font-size: min(2.14vh, 3.4vw);
  line-height: min(2.14vh, 3.4vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.right-menu-statistics-column {
  position: absolute;
  top: 5%;
  right: 2%;
  width: 62%;
  height: 90%;
  opacity: 1;
}

#btp-tsumego-right-menu-login-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 8vh;
}

/*
.right-menu-login-logged-out {
  top: 8vh;
  left: 25%;
}

.right-menu-login-logged-in {
  bottom: 0;
  left: 0;
}
*/

#btp-tsumego-right-menu-login-button {
  position: absolute;
  width: 100%;
  left: 0;
  top: 0;
  bottom: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding-top: 0.2vh;
  font-family: "Trebuchet MS", geneva, helvetica, arial, tahoma, verdana, sans-serif;
  font-size: min(2.5vh, 4vw);
  line-height: min(2.5vh, 4vw);
  text-align: center;
  background-image: var(--right-menu-login-background-gradient);
  border-radius: 0.6vh;
  box-shadow: 0 0 2vh rgba(0, 0, 0, 0.2);
  color: white;
  cursor: pointer;
  z-index: 202;
}

