:root {
  --yellow: #f9f871;
  --green: #22cc9c;
  --blue: #3a83b6;
  --red: #d66ca3;
  --dark-blue: #004d7c;
  --dark-blue-tint: #016596;
  --bg: #a4e3ff;

  --dark-mode-charcoal: #202124;
  --dark-mode-bg: #000000;

  --opeasea-dark-sea: #1868b7;
  --opeasea-sea-blue: #2081e2;
  --opeasea-marina-blue: #e2e6ef;
  --opeasea-aqua: #2bcde4;

  --header-width: 130px;
  --header-height: 80px;
  --footer-height: 220px;
  --buppy-img-padding: 1rem;

  font-family: "Press Start 2P", cursive;
  font-size: 12px;
}

*,
*:before,
*:after {
  box-sizing: border-box;
}

::-webkit-scrollbar {
  width: 12px;
}

::-webkit-scrollbar-track {
  background-color: #e4e4e4;
  border-radius: 100px;
}

::-webkit-scrollbar-thumb {
  background-color: #333333;
  border-radius: 100px;
}

body {
  margin: 0;
  padding: 0;

  overflow: hidden;

  user-select: none;
  background-image: url("../img/ramen_game_bg.png");
  background-repeat: repeat;
  background-position: 10px 100px;
  background-attachment: fixed;
  background-color: var(--bg);

  scrollbar-width: auto;
  scrollbar-color: #222222 #e4e4e4;
  scrollbar-gutter: stable;

  height: 100vh; /* Fallback for browsers that do not support Custom Properties */
  height: calc(var(--vh, 1vh) * 100);
}

.switch {
  position: relative;
  display: inline-block;
  width: 55px;
  height: 28px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #999;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  -webkit-transition: 0.4s;
  transition: 0.4s;
}

.switch input:checked + .slider {
  background-color: var(--green);
}

.switch input:focus + .slider {
  box-shadow: 0 0 1px var(--green);
}

.switch input:checked + .slider:before {
  -webkit-transform: translateX(26px);
  -ms-transform: translateX(26px);
  transform: translateX(26px);
}

.flex-container {
  display: flex;
  justify-content: flex-start;
  flex-direction: column;
  align-items: center;
}

.flex-container > .flex-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

header {
  background-color: var(--blue);
  padding: 0.5rem 2rem;

  flex-wrap: nowrap;
  font-size: 1rem;
  height: var(--header-height);
}

.header-left {
  display: flex;
  justify-content: flex-start;

  align-items: center;
  text-align: center;

  flex: 0 0 var(--header-width);
  color: #ffffff;
  z-index: 100;
}

.header-left > a {
  font-size: 2em;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-right: 0.2em;
}

.header-left > a:hover {
  cursor: pointer;
  color: var(--yellow);
}

.header-left > a:last-of-type {
  margin-right: 0;
}

.about {
  margin-right: 5px;
}

.title {
  font-size: 1.5em;
  text-transform: uppercase;
  font-weight: 700;
  text-align: center;
  color: var(--yellow);
  line-height: 1;
  flex: 1 1 280px;
}

.fullTitle {
  white-space: nowrap;
}

.subTitle {
  text-align: center;
  font-size: 0.65em;
  color: #ffffff;
  white-space: nowrap;
}

.header-right {
  display: flex;
  flex-wrap: wrap;
  flex: 0 0 var(--header-width);
  justify-content: flex-end;
  align-items: flex-end;

  font-size: 1.2em;
  color: var(--yellow);
  /* flex-direction: column; */
}

.header-right > div {
  display: flex;
  flex: 1 1 var(--header-width);
  justify-content: center;
  line-height: 1em;
  padding: 0.5em 1em 0.3em;
  text-align: center;
}

.container {
  width: 100%;
  max-width: 800px;
  /* max-height: 700px; */
  margin: auto;
}

#ticket {
  background-color: #ffffff;
  color: var(--blue);
}

#ticket.lastTicket {
  background-color: var(--red);
  color: #ffffff;
}

main {
  flex: 8 1 250px;
}

#buppy {
  padding: var(--buppy-img-padding) 0;
  /* display: flex;
  align-items: center;
  justify-content: center; */
  position: relative;
  height: 100%;
}

#buppy img {
  max-width: 100%;
  height: auto;
  max-height: calc(
    100vh - var(--footer-height) - var(--header-height) -
      var(--buppy-img-padding) * 2
  );

  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 1;
  /* 
  -webkit-transition: 0.4s;
  transition: 0.4s; */
}

/* #buppy img[style*="display: none"] {
  opacity: 0;
} */

.eyes {
  z-index: 40;
  display: none;
}

.layer1 {
  z-index: 30;
}

.layer2 {
  z-index: 35;
}

