* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Architects Daughter', sans-serif;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

:root {
    color-scheme: light only;
    --force-light-mode: true;
}

@property --cor-1 {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(244, 126, 171, 0.58);
}

@property --cor-2 {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(136, 172, 206, 0.52);
}

@property --cor-3 {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(72, 96, 128, 0.46);
}

@property --cor-4 {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(188, 140, 100, 0.5);
}

@property --cor-5 {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(120, 152, 190, 0.48);
}

@property --cor-6 {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(210, 176, 126, 0.44);
}

@property --cor-7 {
    syntax: '<color>';
    inherits: false;
    initial-value: rgba(92, 118, 154, 0.42);
}

html,
body {
    min-height: 100%;
}

body {
    position: relative;
    min-height: 100svh;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    background: #141414
}

.tela {
    width: 100%;
    min-height: 100svh;
    display: none;
}

.menu-topo {
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 50;
    padding: 16px;
    display: flex;
    justify-content: space-between;

    img {
        opacity: 0.67;
    }

    img.branco {
        filter: invert(1);
    }
}

#select-style-screen.ativo,
#game-screen.ativo {
    display: grid;
}

#game-screen.ativo {
    place-items: center;
    opacity: 0;
}

#game-screen.ativo.jogo_visivel {
    opacity: 1;
}

#gallery-screen.ativo {
    display: flex;
    align-items: center;
}

#game-screen {
    position: relative;
    width: 100vw;
    min-height: 100svh;
    isolation: isolate;
    opacity: 0;
    transition: opacity var(--tempo-entrada-jogo, 0.7s) cubic-bezier(0.22, 1, 0.36, 1);
}

#background {
    position: fixed;
    width: 100%;
    height: 100vmax;
    /*inset: -16vmax;*/
    z-index: 0;
    background-color: #fff; /*#fbf2e8;*/
    background-image:
        radial-gradient(circle at 16% 16%, var(--cor-1, rgba(244, 188, 126, 0.58)) 0, transparent 32%),
        radial-gradient(circle at 84% 16%, var(--cor-2, rgba(136, 172, 206, 0.52)) 0, transparent 32%),
        radial-gradient(circle at 84% 84%, var(--cor-3, rgba(72, 96, 128, 0.46)) 0, transparent 34%),
        radial-gradient(circle at 16% 84%, var(--cor-4, rgba(188, 140, 100, 0.5)) 0, transparent 34%),
        radial-gradient(circle at 50% 22%, var(--cor-5, rgba(120, 152, 190, 0.48)) 0, transparent 30%),
        radial-gradient(circle at 30% 56%, var(--cor-6, rgba(210, 176, 126, 0.44)) 0, transparent 34%),
        radial-gradient(circle at 70% 60%, var(--cor-7, rgba(92, 118, 154, 0.42)) 0, transparent 36%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
        var(--imagem-fundo, none);
    background-position: center;
    background-size: cover, cover, cover, cover, cover, cover, cover, cover, cover;
    background-repeat: no-repeat;
    /*filter: blur(58px) saturate(1.04) contrast(1) brightness(1.02);*/
    /*transform: scale(1.14);
    opacity: 0.94;*/
    transition:
        --cor-1 var(--tempo-transicao-fundo, 2s) ease,
        --cor-2 var(--tempo-transicao-fundo, 2s) ease,
        --cor-3 var(--tempo-transicao-fundo, 2s) ease,
        --cor-4 var(--tempo-transicao-fundo, 2s) ease,
        --cor-5 var(--tempo-transicao-fundo, 2s) ease,
        --cor-6 var(--tempo-transicao-fundo, 2s) ease,
        --cor-7 var(--tempo-transicao-fundo, 2s) ease
        /*opacity var(--tempo-transicao-fundo, 2s) ease,
        transform var(--tempo-transicao-fundo, 2s) ease;*/
}

/*#background::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.01)),
        radial-gradient(circle at center, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
}*/

.area_jogo {
    position: relative;
    z-index: 1;
    width: min(100vw - 28px, 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 62px 0 18px;
}

#grade {
    position: relative;
    width: 100vw;
    max-width: 650px;
    max-height: 100svh;
    overflow: hidden;
    border-radius: 18px;
    isolation: isolate;
}

