html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
    touch-action: manipulation;
    -webkit-user-select: none;
    user-select: none;
}

@font-face {
    font-family: 'ComercioSansBook';
    src: url('../fonts/ComercioSans/ComercioSans-Book.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'ComercioSansBold';
    src: url('../fonts/ComercioSans/ComercioSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

button {
    touch-action: manipulation;
}

/* ✅ FIX 2: tamanho fixo 500x500 + display block para funcionar dentro de position: absolute */
model-viewer {
    width: 500px;
    height: 500px;
    display: block;
}

#appViewport {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

#appStage {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1080px;
    height: 1920px;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    overflow: hidden;
}

#app {
    position: relative;
    width: 1080px;
    height: 1920px;
    overflow: hidden;
}

.quiz_background {
    background-image: url(../images/quiz_bg_003.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

#feaduaneirosLogo {
    background-image: url(../images/feaduaneiros_logo.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 743px;
    height: 250px;
}

#parceirosLogo {
    background-image: url(../images/parceiros_logo.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    width: 710px;
    height: 247px;
}

#logoInstagram, #logoInstagramEnd {
    width: 500px;
    height: 500px;
}

.quizElements-top {
    top: var(--top);
}

#textoFeaduaneiros {
    font-family: 'ComercioSansBold', serif;
    font-size: 65px;
    text-align: center;
}
.userBrindeText {
    font-family: 'ComercioSansBold', serif;
    font-size: 60px;
    text-align: center;
    white-space: nowrap;
}
#userBrindeToken {
    margin: auto;
}
#userBrindeTokenData > div {
    font-family: 'ComercioSansBold', serif;
    font-size: 200px;
    padding: 0;
    float: left;
    color: white;
}
.button {
    cursor: pointer;
    border: none;
    background: linear-gradient(
            45deg,
            #f09433 0%,
            #e6683c 25%,
            #dc2743 50%,
            #cc2366 75%,
            #bc1888 100%
    );
    color: #fff;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    overflow: hidden;
    position: relative;
    display: grid;
    place-content: center;
    transition: background 300ms, transform 200ms;
    font-weight: 600;
}

.button__text {
    position: absolute;
    inset: 0;
    animation: text-rotation 8s linear infinite;
}

/* Distribuição correta: 360deg / 20 caracteres = 18deg exatos por letra     */
/* font-size grande compensa o scale do fitQuizStage (~0.4x em telas menores) */
.button__text > span {
    position: absolute;
    transform: rotate(calc(360deg / 20 * var(--index)));
    inset: 4px;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: 2px;
}

.button__circle {
    position: relative;
    width: 250px;
    height: 250px;
    overflow: hidden;
    background: #212121;
    color: #dc2743;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.button__icon {
    width: 150px;
    height: 150px;
}

.button__icon--copy {
    position: absolute;
    transform: translate(-150%, 150%);
}

.button:hover {
    background: #000;
    /* scale reduzido de 1.05 para 1.03: evita corte visual no tamanho 500px */
    transform: scale(1.03);
}

.button:hover .button__icon {
    color: #fff;
}

.button:hover .button__icon:first-child {
    transition: transform 0.3s ease-in-out;
    transform: translate(150%, -150%);
}

.button:hover .button__icon--copy {
    transition: transform 0.3s ease-in-out 0.1s;
    transform: translate(0);
}

.button:active {
    transform: scale(0.97);
}

@keyframes text-rotation {
    to {
        rotate: 360deg;
    }
}
/* ─── Fade transition entre telas ─────────────────────────────────────────── */
#instagramBotao,
#userTokenData,
#userPlaying,
#userBrindeOk {
    transition: opacity 2s ease;
    will-change: opacity;
}

/* valor de opacidade inicial explícito para cada elemento */
#instagramBotao {
    opacity: 1;
}

#userTokenData,
#userPlaying,
#userBrindeOk {
    opacity: 0;
}

/* fade-out */
#instagramBotao.fade-out,
#userTokenData.fade-out,
#userPlaying.fade-out,
#userBrindeOk.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* fade-in */
#instagramBotao.fade-in,
#userTokenData.fade-in,
#userPlaying.fade-in,
#userBrindeOk.fade-in {
    opacity: 1;
    pointer-events: auto;
}