#bodyTable {
  z-index: 20;
}

#buppyBg {
  z-index: 10;
}

footer {
  height: var(--footer-height);
  background-color: var(--blue);

  display: flex;
  justify-content: center;
  align-items: center;
}

.btn {
  color: #333333;
  background-color: #ffffff;
  /* border: 2px solid #ffffff; */
  border-radius: 10em;
  padding: 0.8em 1.5em;
  cursor: pointer;
  font-size: 0.8em;
  box-shadow: #999999 4px 4px 0 0;
}

.btn:hover {
  /* border: 2px solid #222222; */
  background-color: #dddddd;
  /* color: #ffffff; */
}

.btn:active {
  box-shadow: #999999 2px 2px 0 0;
  transform: translate(2px, 2px);
}

.btn img {
  width: 1.2rem;
}

.btn.opensea {
  background-color: var(--opeasea-dark-sea);
  border: 3px solid #ffffff;
  color: #ffffff;
}

.btn.opensea:hover {
  background-color: var(--opeasea-aqua);
}

#board .won {
  background-color: var(--green);
  padding: 5px 5px 5px 12px;
  text-shadow: 3px 4px 0px rgba(0, 0, 0, 0.6);
}

#board .lost {
  background-color: var(--red);
  padding: 5px 5px 5px 12px;
  text-shadow: 3px 4px 0px rgba(0, 0, 0, 0.6);
}

#board {
  font-size: 1.5em;
  color: #ffffff;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  text-align: center;
  padding: 0;
  margin: 0 5rem;
  line-height: 1.2em;
}

#keyboard {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;

  padding: 1rem;
  text-transform: uppercase;
  text-align: center;
  color: #ffffff;
}

.letter {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: 2px solid #ffffff;
  color: var(--blue);
  border-radius: 0.5em;
  width: 2em;
  height: 2em;
  margin: 0.3em;
  cursor: pointer;
  font-size: 1em;
  padding: 3px 0 0 3px;
}

.letter:not(.hit):not(.not-hit):hover {
  border: 2px solid var(--yellow);
  color: var(--yellow);
  background-color: #555555;
  box-shadow: 0px 0px 12px 0px #999999;
}

.letter.hit {
  border: 2px solid var(--green);
  background-color: var(--green);
  cursor: default;
}

.letter.not-hit {
  background-color: var(--red);
  border: 2px solid var(--red);
  cursor: default;
}

/* Shaking Animation */

.shake {
  /* transform: scale(5); */
  /* Start the shake animation and make the animation last for 0.5 seconds */
  animation: shake 0.5s;

  /* When the animation is finished, start again */
  animation-iteration-count: infinite;
}

/* Nav */

nav {
  z-index: 800;
  transition: all 0.8s;
  visibility: hidden;
  opacity: 0;
}

nav > .menu-body {
  font-size: 1rem;
  /* letter-spacing: -1px; */
  position: absolute;
  top: 0;
  left: -250px;
  width: 250px;
  max-width: 100%;
  height: 100%;
  background-color: var(--dark-blue);
  z-index: 888;
  /* transform: translate(-50%, -50%); */
  /* pointer-events: none; */

  box-shadow: rgba(22, 22, 22, 0.48) 6px 2px 16px 0px,
    rgba(0, 0, 0, 0.8) -6px -2px 16px 0px;
  transition: opacity 0.8s, left 0.8s;
  overflow-y: auto;
}

nav.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

nav.active > .menu-body {
  left: 0;
}

nav .menu-title {
  color: var(--yellow);
  padding: 3rem 2rem 1rem;
  border-bottom: 1px solid var(--yellow);
  text-transform: uppercase;
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

nav li {
  position: relative;
}

nav li > a {
  margin: 0;
  list-style: none;
  display: block;
  padding: 1.2em 2em;
  color: #ffffff;
  text-decoration: none;
}

nav li label.switch {
  position: absolute;
  right: 0.6em;
  top: 0.8em;
  pointer-events: none;
}

nav li a i {
  font-size: 1.4em;
  margin-left: -0.2em;
  margin-right: -0.3em;
}

nav li a img {
  width: 1.4em;
  margin-left: -0.15em;
  margin-right: -0.15em;
}

nav li:hover {
  background-color: var(--dark-blue-tint);
}

nav .overlay {
  z-index: 887;
}

#darkmodeSwitch {
  cursor: pointer;
}

.menu-close {
  color: var(--yellow);
  cursor: pointer;
  font-size: 80%;
  position: absolute;
  right: 2rem;
  text-align: center;
  top: 3rem;
  /* width: 70px; */
  text-decoration: none;
}

.menu-close:hover {
  color: var(--dark-blue-tint);
}

.example.flex {
  display: flex;
}

.example.flex.flex-wrap {
  flex-wrap: wrap;
  gap: 12px;
}

