@import "icons.css";

[class^="icon-"],
[class*=" icon-"] {
  font-size: 1.2rem;
  display: block;
}

@font-face {
  font-family: "NotoSans Regular";
  src: url("fonts/NotoSans-Regular.ttf") format("truetype");
}
@font-face {
  font-family: "NotoSans SemiBold";
  src: url("fonts/NotoSans-SemiBold.ttf") format("truetype");
}
@font-face {
  font-family: "Lato";
  src: url("fonts/Lato-Regular.ttf") format("truetype");
}

:root {
  --bg-background: #fff;
  --black: #2b2b2b;
  --primary-color: #22577a;
  --light-gray: #edf2f4;
  --white: #fff;
  --font-regular: "NotoSans Regular", "Lato", sans-serif;
  --font-semibold: "NotoSans SemiBold", "Lato", sans-serif;

  --box-shadow:
    0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);

  --br-sm: 6px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font: inherit;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 16px;
  font-family: var(--font-regular);
  overflow-x: hidden;
  background-color: var(--bg-background);
  overscroll-behavior: none;
}

a {
  text-decoration: underline;
  color: var(--white);
}

strong {
  font-family: var(--font-semibold);
  font-size: inherit;
  display: inline-block;
}
b {
  font-weight: var(--font-semibold);
}
span {
  font-size: inherit;
}

.overlay {
  display: block; /* Hidden by default */
  position: fixed; /* Stay in place */
  z-index: 1000; /* Sit on top */
  left: 0;
  top: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  overflow: auto; /* Enable scroll if needed */
  background-color: rgb(255, 255, 255); /* Fallback color */
  background-color: rgba(0, 0, 0, 0.5); /* Black w/ opacity */
}

.container {
  max-width: 1280px;
  margin: auto;
  height: 100%;
  padding: 0 15px;
}
header .container,
footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 15px;
}
footer {
  margin-top: auto;
}
header,
footer {
  background-color: var(--primary-color);
  color: #fff;
  padding: 10px 0;
}
.footer-top {
  border-bottom: 1px solid var(--white);
}

header .title {
  font-size: 1.5rem;
  font-family: var(--font-semibold);
}

.world {
  overflow: hidden;
  position: relative;
  user-select: none;
  pointer-events: none;
  margin-top: -50px;
}
.world * {
  user-select: none;
}

.score {
  position: absolute;
  right: 25px;
  top: 25px;
}

.start-screen {
  position: absolute;
  top: 300px;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.3rem;
  text-align: center;
  background: var(--light-gray);
  border-radius: var(--br-sm);
  z-index: 3;
  padding: 15px;
}

.hide {
  display: none !important;
}

.ground {
  --left: 0;
  position: absolute;
  width: 300%;
  bottom: 0;
  left: calc(var(--left) * 1%);
}

.dino {
  --bottom: 0;
  position: absolute;
  left: 1%;
  height: 30%;
  bottom: calc(var(--bottom) * 1%);
}

.cactus {
  position: absolute;
  left: calc(var(--left) * 1%);
  height: 30%;
  bottom: 0;
  width: 5vmin;
}

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  outline: 0;
  color: #fff;
  border: 2px solid #fff;
  padding: 15px 30px;
  font-size: 1.1rem;
  min-width: 170px;
  border-radius: var(--br-sm);
  cursor: pointer;
  background-color: transparent;
  text-decoration: none;
}
.btn:hover {
  background-color: #fff;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}
.cta-btn {
  padding: 14px;
  text-align: center;
}

.jump-btn {
  margin: 40px auto;
  background-color: var(--primary-color);
  border: 2px solid var(--primary-color);
  min-width: inherit;
}

.ranking {
  position: absolute;
  top: 110px;
  right: 5px;
  min-width: 260px;
  min-height: 90px;
  max-width: 380px;
  background: var(--white);
  color: var(--black);
  box-shadow: var(--box-shadow);
  padding: 0 15px;
  text-align: left;
  border-radius: 6px;
  z-index: 5;
}
.ranking .title {
  margin-top: 15px;
  font-size: 1.1rem;
  font-family: var(--font-semibold);
}
.ranking .close {
  position: absolute;
  top: -5px;
  right: 10px;
  font-size: 2rem;
  cursor: pointer;
}

.ranking table {
  width: 100%;
  margin-top: 10px;
}

.ranking table thead {
  font-family: var(--font-semibold);
  background-color: var(--primary-color);
  color: #fff;
  border: none;
}

.ranking table td {
  padding: 0 5px;
}

.ranking table .right {
  text-align: right;
}

.message-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  background: var(--primary-color);
  color: #fff;
  padding: 50px;
  font-size: 1.5rem;
  border-radius: 6px;
  z-index: 4;
  text-align: center;
}

.message-box h3 {
  font-size: 2rem;
  font-family: var(--font-semibold);
  margin-bottom: 15px;
}

.choose-box {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  flex-wrap: wrap;
  gap: 10px;
  margin: 25px 0 50px 0;
}

.insert-ranking {
  text-align: left;
}

.insert-ranking input {
  outline: 0;
  border: none;
  background: transparent;
  border-bottom: 2px solid var(--white);
  color: var(--white);
  font-size: 1.2rem;
  margin: 10px 0;
  padding: 8px;
  width: 100%;
}

.submit-btn {
  margin: 15px 0 0 auto;
}

.toggle-switch .toggle-switch-slider {
  max-width: 350px;
  margin: 25px 15px 25px 0;
  min-height: 100px;
}

.toggle-switch .switches-container {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--primary-color);
  min-height: 3rem;
  border-radius: 24px;
  margin: 0 auto;
}

.toggle-switch .switches-container input {
  visibility: hidden;
  position: absolute;
  top: 0;
}

.toggle-switch .switches-container label {
  width: 50%;
  padding: 10px;
  margin: 0;
  text-align: center;
  cursor: pointer;
  color: #fff;
  z-index: 1;
  transition: 0.25s;
}

.toggle-switch .switches-container input:checked + label {
  color: var(--primary-color);
  cursor: default;
}

.toggle-switch .switch-wrapper {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  padding: 2px;
  transition: transform 0.25s cubic-bezier(0.77, 0, 0.175, 1);
}

.toggle-switch .switch {
  border-radius: 22px;
  background: #fff;
  height: 100%;
  width: 100%;
}

.toggle-switch
  .switches-container
  input:nth-of-type(1):checked
  ~ .switch-wrapper {
  transform: translateX(0);
}

.toggle-switch
  .switches-container
  input:nth-of-type(2):checked
  ~ .switch-wrapper {
  transform: translateX(100%);
}

@media screen and (max-width: 600px) {
  .world {
    margin-top: 30px;
  }
  .start-screen {
    font-size: 1rem;
    width: 100%;
  }
  .message-box {
    font-size: 1rem;
    top: 40%;
    padding: 25px;
  }
  footer .container {
    flex-direction: column;
  }
}
