@import url("https://fonts.googleapis.com/css2?family=Cascadia+Code:ital,wght@0,200..700;1,200..700&display=swap");

:root {
  --bg: #2e3440;
  --surface: #3b4252;
  --overlay: #434c5e;
  --brightbg: #4c566a;
  --text: #d8dee9;
  --red: #bf616a;
  --orange: #d08770;
  --yellow: #ebcb8b;
  --green: #a3be8c;
  --blue: #88c0d0;
  --purple: #b48ead;

  --shadow-sm: 4px 4px 0 var(--overlay);
  --shadow-md: 4px 4px 0 var(--brightbg);
  --shadow-lg: 6px 6px 0 var(--blue);

  --shadow-hover: 6px 6px 0 var(--green);
  --shadow-active: 2px 2px 0 var(--green);
}

.middle {
  text-align: center;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#title {
  text-shadow: var(--shadow-md);
}

#main-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

body {
  background: var(--bg);
}

* {
  color: var(--text);
  font-family: "Cascadia Code", "Courier New", "Courier", monospace;
}

button {
  background: var(--surface);
  border-radius: 0;
  outline: none;
  border: none;
  cursor: pointer;
}

button {
  background: var(--surface);
  border: 2px solid var(--text);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s;
}

#grid,
#color-palette,
#tools,
#undoredo {
  box-shadow: var(--shadow-sm);
}

button:hover {
  box-shadow: var(--shadow-md);
}

button:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-active);
}

#submit.cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 15px 30px;
  font-size: 20px;
  font-weight: bold;

  color: var(--text);
  background: var(--surface);
  border: 2px solid var(--text);

  box-shadow: var(--shadow-lg);
  transition: 0.4s;
}

#submit.cta:hover {
  box-shadow: var(--shadow-hover);
  background: var(--overlay);
}

#submit.cta:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-active);
}

.cta .second {
  display: flex;
  align-items: center;
  transition: 0.5s;
}

.cta:hover .second {
  transform: translateX(-10px);
}

.one {
  transform: translateX(-60%);
  transition: 0.4s;
}

.two {
  transform: translateX(-30%);
  transition: 0.5s;
}

.cta:hover .one,
.cta:hover .two {
  transform: translateX(0);
}

.cta:hover .three {
  animation: arrowPulse 1s infinite 0.2s;
}

.cta:hover .two {
  animation: arrowPulse 1s infinite 0.4s;
}

.cta:hover .one {
  animation: arrowPulse 1s infinite 0.6s;
}

@keyframes arrowPulse {
  0% {
    fill: var(--text);
  }
  50% {
    fill: var(--green);
  }
  100% {
    fill: var(--text);
  }
}

#grid {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: repeat(16, 30px);
  gap: 0px;
  border: 2px solid var(--text);
  background: rgb(81, 81, 81);
}

#grid button {
  background: rgb(11, 11, 11);
  aspect-ratio: 1 / 1;
  box-shadow: none;
  border: none;
  cursor: inherit;
  border: 0.5px solid rgb(23, 23, 23);
}
/* 
#grid button:hover {
  background: rgb(29, 29, 29);
} */

#grid button:active {
  /* background: rgb(43, 43, 43); */
  transform: none;
}

.changed-color {
  background-color: red;
}

#color-palette {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 2px solid var(--text);
  width: 25px;
  gap: 5px;
}

#color-palette button {
  aspect-ratio: 1 / 1;
  box-shadow: none;
  border: none;
}

#color-palette button:hover {
  filter: brightness(1.5);
  filter: contrast(0.5);
}

#color-palette button:active {
  transform: none;
}

#color-palette button.selected {
  border: 2px solid white;
}

.right {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

#tools {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 2px solid var(--text);
  width: 25px;
  gap: 5px;
  height: 80%;
}

#tools button {
  aspect-ratio: 1 / 1;
}

#tools button.selected * {
  color: var(--blue);
}

#tools button.selected {
  border-color: var(--blue);
}

#undoredo {
  display: flex;
  flex-direction: column;
  padding: 10px;
  border: 2px solid var(--text);
  width: 25px;
  gap: 5px;
  height: 20%;
}

#undoredo button {
  aspect-ratio: 1 / 1;
}

/* #select-red {
  background: #ff0000;
}
#select-orange {
  background: #ff8400;
}
#select-yellow {
  background: #ffff00;
}
#select-green {
  background: #00ff00;
}
#select-blue {
  background: #0000ff;
}
#select-purple {
  background: #ff00ff;
} */

.top {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.bottom {
  align-self: stretch;
  display: flex;
}