.example {
  pointer-events: none;
}

.example .won {
  background-color: var(--green);
  padding: 5px 5px 5px 12px;
  text-shadow: 3px 4px 0px rgba(0, 0, 0, 0.6);

  font-size: 1.5em;
  color: #ffffff;
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  text-align: center;

  line-height: 1.2em;
}

.example .lost {
  background-color: var(--red);
  padding: 5px 5px 5px 12px;
  text-shadow: 3px 4px 0px rgba(0, 0, 0, 0.6);

  font-size: 1.5em;
  color: #ffffff;
  letter-spacing: 0.4rem;
  text-transform: uppercase;
  text-align: center;

  line-height: 1.2em;
}

.nowrap {
  white-space: nowrap;
}

/* Modal */

.overlay {
  position: fixed;
  background-color: rgba(0, 0, 0, 0.7);
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.modal-window .overlay {
  z-index: 998;
}

.modal-window {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  z-index: 999;
  transition: all 0.3s;
}

.modal-window.active {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.modal-window > .modal-body {
  width: 50vw;
  max-width: 500px;
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 2em;
  background: var(--dark-blue-tint);
  overflow-y: auto;
  max-height: 80%;
  z-index: 1000;
  transition: all 0.3s;
}

.modal-window.active > .modal-body {
  top: 50%;
}

.modal-window header {
  font-weight: bold;
}
.modal-window h1 {
  font-size: 1.2rem;
  margin: 0 0 15px;
  padding-top: 0;
  color: var(--yellow);
}

.modal-close {
  color: #ffffff;
  line-height: 50px;
  font-size: 80%;
  position: absolute;
  right: 0;
  text-align: center;
  top: 0;
  width: 70px;
  text-decoration: none;
  cursor: pointer;
}
.modal-close:hover {
  color: #aaaaaa;
}

/* .modal-window div:not(:last-of-type) {
  margin-bottom: 15px;
} */

.modal-content {
  line-height: 2rem;
  color: #ffffff;
  font-size: 1.2rem;
}

.modal-content p {
  font-family: "Poppins", sans-serif;
  font-size: 1.1em;
  letter-spacing: 0.01em;
  user-select: text;
}

.modal-content .label {
  font-family: "Poppins", sans-serif;
  font-size: 0.8em;
  letter-spacing: 0.01em;
  user-select: text;
  text-align: center;
}

.modal-content p .icon {
  width: 1.1em;
}

.modal-content p a,
.modal-content p a:active,
.modal-content p a:visited,
.modal-content p a:focus {
  color: #ffffff;
  text-decoration: underline;
  font-weight: 600;
}

.modal-content p a:hover {
  color: var(--yellow);
}

.modal-content p a:active #stats {
  font-size: 1.2rem;
}

a.external-link::after {
  display: inline-block;
  text-rendering: auto;
  -webkit-font-smoothing: antialiased;
  font: var(--fa-font-solid);
  content: "\f08e";
  margin-left: 3px;
  font-size: 0.83em;
  vertical-align: super;
}

#stats .modal-body {
  padding: 2.5em 1.5em;
}

#statsData {
  display: flex;
  flex-wrap: wrap;
}

#stats.modal-window .modal-content > div {
  margin-bottom: 2em;
}

#stats.modal-window .modal-content > div:last-of-type {
  margin-bottom: 0;
}

#shareData {
  margin-bottom: 20px;
}

.modal-window div.stats-container {
  margin-bottom: 0;
}

.stats-container {
  flex: 1 1 25%;
  font-family: "Poppins", sans-serif;
  padding: 0.5em;
}

.stats-container .value {
  font-size: 2.8em;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-variant-numeric: proportional-nums;
  margin-bottom: 15px;
}

.stats-container .label {
  font-size: 0.8em;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.stats-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
}

.stats-bottom > div {
  flex: 1 1 50%;
}

.stats-bottom > div:first-of-type {
  padding-right: 1.5em;
}

.stats-bottom > div:last-of-type {
  padding-left: 1.5em;
}

.share {
  border-left: 1px solid #fff;
}

.tooltip {
  position: relative;
  /* display: inline-block; */
}

.tooltip .tooltiptext {
  visibility: hidden;
  width: 80px;
  background-color: var(--dark-blue);
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 8px 5px;
  position: absolute;
  z-index: 1;
  bottom: 150%;
  left: 50%;
  margin-left: -40px;
  opacity: 0;
  transition: opacity 0.3s;
  font-family: "Poppins", sans-serif;
  line-height: 1.2;
}

.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: var(--dark-blue) transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.buppy-img {
  display: flex;
  align-items: center;
  justify-content: center;
}

.buppy-img img {
  width: 300px;
  max-width: 100%;
  height: auto;
}

