body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

* {
    box-sizing: border-box;
}

.game {
    position: absolute;
    top: 10px;
    right: 10px;
    bottom: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.croco {
    width: 100%;
    aspect-ratio: 1;
    background: url("krokodil.png") no-repeat center center;
    background-size: contain;
    position: relative;

    /* switch width to height when screen aspect ratio is landscape */
    @media (orientation: landscape) {
        width: auto;
        height: 100%;
    }
}

.mouth {
    display: grid;
    justify-content: center;
    gap: 2%;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    aspect-ratio: 1.1;
    position: absolute;
    top: 38%;
    left: 19%;
    right: 23%;
}

.tooth {
    background: url(tooth-white.png) no-repeat center center;
    background-size: contain;
}

.tooth--pulled {
    background-image: url(tooth-red.png);
}

.tooth--bad {
    background-image: url(tooth-black.png);
}


/* rotate teeth a bit randomly */
.tooth:nth-child(2n) {
    transform: rotate(180deg);
}

.tooth:nth-child(2n) {
    grid-column-start: 1;
}

.tooth:nth-child(2n+1) {
    grid-column-start: 6;
}

.tooth:nth-child(13) {
    grid-column-start: 2;
}

.tooth:nth-child(14) {
    grid-column-start: 3;
}

.tooth:nth-child(15) {
    grid-column-start: 4;
}

.tooth:nth-child(16) {
    grid-column-start: 5;
}

.overlay {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 2em;
    text-align: center;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

h1 {
    font-size: 4em;
    margin: 0 0 1em;
}

button {
    font-size: 1.5em;
    background-color: #006129;
    color: #fff;
    border-radius: 100em;
    padding: .5em 1em;
    border: none;
    cursor: pointer;
    box-shadow: rgba(0, 0, 0, 0.5) 0px 3px 8px;
}

#confetti {
    z-index: 100;
    position: absolute;
}
