:root {
    --primary-color: #31bb81;
    --correct-color: #17a168ff;
    --wrong-color: #bd3838ff;
    --option-min-height: 3.5rem;
    --option-max-width: 12rem;
    --options-gap: 0.5rem;
    --options-max-width: calc((var(--option-max-width) * 2) + var(--options-gap));
}

html {
    user-select: none;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;

    background: linear-gradient(120deg, #e3fdfd 0%, #ffedeb 100%);
    animation: bodyBackgroundAnimation 15s infinite;
}

.header,
.main {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 30rem;
}

.main {
    position: relative;
}

.header {
    margin: 0 0 1.4rem 0;
}

.btnBack {
    align-self: flex-start;
    font-size: 2.4rem;
    text-decoration: none;
    color: #2093ff;
    margin-bottom: 1rem;
    transition: all .2s ease-in;
}

.btnBack:hover {
    color: #1263af;
}

.btnBack:active {
    transform: translatey(.1rem);
    color: #0c4d8a;
}

.title,
.subtitle {
    margin: 0;
    padding: 0;
    text-align: center;
}

.title {
    text-transform: uppercase;
    font-family: "Rye", serif;
    font-size: 1.6rem;
    color: var(--primary-color);
}

.subtitle {
    font-family: "New Rocker", system-ui;
    font-size: .95rem;
    font-weight: 100;
}

#score {
    font-family: "Rye", serif;
    font-size: 1.2rem;
    margin: 1rem 0 0 0;
    text-transform: uppercase;
}

.win {
    display: none;
    font-family: "Rye", serif;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    animation: fadeIn 0.6s ease-in-out;
}

.btnPlay {
    margin: .6rem 0;
    text-decoration: none;
    text-transform: uppercase;
    padding: 1rem 1.2rem;
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 1px 1px 10px 5px rgba(0, 0, 0, .1);
    border-radius: 10px;
    background-image: linear-gradient(135deg, var(--primary-color), #48c6f2);
    transition: transform 0.3s, background-color 0.3s, color 0.3s;
}

.btnPlay:hover {
    color: color-mix(in srgb, var(--primary-color), #000 30%);
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    background-color: #fff;
    outline: 2px solid var(--primary-color);
}

.btnPlay:active {
    transform: translatey(.1rem);
}

.btnPlay.challenge {
    animation: pulse 2s infinite;
    background-image: linear-gradient(135deg, #b41616, #fd6262);
}

.btnPlay.challenge:hover {
    color: #8a1919;
    background-color: #fff;
    outline: 2px solid #b41616;
}

.highlight {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.1rem;
    margin-left: .15rem;
}

.options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--options-gap);
    width: 100%;
    max-width: var(--options-max-width);
    justify-content: center;
}

.flag {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    width: 100%;
    transition: transform 0.2s;
    overflow: hidden;
}

.flag img {
    width: 100%;
    max-width: 15rem;
    padding: 0.3rem;
    box-shadow: 1px 1px 15px 2px rgba(0, 0, 0, .1);
    border-radius: 8px;
    transition: transform 0.2s;
}

.flag:hover img {
    transform: scale(1.03);
}

.option {
    font-family: "Inter", sans-serif;
    text-transform: uppercase;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: .06rem;
    padding: 0.8rem 0.5rem;
    margin: 0;
    background-color: #e0efff;
    border: 1px solid #bbb;
    border-radius: 5px;
    transition: all .3s ease-in-out;
    cursor: pointer;
    text-align: center;

    min-height: var(--option-min-height);
    display: flex;
    align-items: center;
    justify-content: center;

    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    white-space: normal;
    line-height: 1.2;

    width: 100%;
    box-sizing: border-box;
}

.option:hover {
    background-color: #b4d3ff;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, .15);
}

.option:active {
    background-color: #999;
    font-weight: bold;
    transform: translateY(0.1rem) scale(0.98);
}

.option.correct {
    background-color: var(--correct-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(23, 161, 104, 0.5);
}

.option.wrong {
    background-color: var(--wrong-color);
    color: #fff;
    box-shadow: 0 0 15px rgba(189, 56, 56, 0.5);
}

.option.disabled {
    pointer-events: none;
}

.option.correct:hover {
    background-color: var(--correct-color);
}

.option.wrong:hover {
    background-color: var(--wrong-color);
}

.option.correct:active {
    background-color: var(--correct-color);
    font-weight: inherit;
    transform: inherit;
}

.option.wrong:active {
    background-color: var(--wrong-color);
    font-weight: inherit;
    transform: inherit;
}

.difficulties {
    display: flex;
    flex-direction: column;
    text-align: center;
    font-family: "Inter", sans-serif;
    width: 100%;
    max-width: 20rem;
}

.difficulties .btnPlay {
    margin: .3rem 0;
}

.difficulties p {
    font-size: 1.3rem;
}

#challengeWarning {
    font-family: "New Rocker", system-ui;
    font-size: .95rem;
    font-weight: 700;
    color: var(--wrong-color);
}

#currentYear {
    margin-right: .05rem;
}

.footer {
    position: absolute;
    font-size: .85rem;
    bottom: 0;
    width: 100%;
    background-color: #2e3b4e;
    color: #fff;
    font-family: "Inter", sans-serif;
    padding: .5rem 0;
    text-align: center;
}

/* Mobile - mantém proporção */
@media (max-width: 25.75rem) {
    :root {
        --option-max-width: 10rem;
        --option-min-height: 3rem;
    }

    body {
        padding: 0.5rem;
        justify-content: flex-start;
        padding-top: 2rem;
    }

    .title {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .option {
        font-size: 0.7rem;
        padding: 0.6rem 0.3rem;
        min-height: var(--option-min-height);
    }

    .flag img {
        max-width: 13rem;
    }

    .options {
        max-width: calc((var(--option-max-width) * 2) + var(--options-gap));
    }
}

/* Tablet */
@media (min-width: 48rem) {
    :root {
        --option-max-width: 14rem;
        --option-min-height: 4rem;
    }

    .option {
        font-size: 0.85rem;
        padding: 1rem 0.8rem;
    }

    .flag img {
        max-width: 17rem;
    }
}

/* Desktop grande */
@media (min-width: 64rem) {
    :root {
        --option-max-width: 13rem;
        --option-min-height: 3.8rem;
    }

    .option {
        font-size: 0.8rem;
        padding: 1rem 0.6rem;
    }
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes bodyBackgroundAnimation {
    0% {
        background-position: 0% 0%;
    }

    100% {
        background-position: 100% 100%;
    }
}