/* The page height changes while external widgets and game content load.
   Keep the vertical scrollbar gutter stable so viewport-relative elements do
   not move when the scrollbar appears or disappears. */
html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

.title {
    font-family: 'Kaisei Opti', serif;
}

.about.title {
    cursor: pointer;
}

#levelButtons-2 > button {
    border: 3px solid #f8c7e5;
}

#levelButtons-3 > button {
    border: 3px solid #d8c9ee;
}

#type_area {
    z-index: 4;
}

#typing_area {
    position: absolute;
    caret-color: transparent;
    z-index: 5;
}

.heart-powered {
    border: none;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 20, 147, 0.5);
    animation: glow 1.5s ease-in-out infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 10px rgba(255, 20, 147, 0.5), 0 0 20px rgba(255, 20, 147, 0.4), 0 0 30px rgba(255, 20, 147, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 20, 147, 0.6), 0 0 30px rgba(255, 20, 147, 0.5), 0 0 40px rgba(255, 20, 147, 0.4);
    }
}

.block {
    z-index: 3;
}

.block2 {
    z-index: 2 !important;
    opacity: 0.93;
}

#tweet {
    background-color: #1d9bf0;
    color: #FFFFFF;
}

#sidebar {
    background-color: #f8ecf3;
    box-shadow: 2px 2px 6px #e4e4e4;
}

.footer {
    background-color: #ece3e9;
}

@keyframes missType {
    0% {
        background-color: beige;
    }
}

.missed {
    animation: missType 1s forwards;
}

@keyframes rot {
    0% {
        transform: rotate3d(1, 1, 1, 0deg);
        opacity: 1;
    }

    100% {
        transform: rotate3d(1, 1, 1, 360deg);
        opacity: 0;
    }
}

.typedBlock {
    animation: rot 0.5s forwards;
}

.activeLevel {
    opacity: 0.6;
}

.main-content {
    min-height: calc(100vh - 6rem);
}

.statCount {
    font-size: 1.5rem;
    color: red;
}

/* Reserve the space used by values populated from localStorage. */
#heartCount,
#heartPower,
#unlockedCount {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

#heartCount {
    min-width: 2ch;
}

#heartPower {
    min-width: 4ch;
}

#unlockedCount {
    min-width: 3ch;
}

#lvex {
    color: white;
    background: black;
}

.loader {
    border: 16px solid #f3f3f3;
    border-top: 16px solid #f8c7e5;
    border-radius: 50%;
    width: 120px;
    height: 120px;
    animation: spin 2s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.unlockedGirl {
    cursor: pointer;
}

#unlockedImages [data-season="3"] .table {
    table-layout: fixed;
}

#unlockedImages [data-season="3"] td {
    padding: 0.35em;
}

.galleryImg {
    display: block;
    margin-inline: auto;
}

.galleryImg[data-season="3"] {
    aspect-ratio: 16 / 9;
    height: auto;
    object-fit: cover;
}

#unlockedImages section + section {
    margin-top: 1.5rem;
}

.gallery-season-count {
    margin-inline-start: 0.6em;
    font-size: 0.7em;
    font-weight: 500;
    white-space: nowrap;
}

#image-modal .modal-content {
    max-width: 94vw;
}

#modal-image {
    display: block;
    width: 100%;
}

.hidden {
    display: none;
}

.fixed {
    position: fixed;
    bottom: 3vh;
}

@media screen and (max-width: 768px) {
    #dataBox.fixed {
        position: static;
    }
}

#language-switcher {
    position: absolute;
    background-color: #f8ecf3;
    font-size:1.5em;
    font-family: 'Kaisei Opti', serif;
    border:#f8c7e5 solid;
    opacity:0.7;
    top: 0px;
    right: 0px;
    cursor: pointer;
    z-index: 5;
}

.row-gradient-1 {
    background-color: #fffbfd !important;
}
.row-gradient-2 {
    background-color: #f7f0f4 !important;
}
.row-gradient-3 {
    background-color: #fff1f9 !important;
}
.row-gradient-4 {
    background-color: #fae6f4 !important;
}
.row-gradient-5 {
    background-color: #ffe6f9 !important;
}

#area.wide {
    width: 100%;
}

.fullscreen-start {
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 0.65rem;
    min-height: 60vh;
}

.fullscreen-level {
    font-weight: 700;
}

html:has(#area:fullscreen) {
    overflow-y: hidden;
    scrollbar-gutter: auto;
}

#area:fullscreen {
    overflow: hidden;
    background: white;
}

.season3-board {
    position: relative;
    aspect-ratio: 16 / 9;
}

.season3-fullscreen-board {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(100vw, calc(100dvh * 16 / 9));
    transform: translate(-50%, -50%);
}

.season3-board .season3-image {
    display: block;
    width: 100%;
    height: 100%;
}

.season3-fullscreen-board #type_area {
    /* Season 1 and 2 use about half the viewport height as their input width. */
    width: min(53dvh, calc(100% - 2rem));
    margin-inline: auto;
}

#area:fullscreen #playStats {
    position: absolute;
    bottom: 3vh;
    left: 1rem;
    z-index: 5;
    padding: 0.4rem 0.75rem;
    border-radius: 4px;
    background: rgb(255 255 255 / 70%);
    box-shadow: 0 2px 8px rgb(0 0 0 / 12%);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

#area:fullscreen #playStats:hover,
#area:fullscreen #playStats:focus-within {
    background: white;
}

#area:fullscreen #timer:empty::before {
    content: "30.0";
}

#area:fullscreen #count:empty::before,
#area:fullscreen #kpm:empty::before {
    content: "0";
}

#dataBox .fullscreen-progress,
#dataBox .fullscreen-settings,
#dataBox .fullscreen-retry {
    display: none;
}

#area:fullscreen .fullscreen-settings {
    display: flex;
    gap: 0.35rem;
    margin-top: 0.45rem;
}

#area:fullscreen .play-progress {
    margin-top: 0.35rem;
}

.fullscreen-retry {
    margin-top: 0.45rem;
}

.fullscreen-retry kbd {
    margin-left: 0.6em;
    font-size: 0.85em;
}

#fullscreenExit {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 6;
}

#area:fullscreen .loader {
    margin: 0 auto;
}
