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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  display: grid;
  place-content: center;
  min-height: 100vh;
  overflow: hidden;
  /* Deshabilita seleccionar arrastrando el mouse */
  user-select: none;
  background: #eee;
}

main {
  background: url("./assets/iphone.webp") no-repeat;
  background-size: contain;
  width: 320px;
  height: 640px;
  display: flex;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.3));
}

section {
  background: #f6f6f6;
  width: 100%;
  border-radius: 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  overflow: hidden;
  position: relative;
  padding: 16px 6px;
  margin: 24px;
}

header {
  display: flex;
  justify-content: center;

  & img {
    width: 24px;
    height: 24px;
  }
}

.cards {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0 auto;

  & > span {
    color: #333;
    font-size: 16px;
    text-align: center;
    display: grid;
    place-content: center;
    height: 100%;
  }

  & article {
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    cursor: grab;
    overflow: hidden;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;

    &.go-left {
      transform: translateX(-200%) rotate(-30deg) !important;
    }

    &.go-right {
      transform: translateX(200%) rotate(30deg) !important;
    }

    &.go-left,
    &.go-right {
      transition: transform 0.3s ease, rotate 0.3s ease !important;
    }

    &.reset {
      transition: 0.3s ease;
      transform: translateX(0) rotate(0) !important;
    }

    & img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    & h2 {
      width: 100%;
      height: 100%;
      color: #fefefe;
      position: absolute;
      inset: 0;
      padding: 16px;
      z-index: 2;
      display: flex;
      align-items: flex-end;
      z-index: 3;
      background: linear-gradient(to top, #00000088 20%, transparent 40%);

      & span {
        margin-left: 6px;
        font-size: 18px;
        line-height: 1.6;
        font-weight: 400;
      }
    }

    &:active {
      cursor: grabbing;
    }

    & .choice {
      color: black;
      border: solid 4px;
      position: absolute;
      top: 32px;
      right: 16px;
      padding: 4px 8px;
      font-size: 24px;
      font-weight: bold;
      border-radius: 8px;
      z-index: 9;
      width: fit-content;
      text-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
      opacity: 0;
      transition: opacity 0.3s ease;

      &.nope {
        border-color: #f44336;
        color: #f44336;
        transform: rotate(30deg);
      }

      &.like {
        border-color: #63ff68;
        color: #63ff68;
        rotate: -30deg;
        left: 16px;
      }
    }
  }
}

footer {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  padding: 0 24px;
  justify-content: center;
  align-items: center;

  & button {
    background: url("./assets/tinder-icons.webp");
    background-position: 0px 0px;
    background-size: 170px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 0;
    cursor: pointer;
    transition: scale 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;

    &:hover {
      scale: 1.4;
    }

    &.is-big {
      width: 48px;
      height: 48px;
      background-size: 250px;
    }

    &.is-undo {
      background-position: -138px 0;
    }

    &.is-remove {
      background-position: -150px 1px;
    }

    &.is-star {
      background-position: -70px;
    }

    &.is-fav {
      background-position: -50px;
    }
  }
}
