@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+Arabic:wght@100..900&family=Nunito+Sans:ital,opsz,wdth,wght,YTLC@0,6..12,125,200..1000,540;1,6..12,125,200..1000,540&display=swap");

:root {
  --main-color: #41b774;
  --first-color: #92d34f;
  --second-color: #d3ed66;
  --third-color: #2f8986;
  --text-color: #f7ffc7;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body {
  background-color: #151515;
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100svh;
  font-family: "Nunito Sans", sans-serif;
}

input[type="range"] {
  -webkit-appearance: none; /* Remove default styling */
  appearance: none;
  width: 100%;
  height: 6px;
  background: transparent;
  cursor: pointer;
}

/* Track */
input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  background: #e0e0e050;
  border-radius: 10px;
}
/* Thumb */
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 2rem;
  background-color: #e894b3; /* custom accent color */
  border-radius: 5px;
  margin-top: -5px; /* center the thumb */
}
input[type="range"]::-moz-range-thumb {
  height: 16px;
  width: 16px;
  background-color: #4f46e5;
  border-radius: 50%;
  border: none;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
}

span,
a {
  text-decoration: none;
  display: inline-block;
}

.game-view-screen {
  position: relative;
  background-image: url(./assets/wallpaper-03.png);
  background-size: cover;
  height: 100dvh;
  width: 100dvw;
  padding: 0 3rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;

  .play-screen {
    width: 100%;
    height: 100%;

    .drawing-layout {
      width: 100%;
      height: 100%;

      > div {
        background-color: #fff;
        color: #000;
        border-radius: 5px;
      }

      .shape-preview-canvas {
        z-index: 1;
        opacity: 0.8;
        border: 1px dashed rgba(0, 0, 0, 0.2);
      }

      .draw-area {
        display: flex;
        justify-content: center;
        align-items: flex-start;
        background-color: transparent;
        background-image: url(./assets/draw-area-03.png);
        background-size: 100% 100%;
        padding-top: 2%;
        margin-top: 3rem;
        height: 100svh;
      }

      .tools-box {
        position: absolute;
        bottom: 0%;
        inset-inline: 3%;
        display: none;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        padding: 2rem;
        gap: 1rem;

        h4 {
          margin-block: 10px;
        }

        > div {
          display: flex;
          flex-direction: column;
          gap: 5px;
        }

        .ctrl-btn {
          padding: 1rem;
          font-weight: 500;
          font-size: 1.1em;
          margin-bottom: 5px;

          &.save-img {
            background-color: #5015e8;
            color: #fff;
          }
        }
        .colors-list {
          display: flex;
          justify-content: space-between;
          align-items: center;
          flex-wrap: wrap;
          list-style: none;
          padding: 0;
          margin: 0;
          gap: 10px 0;

          li:not(:last-child) {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            /* box-shadow: 0 0 5px 0 #0005; */
            border: 1px solid #e0e0e0;
            color: var(--color);

            &.active {
              border: 1px solid var(--color);
              padding: 2px;
            }

            &::after {
              content: "";
              display: inline-block;
              background-color: var(--color);
              width: 100%;
              border-radius: 50%;
              aspect-ratio: 1/1;
            }
          }

          li:last-child {
            width: 100%;

            input {
              width: 100%;
              border: none;
              outline: none;
              min-height: 35px;
            }
          }
        }
      }

      .bottom-tools-box {
        position: absolute;
        bottom: 0%;
        inset-inline: 0%;
        display: flex;
        justify-content: space-between;
        align-items: flex-end;
        background-color: #e3f2e7;
        height: calc(10vh + 2rem);

        .tools-list {
          min-width: 80%;
          height: calc(10vh + 2rem);
          display: flex;
          justify-content: flex-end;
          align-items: stretch;
          flex-direction: column;

          button[data-control].selected {
            outline: 5px solid #5015e8;
          }
        }

        .data-container {
          position: relative;

          .data-drawer {
            position: absolute;
            top: 0;
            left: 50%;
            translate: -50% -120%;
          }

          .data-drawer {
            background-color: #fff;
            box-shadow: 0 0 5px 5px #0001;
            z-index: 5;
            padding: 2rem 1rem;
            border-radius: 1rem;
          }

          .color-picker {
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            border-radius: 50px;

            img {
              width: 40px;
              aspect-ratio: 1/1;
              margin-bottom: 1rem;
            }

            /* .color-container {
              display: flex;
              justify-content: center;
              align-items: center;
              width: 40px;
              aspect-ratio: 1/1;
              border-radius: 50%;
              overflow: hidden;
            } */

            .color-input {
              width: 40px;
              height: 40px;
              border: none;
              border-radius: 50%;
              padding: 0;
              appearance: none;
              -webkit-appearance: none;
              cursor: pointer;
              overflow: hidden;

              &::-webkit-color-swatch-wrapper {
                padding: 0;
              }

              &::-webkit-color-swatch {
                border: none;
                border-radius: 50%;
              }

              &::-moz-color-swatch {
                border: none;
                border-radius: 50%;
              }
            }

            .currentColor {
              /* width: 50px; */
              border: none;
              outline: none;
              text-align: center;
              text-transform: uppercase;
              font-size: 0.7rem;
            }
          }

          .shapes-picker {
            min-width: 250px;
            padding: 2rem;

            .head {
              display: flex;
              justify-content: space-between;
              align-items: center;
              gap: 1rem;
            }

            .shapes-list {
              display: flex;
              align-items: center;
              margin-top: 1rem;

              button {
                height: auto;
                width: 100%;
                border: none;

                &.selected {
                  background-color: #5015e8;
                }
              }
            }

            img {
              width: 40px;
              aspect-ratio: 1/1;
            }
          }
        }

        .box-tools {
          padding: 1rem;
          background-color: #fece8b;
          display: flex;
          justify-content: flex-start;
          align-items: center;
          border-radius: 1.5rem;
          gap: 1.5rem;

          button:not(.no-effect) {
            border-radius: 1rem;
            background-color: #fff;
            border-inline-end: 8px solid #d17999;
          }

          & > div {
            width: 13%;

            & > button {
              width: 100%;
            }
          }

          .close-btn {
            background-color: transparent;
            color: #fff;
            font-size: 2rem;

            img {
              transition: 0.3s all ease-in-out;
            }
          }

          .btn-tool-tip {
            display: inline-block;
            position: absolute;
            top: 0;
            left: 50%;
            translate: -50% -90%;
            background-color: #5e9cbd;
            color: #fff;
            font-size: 1.2rem;
            text-transform: uppercase;
            font-weight: 700;
            width: 100%;
            padding: 0 1rem;
            height: 4rem;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            text-align: center;
            border-radius: 1rem;

            &::after {
              content: "";
              display: inline-block;
              width: 20px;
              aspect-ratio: 1/1;
              rotate: 45deg;
              position: absolute;
              bottom: 0;
              left: 50%;
              translate: -50% 50%;
              background-color: #5e9cbd;
            }
          }
        }

        .lower-tools {
          background-color: #ee97b2;

          button {
            justify-content: flex-end;

            img {
              width: 90px;
            }
          }
        }

        .upper-tools {
          transition: 0.3s all ease-in-out;

          &.hide {
            opacity: 0;
            pointer-events: none;
            translate: 0 100%;
          }
          button {
            img {
              width: 50px;
            }
          }
        }

        button {
          position: relative;
          display: inline-flex;
          justify-content: center;
          align-items: center;
          flex-direction: column;
          height: 10vh;
          width: 13%;
        }

        .sidebtn img {
          width: 100%;
          height: 100%;
          object-fit: contain;
          object-position: center;
          padding: 1.5rem;
          margin-bottom: 1rem;
        }
      }

      .controls-menu {
        position: absolute;
        inset-inline-end: 0;
        top: 1rem;
        width: 25vw;
        background-color: #fefefe;
        padding: 2rem;
        border-start-start-radius: 1rem;
        border-end-start-radius: 1rem;
        box-shadow: 0 0 5px 5px #0001;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 1rem;
        height: 80svh;
        overflow-y: auto;
        transition: 0.3s all ease-in-out;

        &.hide {
          translate: 100% 0;

          :dir(rtl) {
            translate: -100% 0;
          }
        }

        .info {
          display: flex;
          justify-content: space-between;
          align-items: center;
          gap: 10px;
        }
      }

      canvas {
        cursor: crosshair;
        width: 80%;
        height: 75%;
      }
    }
  }
}

.primary-bg {
  position: relative;
  background-color: var(--main-color);
  outline: 6px solid var(--third-color);
  border-top: 10px solid var(--second-color);
  border-left: 10px solid var(--second-color);

  > * {
    position: relative;
    z-index: 2;
    color: var(--text-color);
    font-weight: 600;
  }

  &::before {
    position: absolute;
    content: "";
    display: block;
    background-color: var(--first-color);
    height: 85%;
    width: 100%;
    top: 0%;
    left: 0;
    z-index: 1;
    border-radius: inherit;
  }
}

.action-btn-hover:hover {
  animation: pop 1s ease-in-out backwards infinite;
}

@keyframes pop {
  100%,
  0% {
    scale: 1;
    box-shadow: 0 0 10px 10px var(--second-color);
  }
  50% {
    scale: 1.1;
    box-shadow: 0 0 10px 10px var(--second-color);
  }
}
