html {
    font-size: 22px;
    font-family: "Cantarell", sans-serif;
}

body {
    margin: 2rem auto;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 26rem;
    flex-wrap: wrap;
}

.intro {
    text-align: center;
    font-size: 16px;
    margin-bottom: 2em;
}

.grid {
    display: grid;
    width: min-content;
    grid-template-columns: repeat(9, 2rem);
    grid-template-rows: repeat(9, 2rem);
    border-left: solid 3px black;
    border-top: solid 3px black;
}

.grid .cell {
    border-right: solid 1px black;
    border-bottom: solid 1px black;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid .cell:not([contenteditable]) {
    font-weight: bold;
}

.grid .cell[contenteditable] {
    color: #555555;
}

.grid .cell.invalid {
    color: #ff0000;
}

.grid .cell.target {
    background: rgba(0, 119, 119, 0.5);
}

.grid .cell:nth-child(3n) {
    border-right: solid 3px black;
}

.grid .cell:nth-child(n+19):nth-child(-n+27),
.grid .cell:nth-child(n+46):nth-child(-n+54),
.grid .cell:nth-child(n+73):nth-child(-n+81) {
    border-bottom: solid 3px black;
}

.index {
    display: flex;
    flex-direction: column;
    width: 2rem;
    border: solid 3px black;
}

.index .cell {
    font-size: 75%;
    height: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 1em 1em 0 0;
}

.index .cell:not(:last-child) {
    border-bottom: solid 1px black;
}

.index .cell .letter {
    position: absolute;
    top: 0.2em;
    right: 0.2em;
    width: 1em;
    text-align: center;
    color: #007777;
}

.answer {
    margin-top: 3rem;
    display: flex;
}

.answer .cell {
    border: solid 1px black;
    height: 2rem;
    width: 1.5rem;
    margin: 0 0.1rem;
    background: rgba(0, 119, 119, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.answer .spacer {
    height: 2rem;
    width: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}