:root {
    --words-gap: 0.4rem;
    --words-width: 32rem;
    --category-0-color: rgb(249, 223, 109);
    --category-1-color: rgb(160, 195, 90);
    --category-2-color: rgb(176, 196, 239);
    --category-3-color: rgb(186, 129, 197);
    /* --category-0-color: linear-gradient(rgb(249, 223, 109), rgb(160, 195, 90));
  --category-1-color: linear-gradient(rgb(160, 195, 90), rgb(176, 196, 239));
  --category-2-color: linear-gradient(rgb(176, 196, 239), rgb(186, 129, 197));
  --category-3-color: linear-gradient(rgb(186, 129, 197), rgb(186, 129, 197)); */
    --header-font-size: 1.6rem;
}

html,
body {
    width: 100%;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    background-color: whitesmoke;
    box-sizing: border-box;
    overflow-y: hidden;
}

.body.dictionary {
    overflow-y: auto;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    border: none;
    outline: none;
    background-color: inherit;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.main {
    width: 100%;
    flex: 1;
    padding: 1rem;
}

.section {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.section.dictionary {
    font-family: "Ahn Sangsoo", sans-serif;
    font-weight: 700;
    font-size: 4rem;
    width: 100%;
    height: auto;
    display: block;
}

.section.stats {
    height: auto;
}

.container {
    display: flex;
    width: var(--words-width);
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container.nav {
    width: var(--words-width);
    margin-bottom: 1rem;
}

.container.disclaimer {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: var(--words-width);
    gap: 0.3rem;
    margin-top: 3rem;
}

.container.title h1 {
    font-family: "Ahn Sangsoo", sans-serif;
    font-size: 2rem;
    font-weight: 700;
}

.words {
    /* display: flex;
  flex-wrap: wrap;
  width: var(--words-width);
  gap: var(--words-gap); */
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* gap: var(--words-gap); */
    width: 100%;
    margin-bottom: 1rem;
    font-family: "Ahn Sangsoo", sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
}

.words li {
    display: flex;
    justify-content: center;
    align-items: center;
    /* width: calc((var(--words-width) - var(--words-gap) * 3) / 4); */
    aspect-ratio: 1/1;
    list-style: none;
    cursor: pointer;
    background-color: gainsboro;
    color: black;
    user-select: none;
    -webkit-user-select: none;
}

li.correct {
    /* background-color: lightgreen; */
    pointer-events: none;
}

li.active {
    background-color: black;
    color: white;
}

#submit {
    width: 100%;
    height: 60px;
    outline: none;
    border: none;
    border-radius: 6rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    color: white;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: normal;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    margin-bottom: 0.5rem;
}

#submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.answer-block {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    aspect-ratio: 4/1;
    grid-column: span 4;
    gap: 0.6rem;
}

.answer-block.category-0 {
    background: var(--category-0-color);
    color: black;
}

.answer-block.category-1 {
    background: var(--category-1-color);
    color: black;
}

.answer-block.category-2 {
    background: var(--category-2-color);
    color: black;
}

.answer-block.category-3 {
    background: var(--category-3-color);
    color: black;
}

.category-name {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
}

.category-words {
    font-family: "Ahn Sangsoo", sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
}

.nav {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
}

#prevDay,
#nextDay,
#title {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
}

#prevDay:enabled,
#nextDay:enabled {
    color: black;
}

.additional-buttons {
    display: flex;
    width: 100%;
    gap: 0.25rem;
}

