@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500&display=swap");

* {
  font-family: "Poppins", sans-serif;
}
body {
  background-image: radial-gradient(
    circle,
    #9767b7,
    #9764ba,
    #9861bc,
    #985dbf,
    #985ac1,
    #9655c1,
    #9450c2,
    #924bc2,
    #8e42c1,
    #8939bf,
    #852fbe,
    #8023bc
  );
  display: grid;
  min-height: 100vh;
  place-content: center;
}

#app {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

#table-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  min-height: 120px;
  max-width: calc(100vw - 80px);
}

.nexus-title {
  background-image: linear-gradient(
    to right top,
    #ffffff,
    #f7f7f9,
    #eeeff3,
    #e5e7ed,
    #dbe0e7,
    #d3dae2,
    #cad3de,
    #c2cdd9,
    #bbc5d5,
    #b5bcd1,
    #b1b3cc,
    #afaac6
  );
  color: transparent;
  background-clip: text;
}

.app-title {
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-title img {
  width: 40px;
}

dice-object {
  aspect-ratio: 1;
  color: #fff;
  display: grid;
  font-size: 40px;
  font-weight: bold;
  place-content: center;
  position: relative;
  text-shadow: 0 0 16px #1d2842;
  user-select: none;
  width: 120px;
}

dice-object svg {
  fill: none;
  position: absolute;
  width: 100%;
  z-index: -1;
}

dice-object[sides="20"] svg,
dice-object[sides="8"] svg,
dice-object[sides="6"] svg {
  left: 8px;
}

dice-object[sides="100"] svg {
  left: 2px;
}

dice-object[sides="3"] svg {
  left: 1px;
}

dice-object[sides="12"] svg {
  left: 4px;
}

#controls {
  display: flex;
  gap: 16px;
  animation: entry ease-in-out 0.7s;
}

dice-icon {
  align-items: center;

  display: flex;
  flex-direction: column;
}

dice-icon button {
  appearance: none;
  aspect-ratio: 1;
  background-color: #171e2b;
  border: none;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  user-select: none;
  width: 24px;
  transition: all ease-in-out 0.3s;

  &[disabled] {
    background-color: transparent;
    border: 1px solid #171e2b;
    color: #171e2b;
    outline: none;
    pointer-events: none;
  }
}

dice-icon button:hover {
  outline: 1px solid #fff;
  transform: scale(1.1);
}

.increment {
  order: 0;
}

.decrement {
  order: 2;
}

.icon {
  aspect-ratio: 1;
  color: #fff;
  font-weight: bold;
  display: grid;
  padding: 8px 0;
  place-content: center;
  position: relative;
  user-select: none;
  width: 40px;
}

svg {
  position: absolute;
  top: 8px;
  width: 40px;
  z-index: -1;
}

&[sides="20"] svg,
&[sides="8"] svg,
&[sides="6"] svg {
  left: 2px;
}

&[sides="12"] svg {
  left: 1px;
}

&[sides="4"] {
  .icon {
    padding-bottom: 7px;
    padding-top: 9px;
  }

  svg {
    top: 9px;
  }
}

#roll,
#clear {
  appearance: none;
  background-color: #8023bc;
  color: #ccc;
  border: none;
  min-width: 100px;
  letter-spacing: 1px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 20px;
  font-weight: bold;
  padding: 12px;
  user-select: none;
  transition: all ease-in-out 0.3s;
  animation: entry ease-in-out 0.7s;

  &[disabled] {
    background-color: #7d4f9c;
    color: #9e9d9d;
    outline: none;
    pointer-events: none;
  }
}

.roll-and-clear-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

#clear:hover,
#roll:hover {
  outline: 1px solid #f9f9f9;
  background-color: #3f0566;
}

dice-object[sides="10"] .value {
  padding-left: 2.5rem;
}

dice-object[sides="10"] {
  right: 1rem;
}

dice-object[sides="4"] .value {
  padding-left: 3rem;
}

dice-object[sides="4"] {
  right: 1rem;
}

input {
  -moz-appearance: textfield;
  appearance: textfield;
  -webkit-appearance: none;
  border: none;
  outline: none;
  border-radius: 12px;
  font-weight: bold;
  font-size: 16px;
  padding: 12px;
  margin: 0;
  text-align: center;
  width: 50px;
  height: 30px;
  background-color: #7d4f9c;
  color: #ccc;
  transition: all ease-in-out 0.3s;
  animation: entry ease-in-out 0.9s;
}

input::placeholder {
  color: #9e9d9d;
}

input::-webkit-inner-spin-button,
input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  appearance: none;
  margin: 0;
}

input:focus::placeholder {
  color: transparent;
}

@keyframes entry {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

#results {
  color: #f9f9f9;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 16px;
}