/* Dark Mode */

body.darkmode {
  background-color: var(--dark-mode-bg);
}

body.darkmode header,
body.darkmode nav > .menu-body,
body.darkmode footer {
  background-color: var(--dark-mode-charcoal);
}

body.darkmode .letter {
  background-color: var(--dark-mode-charcoal);
  color: #ffffff;
}

body.darkmode .letter.hit {
  background-color: var(--green);
}

body.darkmode .letter.not-hit {
  background-color: var(--red);
}

body.darkmode #ticket {
  background-color: #555555;
  color: #ffffff;
}

body.darkmode #ticket.lastTicket {
  background-color: var(--red);
  color: #ffffff;
}

body.darkmode .modal-window > .modal-body {
  background-color: var(--dark-mode-charcoal);
}

body.darkmode .modal-window h1 {
  color: var(--yellow);
}

body.darkmode .modal-content {
  color: #ffffff;
}

body.darkmode .modal-close {
  color: #ffffff;
}

body.darkmode .modal-close:hover {
  color: #cccccc;
}

body.darkmode .tooltip .tooltiptext {
  background-color: #555;
}

body.darkmode .tooltip .tooltiptext::after {
  border-color: #555 transparent transparent transparent;
}

@keyframes shake {
  0% {
    transform: translate(1px, 1px) rotate(0deg);
  }
  10% {
    transform: translate(-1px, -2px) rotate(-1deg);
  }
  20% {
    transform: translate(-3px, 0px) rotate(1deg);
  }
  30% {
    transform: translate(3px, 2px) rotate(0deg);
  }
  40% {
    transform: translate(1px, -1px) rotate(1deg);
  }
  50% {
    transform: translate(-1px, 2px) rotate(-1deg);
  }
  60% {
    transform: translate(-3px, 1px) rotate(0deg);
  }
  70% {
    transform: translate(3px, 1px) rotate(-1deg);
  }
  80% {
    transform: translate(-1px, -1px) rotate(1deg);
  }
  90% {
    transform: translate(1px, 2px) rotate(0deg);
  }
  100% {
    transform: translate(1px, -2px) rotate(-1deg);
  }
}

/* Responsive */

@media screen and (min-width: 1921px) {
  :root {
    --header-height: 120px;
    --footer-height: 280px;
  }
  nav > .menu-body {
    font-size: 1.5rem;
    left: -400px;
    width: 400px;
  }
  header {
    font-size: 1.3rem;
  }

  footer {
    font-size: 1.8rem;
  }
}

@media screen and (max-width: 1920px) and (min-width: 941px) {
  :root {
    --header-height: 100px;
    --footer-height: 250px;
  }
  nav > .menu-body {
    font-size: 1.2rem;
    left: -300px;
    width: 300px;
  }

  header {
    font-size: 1.2rem;
  }

  footer {
    font-size: 1.5rem;
  }
}

@media screen and (max-width: 940px) and (min-width: 521px) {
  :root {
    --buppy-img-padding: 0.8rem;
  }

  .modal-window > .modal-body {
    width: 80vw;
  }

  .header-right > div {
    flex: 1 1 50vw;
  }

  footer {
    font-size: 1.3rem;
  }
}

@media screen and (max-width: 940px) {
  header {
    font-size: 0.9rem;
    flex-wrap: wrap;
    padding-bottom: 0;
    padding: 0.5rem 1.3rem 0;
  }

  .header-left {
    margin-top: 0.2em;
  }
  .title {
    margin-left: -130px;
    margin-top: 0.2em;
  }

  .header-right {
    flex: 1 0 100vw;
    align-self: flex-end;
  }
}

@media screen and (max-width: 520px) {
  :root {
    --buppy-img-padding: 0.5rem;
  }

  header {
    font-size: 0.75rem;
    padding: 0.5rem 1.2rem 0;
  }

  .modal-window > .modal-body {
    width: 80vw;
  }

  footer {
    font-size: 1rem;
  }

  .stats-container {
    flex-basis: 50%;
  }

  .stats-bottom > div {
    flex-basis: 100%;
  }

  .stats-bottom > div:first-of-type {
    padding-right: 0;
    margin-bottom: 2em;
  }

  .stats-bottom > div:last-of-type {
    padding-left: 0;
  }

  .share {
    border-left: 0;
  }
}

@media screen and (max-width: 300px) {
  :root {
    --header-height: 60px;
  }

  header {
    font-size: 0.6rem;
    padding: 0.5rem 0.5rem 0;
  }

  .header-left {
    flex-basis: 40px;
  }

  .title {
    margin-left: -40px;
    flex-basis: 130px;
  }

  /* .header-left {
    justify-content: center;
  }

  .header-left > a {
    margin-left: 0;
  } */
}