.additional-buttons .button {
    width: 50%;
    height: 60px;
    outline: none;
    border: none;
    border-radius: 6rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: black;
    color: white;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.additional-buttons .button:not(:first-child) {
    border-left: none;
}

.pop-animation {
    animation: popText 0.4s ease-in-out;
}

.typewriter-text {
    opacity: 1;
    transition: opacity 0.3s ease;
    white-space: nowrap;
}

.disabled {
    pointer-events: none;
}

.disclaimer {
    font-family: "Pretendard Variable", Pretendard, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: silver;
    text-align: center;
}

.disclaimer .ahn {
    font-family: "Ahn Sangsoo", sans-serif;
    font-weight: 700;
}

.disclaimer .karnak {
    font-family: "NYTKarnakCondensed", sans-serif;
}

.dictionary-container {
    /* display: flex;
  flex-wrap: wrap;
  gap: 0.5rem; */
    line-height: 1.5;
}

.dictionary-container span {
    color: silver;
    user-select: none;
    -webkit-user-select: none;
    margin-right: 0.5rem;
}

.dictionary-container span:hover {
    color: black;
    cursor: pointer;
}

.dictionary-container span.active {
    color: black;
}

.footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex: 0 0 auto;
    padding: .5rem 1rem;
    font-size: .75rem;
    text-align: right;
    background-color: white;
    border-top: 1px solid gainsboro;
}

.footer a {
    opacity: .5;
}

.footer a:hover {
    opacity: 1;
}

.footer div:last-child a {
    font-family: 'Pretendard Variable', Pretendard, sans-serif;
}

.logo {
    display: inline-flex;
    align-items: center;
    position: relative;
    font-family: Logo;
    font-size: 1rem;
}

.logo span:last-child {
    display: none;
}

.three-stars {
    font-family: 'Pretendard Variable', Pretendard, sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    padding: 1.5rem;
}

.stats-container {
    font-family: 'Pretendard Variable', Pretendard, sans-serif;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    line-height: 1.7;
    padding-bottom: 1rem;
}

@media screen and (max-width: 899px) {
    .logo span:first-child {
        display: none;
    }
    .logo span:last-child {
        display: inline-block;
    }
}

@keyframes popText {
    0% {
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@media screen and (max-height: 900px) {
     :root {
        --words-width: 50dvh;
    }
    .main {
        padding: 0.5rem;
    }
    .words {
        font-size: 1.4rem;
    }
    #submit {
        font-size: 0.9rem;
    }
    .category-name {
        font-size: 0.9rem;
    }
    .category-words {
        font-size: 1.2rem;
    }
    #prevDay,
    #title,
    #nextDay {
        font-size: 1rem;
    }
    .container.nav {
        margin-bottom: 1rem;
    }
    .additional-buttons .button {
        font-size: 0.9rem;
    }
    .container.disclaimer {
        margin-top: 1rem;
        gap: 0.1rem;
    }
    .disclaimer {
        font-size: 0.7rem;
    }
}

@media screen and (max-width: 600px) {
     :root {
        --words-width: 100%;
    }
    .words {
        font-size: 1.4rem;
    }
    #submit {
        font-size: 0.9rem;
    }
    .answer-block {
        height: auto;
        aspect-ratio: 4/1;
        gap: 0.3rem;
    }
    .category-name {
        font-size: 0.9rem;
    }
    .category-words {
        font-size: 1.2rem;
    }
    .section.dictionary {
        font-size: 2rem;
    }
    #prevDay,
    #title,
    #nextDay {
        font-size: 0.9rem;
    }
    .container.nav {
        margin-bottom: 1rem;
    }
    .additional-buttons .button {
        font-size: 0.9rem;
    }
    .container.disclaimer {
        margin-top: 1rem;
        gap: 0.1rem;
    }
    .disclaimer {
        font-size: 0.7rem;
    }
    .three-stars {
        font-size: 1rem;
    }
    .stats-container {
        font-size: .75rem;
    }
}

@media screen and (max-width: 450px) and (max-height: 450px) {
     :root {
        --words-width: 70%;
    }
    .words {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    .container.nav {
        margin-bottom: 0.4rem;
    }
    .category-name {
        font-size: 0.6rem;
    }
    .category-words {
        font-size: 0.8rem;
    }
    #prevDay,
    #title,
    #nextDay {
        font-size: 0.5rem;
    }
    #submit,
    .additional-buttons .button {
        font-size: 0.5rem;
        height: 30px;
        margin-bottom: 0.3rem;
    }
    .container.disclaimer {
        margin: 0.2rem;
    }
    .disclaimer {
        font-size: 0.4rem;
    }
    .footer {
        display: none;
    }
}