.mosaico_grade,
.imagem_grade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.mosaico_grade {
    display: grid;
    z-index: 2;
    transition: opacity var(--tempo-troca-imagem-final, 0.9s) ease;
    opacity: 1;
}

.imagem_real_grade {
    z-index: 1;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.01);
    transition: opacity 0.6s ease;
}

#grade.comparando_final {
    cursor: pointer;
}

#grade.comparando_final .imagem_real_grade {
    opacity: 1;
}

#grade.comparando_final.mostrando_real .mosaico_grade {
    opacity: 0;
}

#grade.comparando_final.mostrando_ilustrada .mosaico_grade {
    opacity: 1;
}

.painel_conclusao {
    opacity: 0;
    transform: translateY(14px);
    pointer-events: none;
    transition: opacity 0.28s ease, transform 0.32s ease;

    h2 {
        font-size: 1.25rem;
        line-height: 1.1;
        margin-bottom: 8px;
    }

    p {
        color: rgba(34, 34, 34, 0.78);
        font-size: 0.92rem;
        line-height: 1.4;
    }

    &.ativo {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto;
    }

    button {
        width: 100%;
        margin-top: 14px;
        border: 0;
        border-radius: 999px;
        padding: 14px 18px;
        background: #1f1f1f;
        color: #fff;
        font-size: 1rem;
    }
}

.autor_imagem {
    margin-top: 10px;
}

.casa {
    position: relative;
    width: 100%;
    height: 100%;
}

.peca {
    width: 100%;
    height: 100%;
    background-image: var(--imagem-peca);
    background-repeat: no-repeat;
    background-size: cover;
    transform: scale(1.0125);
    transform-origin: center;
    transition:
        clip-path 0.22s ease,
        opacity var(--tempo-entrada-peca, 0.52s) ease-out,
        transform var(--tempo-entrada-peca, 0.52s) cubic-bezier(0.2, 0.9, 0.28, 1);
    will-change: clip-path, transform;
}

#grade.pecas_ocultas .mosaico_grade {
    pointer-events: none;
}

#grade.pecas_ocultas .peca {
    opacity: 0;
    transform: translateY(14px) scale(0.92);
}

#grade.pecas_ocultas .peca.peca_visivel {
    opacity: 1;
    transform: translateY(0) scale(1.01);
}

.peca_arrastando {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 20;
    pointer-events: none;
    opacity: 0.96;
    box-shadow: 0 18px 44px rgba(13, 22, 33, 0.22);
    transition: none;
    transform: translate(-50%, -50%) scale(1.03);
}

#grade[data-vitoria="true"] .peca:not(.peca_arrastando) {
    transform: scale(1.01);
}

#select-style-screen {
    width: 100%;
    height: 100svh;
    z-index: 10;
    transition: opacity 0.46s ease, transform 0.46s ease;

    div {
        background-size: cover;
        background-position: center;
        position: relative;
    }

    div h2 {
        position: absolute;
        left: 16px;
        bottom: 32px;
        color: #fff;
    }

    div span {
        position: absolute;
        left: 16px;
        bottom: 16px;
        color: rgba(255, 255, 255, 0.75);
    }
}

#select-style-screen.tela_sumindo {
    opacity: 0;
    transform: scale(1.02);
    pointer-events: none;
}

#style-places {
    background: url('../media/styles/places.png');
}

#style-fantasy {
    background: url('../media/styles/fantasy.jpg');
}

#style-figures {
    background: url('../media/styles/figures.jpg');
}

#gallery-screen {
    position: relative;
    align-content: start;
}

#gallery-container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
    gap: 8px;
    padding: 16px;
}

.imagem_galeria {
    width: 100%;
    border-radius: 12px;
    opacity: 0;
    transform: scale(0);
    filter: grayscale(var(--cinza, 0)) saturate(var(--saturacao, 1));
    transition:
        opacity 0.38s ease,
        transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
        filter 0.32s ease;

    &.visivel {
        opacity: var(--opacidade-final, 1);
        transform: scale(1);
    }

    &.feita {
        --opacidade-final: 1;
        --saturacao: 1.1;
    }

    &.disponivel {
        --opacidade-final: 0.67;
    }

    &.bloqueada {
        --opacidade-final: 0.67;
        --cinza: 1;
        pointer-events: none;
    }
}
