*,
*::after,
*::before {
    margin: 0;
    padding: 0;
    box-sizing: content-box;
}

html,
body {
    height: 100%;
}

article {
    margin: 0 auto;
    height: 100%;
    display: flex;
    flex-direction: column;
    place-items: center;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

section {
    display: flex;
    place-items: center;
    align-items: center;
    gap: 1rem;
}

input {
    height: 100%;
    font-size: 1.5rem;
    padding: 0 0.5rem;
    border: 2px solid black;
    border-radius: 0.25rem;
    font-family: sans-serif;
}

input:disabled {
    background-color: lightgrey;
    border-color: grey;
    cursor: not-allowed;
}

button {
    height: 100%;
    font-size: 1.5rem;
    padding: 0 1rem;
    border: 2px solid black;
    border-radius: 0.25rem;
    background-color: white;
    cursor: pointer;
    font-family: sans-serif;
    font-weight: bold;
}

button:hover {
    background-color: black;
    color: white;
}

button:disabled {
    background-color: grey;
    border-color: grey;
    color: white;
    cursor: not-allowed;
}

main {
    display: flex;
    flex-direction: column;
    place-items: center;
    gap: 1rem;
}

#string,
#array {
    height: 2rem;
    border-top: 2px solid black;
    border-bottom: 2px solid black;
    border-left: 1px solid black;
    border-right: 1px solid black;
    display: flex;
    max-width: fit-content;
}

#string > div,
#array > div {
    width: 2rem;
    height: 100%;
    border-left: 1px solid black;
    border-right: 1px solid black;
    display: flex;
    position: relative;
    text-align: center;
    place-items: center;
    align-items: center;
    justify-content: center;
    font-family: sans-serif;
    font-weight: bold;
    font-size: 1.5rem;
}

aside {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-family: sans-serif;
}

.key {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.key > div {
    width: 1rem;
    height: 1rem;
    border: 2px solid black;
}

.i {
    background-color: aquamarine;
}

.comparing {
    background-color: lightcoral;
}

.mirror {
    background-color: lightgreen;
}

.c {
    background-color: mediumslateblue;
}

.r {
    background-color: mediumpurple;
}

footer {
    display: flex;
    place-items: center;
    align-items: center;
    gap: 2rem;
}

label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: sans-serif;
}

#spd {
    min-width: 5rem;
}

h1 {
    text-align: center;
    font-family: sans-serif;
}
