:root {
  --main-color: #4866de;
  --second-color: #d1e0f7;
  --dark-color: #2b2c3f;
  --light-color: white;
}

html {
  scrollbar-color: var(--main-color) var(--light-color);
  background: linear-gradient(#e7ebf5, #e1e3f0);
  min-height: 100%;
  min-width: 100%;
}

body {
  margin: 0;
  width: 100%;
  font-family: "Poppins", sans-serif;
}

h1 {
  color: var(--main-color);
  font-weight: 700;
  font-size: 40px;
  text-align: center;
  -webkit-text-stroke: 1.5px var(--dark-color);
  text-shadow: 2px 2px 0px var(--dark-color);
  letter-spacing: 1px;
}

.buttons-container {
  display: flex;
  text-align: center;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
}

.button-container {
  display: grid;
  font-size: 12px;
  justify-items: center;
  align-content: center;
  width: 115px;
  height: 100px;
  background: var(--light-color);
  border-radius: 20px;
  box-shadow: 0 2px 6px #00000033;
  cursor: pointer;
  position: relative;
  font-weight: bold;
  letter-spacing: 0.4px;
  transition: background-color 0.3s ease;
}

.button-container:hover {
  transform: translateY(-1px);
  background: var(--second-color);
}

.button-container:active {
  transform: translateY(2px);
  box-shadow: inset 0 0 2px #504c4c2e;
}

.button-icon {
  width: 40px;
  margin-bottom: 25px;
}

.button-text {
  position: absolute;
  margin-top: 65px;
}

.button-container.selected {
  background: #8aa0f7;
}

.button-container.selected:hover {
  transform: none;
  cursor: default;
}

#Achromatopsia {
  color: var(--dark-color);
  fill: var(--dark-color);
}

#Deuteranopia {
  color: #1e7706;
  fill: #1e7706;
}

#Protanopia {
  color: #d90c0c;
  fill: #d90c0c;
}

#Tritanopia {
  color: #0404b9;
  fill: #0404b9;
}

#Astigmatism .button-icon {
  filter: blur(0.5px) drop-shadow(3px 0px 1px #00000080);
  transform: skewX(3deg);
}

.icon {
  position: absolute;
  top: 20%;
}

#Hyperopia .icon.normal {
  clip-path: inset(0 0 50% 0);
}

#Hyperopia .icon.blurred {
  filter: blur(2px);
  clip-path: inset(45% 0 0 0);
  border-radius: 5px;
}

#Myopia .icon.normal {
  clip-path: inset(50% 0 0 0);
}

#Myopia .icon.blurred {
  filter: blur(2px);
  clip-path: inset(0 0 40% 0);
  border-radius: 5px;
}

.upload-container {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 50px;
  padding: 10px 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  width: 700px;
  background: var(--light-color);
  margin: 40px auto 30px auto;
}

.upload-icon {
  width: 20px;
  margin-right: 15px;
  fill: var(--dark-color);
}

.upload-input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 100%;
  width: 100%;
  margin-left: -20px;
}

.upload-placeholder {
  font-size: 16px;
  color: var(--dark-color);
  user-select: none;
  pointer-events: none;
}

.notice {
  display: flex;
  justify-content: center;
  margin: -20px 0 30px 0;
  font-size: 12px;
}

.image-container {
  position: relative;
  display: grid;
  background: var(--light-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  padding: 20px 40px 40px 40px;
  width: fit-content;
  justify-content: center;
  align-content: center;
  margin: auto;
  border-radius: 20px;
}

.flex-container {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-weight: bold;
}

.comparison-wrapper {
  position: relative;
  width: 900px;
  height: 600px;
  overflow: hidden;
}

.image-layer {
  position: absolute;
  inset: 0;
}

.image-layer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.image-layer.normal {
  z-index: 1;
}

.image-layer.filtered {
  z-index: 2;
  pointer-events: none;
  filter: url(#cat);
  clip-path: inset(0 50% 0 0);
}

.slider {
  position: absolute;
  top: -2px;
  left: -2px;
  width: 100%;
  height: 600px;
  appearance: none;
  background: transparent;
  pointer-events: auto;
  cursor: ew-resize;
  z-index: 100;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 7px;
  height: 600px;
  background: var(--main-color);
  border: 2px solid var(--light-color);
}

.slider::-moz-range-thumb {
  width: 7px;
  height: 600px;
  background: var(--main-color);
  border: 2px solid var(--light-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-track {
  background: transparent;
  border: none;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  color: var(--main-color);
  border-radius: 4px;
  user-select: none;
  pointer-events: none;
  -webkit-text-stroke: 1.5px var(--light-color);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 100;
}

footer {
  text-align: center;
  margin: 30px 0 15px 0;
}

@media (max-width: 768px) {
  h1 {
    font-size: 36px;
  }

  .buttons-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    justify-items: center;
    margin-top: 20px;
  }

  .button-container {
    width: 100px;
    height: 90px;
    font-size: 11px;
  }

  .upload-container {
    width: 300px;
    text-wrap: wrap;
    word-wrap: break-word;
  }

  .notice {
    text-align: center;
  }

  .image-container {
    padding: 10px 20px 20px 20px;
  }

  .comparison-wrapper {
    width: 300px;
    height: 200px;
  }

  .upload-placeholder {
    width: 260px;
  }
}
