/* Pile stuff */

.pile {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 1rem;
  width: fit-content;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  gap: 0.5rem;
  border: 2px solid var(--text);
}

.pile-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  border-radius: 8px;
  padding: 1rem;
  gap: 0.5rem;
}

.piles {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
}

/* Getting stones to behave correctly */

.stone {
  width: 1.5rem;
  max-width: 3vw;
  aspect-ratio: 2.5;
  border-bottom-left-radius: 90%;
  border-bottom-right-radius: 90%;
  border-top-right-radius: 70%;
  border-top-left-radius: 70%;
  border: 2px solid var(--text);
  background-color: color-mix(in srgb, var(--text) 40%, transparent);
  align-self: center;
}

.stone:first-child:nth-last-child(2),
.stone:first-child:nth-last-child(2) ~ .stone:nth-child(1) {
  grid-column: 1 / span 2;
}

.stone:first-child:nth-last-child(2) ~ .stone:nth-child(2) {
  grid-column: 3 / span 2;
}

.stone:nth-child(1),
.stone:only-child {
  grid-column: 2 / span 2;
}
.stone:nth-child(2) {
  grid-column: 1 / span 2;
}
.stone:nth-child(3) {
  grid-column: 3 / span 2;
}

/* Number Selectors */

.number-selectors {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(30rem, 80%);
}
.number-selector {
  flex: 1;
  padding: 0.65rem;
  color: var(--text);
  border: 2px solid var(--text);
  border-left: 1px solid var(--text);
  border-right: 1px solid var(--text);
  margin: 0;
  background-color: transparent;
}

.number-1 {
  border-left: 2px solid var(--text);
  border-top-left-radius: 0.5rem;
  border-bottom-left-radius: 0.5rem;
}

.number-3 {
  border-right: 2px solid var(--text);
  border-top-right-radius: 0.5rem;
  border-bottom-right-radius: 0.5rem;
}

/* Dialogue Section */
.dialogue {
  width: min(30rem, 80%);
  height: 6rem;
  padding: 1.5rem 1.25rem;

  border-radius: 0.5rem;
  border: 2px solid var(--text);

  overflow-y: scroll;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.5rem;
}
.dialogue p {
  margin: 0;
}

.dialogue b {
  text-decoration: underline;
}

/* Buttons */
.take {
  background-color: var(--text);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--bg);
  border: 2px solid var(--text);
}
.reset {
  background-color: transparent;
  border: 2px solid var(--text);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  color: var(--text);
}

/* Hover and Disabled Effects */

.pile-wrapper:hover:not(.active-pile):not(.disabled),
.number-selector:hover:enabled:not(.active-number-selector),
.reset:hover:enabled {
  background-color: color-mix(in srgb, var(--text) 5%, transparent);
}
.take:hover:enabled {
  background-color: color-mix(in srgb, var(--text) 90%, transparent);
}

.active-pile,
.active-number-selector,
.reset:active {
  background-color: color-mix(in srgb, var(--text) 10%, transparent);
}
.take:hover:active {
  background-color: color-mix(in srgb, var(--text) 80%, transparent);
}

.number-selector:disabled,
.pile-wrapper.disabled,
.reset:disabled,
.take:disabled {
  opacity: 0.3;
}
