/* Importar fontes DiDiSans */
@font-face {
    font-family: 'DiDiSans';
    src: url('./assets/fontes/DiDiSans-Pro-Regular.woff') format('woff'),
         url('./assets/fontes/DiDiSans-Pro-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'DiDiSans';
    src: url('./assets/fontes/DiDiSans-Pro-Bold.woff') format('woff'),
         url('./assets/fontes/DiDiSans-Pro-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none; /* Previne seleção em todos os elementos */
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

html {
    overflow: hidden; /* Remove scroll do html */
    height: 100%;
    width: 100%;
}

body {
    font-family: 'DiDiSans', sans-serif;
    background-color: #ffdd00;
    height: 100vh;
    width: 100vw;
    overflow: hidden; /* Remove scroll do body */
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed; /* Previne scroll no mobile */
    top: 0;
    left: 0;
}

/* Container principal */
.container {
    width: 1080px;
    height: 1920px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    padding-top: 120px;
    position: relative;
}

/* Título */
.title {
    font-size: 11em;
    font-weight: 700;
    color: #000;
    text-align: center;
    line-height: 0.9;
    letter-spacing: 2px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: calc(100% - 90vw - 13vh - 40px);
    max-height: calc(100% - 972px - 13vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.title span {
    display: block;
}

/* Container da roleta */
.roulette-container {
    position: absolute;
    bottom: 13%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

/* Disco da roleta */
.roulette-disk {
    width: 90vw;
    height: 90vw;
    max-width: 972px;
    max-height: 972px;
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    user-select: none;
    outline: none; /* Remove outline de foco */
    -webkit-tap-highlight-color: transparent; /* Remove highlight no mobile */
}

/* Slices da roleta SVG */
.slice {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    top: 0;
    left: 0;
    outline: none; /* Remove outline de foco */
    -webkit-tap-highlight-color: transparent; /* Remove highlight no mobile */
    /* Otimizações de performance para animação suave */
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
}

.slice img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    -moz-user-select: none;
    -ms-user-select: none;
    outline: none; /* Remove outline de foco */
    -webkit-tap-highlight-color: transparent; /* Remove highlight no mobile */
    /* Otimizações de performance para imagens */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Posicionamento dos slices - cada um rotacionado 60° */
.slice-1 { transform: rotate(0deg); }
.slice-2 { transform: rotate(60deg); }
.slice-3 { transform: rotate(120deg); }
.slice-4 { transform: rotate(180deg); }
.slice-5 { transform: rotate(240deg); }
.slice-6 { transform: rotate(300deg); }

/* Efeito de hover para indicar interatividade - apenas quando não está girando */
.roulette-disk:not(.spinning):hover {
    transform: scale(1.02);
    transition: transform 0.2s ease;
}

.roulette-disk:not(.spinning):active {
    transform: scale(0.98);
}

/* Remove qualquer transformação durante o giro */
.roulette-disk.spinning {
    transform: none !important;
}

/* Remove aparência de seleção em todos os elementos */
.roulette-disk:focus,
.slice:focus,
.slice img:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Remove highlight de toque no mobile */
.roulette-disk:active,
.slice:active {
    -webkit-tap-highlight-color: transparent !important;
}

/* Remove hover durante e após o giro */
.roulette-disk.spinning,
.roulette-disk.spinning:hover,
.roulette-disk.spinning:active {
    transform: none !important;
}

/* Transição suave - REMOVIDA A CLASSE .spinning QUE BLOQUEAVA A ANIMAÇÃO */
.roulette-disk {
    /* A transição será controlada via JavaScript inline */
}

/* Estados dos slices após o giro */
.slice.winner {
    opacity: 1;
    filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.1)) drop-shadow(0 0 40px rgba(0, 0, 0, 0.3));
    z-index: 10;
    transition: filter 0.5s ease-out;
    animation: winnerShadow 1s ease-out;
}

/* Desabilitar cliques durante o sorteio */
.no-clicks {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Removido: transparência durante giro para manter roleta sempre visível */

@keyframes winnerShadow {
    0% {
        filter: drop-shadow(0 0 0px rgba(0, 0, 0, 0));
    }
    50% {
        filter: drop-shadow(0 0 30px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 60px rgba(0, 0, 0, 0.4));
    }
    100% {
        filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.1)) drop-shadow(0 0 40px rgba(0, 0, 0, 0.3));
    }
}

.slice.loser {
    opacity: 1;
    filter: none;
    transition: filter 0.5s ease-out;
}

/* Estado padrão dos slices */
.slice {
    opacity: 1;
    filter: none;
    transition: opacity 0.5s ease-out, filter 0.5s ease-out;
}

/* Tela de Capa */
.cover-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/background-capa-99-food.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    /* Fallback caso a imagem não exista */
    background-color: #ffdd00;
    z-index: 3000;
    opacity: 1;
    cursor: pointer;
}

.cover-screen.hidden {
    opacity: 0;
    pointer-events: none;
    animation: none;
}

.cover-content {
    width: 100%;
    height: 80%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-title {
    font-size: 6em;
    font-weight: 700;
    color: #000;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: transform 0.3s ease, text-shadow 0.3s ease;
    opacity: 1;
}

.cover-title:hover {
    transform: scale(1.05);
    text-shadow: 3px 3px 6px rgba(255, 255, 255, 0.7);
}

.cover-title:active {
    transform: scale(0.98);
}

/* Tela de Cadastro */
.register-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffdd00;
    z-index: 2000;
    opacity: 1;
}

.register-screen.hidden {
    opacity: 0;
    pointer-events: none;
    animation: none;
}

/* Tela de Premiação */
.prize-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffdd00;
    z-index: 4000;
    opacity: 0;
}

.prize-screen.hidden {
    opacity: 0;
    pointer-events: none;
    animation: none;
}

.prize-screen:not(.hidden) {
    opacity: 1;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Animações de entrada */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Estilos da tela de cadastro */
.register-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.register-title {
    font-size: 5em;
    font-weight: 700;
    color: #000;
    line-height: 1.1;
    letter-spacing: 2px;
    max-width: 95%;
    text-align: center;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 50%;
    bottom: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.register-form {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    gap: 25px;
    opacity: 1;
}

.form-group {
    width: 100%;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"] {
    width: 100%;
    padding: 18px 25px;
    font-family: 'DiDiSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 2em;
    font-weight: 500;
    color: #000;
    background-color: #fffce3;
    border: 3px solid #000;
    border-radius: 15px;
    outline: none;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: #666;
    opacity: 0.7;
}

.form-group input:focus {
    border-color: #000;
    box-shadow: 0 0 0 5px rgba(0, 0, 0, 0.1);
    transform: scale(1.02);
}

.form-group input.error {
    border-color: #ff8c00;
    background-color: #fff4e6;
}

.form-group input.error:focus {
    border-color: #ff8c00;
    box-shadow: 0 0 0 5px rgba(255, 140, 0, 0.1);
    background-color: #fff4e6;
}

.error-message {
    font-family: 'DiDiSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 1.4em;
    font-weight: 500;
    color: #ff8c00;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

.checkbox-group .error-message {
    margin-top: 8px;
    text-align: center;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 35px;
    height: 35px;
    cursor: pointer;
    accent-color: #000;
}

.checkbox-label input[type="checkbox"].error {
    accent-color: #ff8c00;
    outline: 2px solid #ff8c00;
    outline-offset: 2px;
}

.checkbox-text {
    font-family: 'DiDiSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 1.8em;
    font-weight: 500;
    color: #000;
    line-height: 1.3;
}

.submit-button {
    width: 100%;
    padding: 25px;
    font-family: 'DiDiSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 2.5em;
    font-weight: 700;
    color: #fff;
    background-color: #ff8c00;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 3px;
    margin-top: 15px;
}

.submit-button:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.submit-button:active {
    transform: scale(0.98);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.client-logo-register {
    position: fixed;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 25%;
    min-width: 150px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.client-logo-register img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.prize-content {
    width: 100%;
    height: 100%;
    position: relative;
}

.prize-title {
    font-size: 8.5em;
    font-weight: 700;
    color: #000;
    line-height: 1;
    letter-spacing: 2px;
    max-width: 85%;
    text-align: center;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: calc(50% - 27.5vw);
    max-height: calc(50% - 297px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.prize-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    max-width: 594px;
    height: 55vw;
    max-height: 594px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.prize-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.client-logo {
    position: fixed;
    bottom: 12%;
    left: 50%;
    transform: translateX(-50%);
    width: 25%;
    min-width: 150px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.client-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Ponteiro indicador */
.pointer {
    width: 80px;
    height: 80px;
    margin-bottom: -25px;
    z-index: 1000000000;
    position: relative;
}

.pointer img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Selinho 99food centralizado e fixo */
.center-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 138px;
    height: 138px;
    z-index: 20;
    pointer-events: none;
}

.center-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Responsividade para 1080x1920 */
@media screen and (max-width: 1080px) and (max-height: 1920px) {
    .container {
        width: 100vw;
        height: 100vh;
        padding-top: 8%;
    }
    
    .cover-title {
        font-size: 5em;
    }
    
    .title {
        font-size: 11em;
        margin-bottom: 60px;
    }
    
    .roulette-disk {
        width: 90vw;
        height: 90vw;
        max-width: 972px;
        max-height: 972px;
    }
    
    .pointer {
        width: 80px;
        height: 80px;
        margin-bottom: -25px;
    }
    
    .center-logo {
        width: 138px;
        height: 138px;
    }
    
    .prize-title {
        font-size: 7.5em;
        max-width: 85%;
        height: calc(50% - 297px);
    }
    
    .prize-icon {
        width: 55%;
        max-width: 594px;
        height: 594px;
    }
    
    .client-logo {
        width: 25%;
        min-width: 120px;
        bottom: 12%;
    }
    
    .register-title {
        font-size: 4.5em;
        width: 70%;
        height: 45%;
        top: 0;
        bottom: 50%;
    }
    
    .register-form {
        width: 75%;
        gap: 20px;
    }
    
    .form-group input[type="text"],
    .form-group input[type="email"],
    .form-group input[type="tel"] {
        font-size: 2.5em;
        padding: 25px 22px;
    }
    
    .checkbox-text {
        font-size: 1.6em;
    }
    
    .submit-button {
        font-size: 2.2em;
        padding: 22px;
    }
    
    .client-logo-register {
        width: 25%;
        min-width: 120px;
        bottom: 12%;
    }
    
    .error-message {
        font-size: 1.2em;
        margin-top: 6px;
    }
}

/* Garantir proporção 9:16 sempre */
@media screen and (aspect-ratio: 9/16) {
    .container {
        width: 100vw;
        height: 100vh;
        padding-top: 8%;
    }
    
    .title {
        font-size: 11em;
    }
    
    .roulette-disk {
        width: 90vw;
        height: 90vw;
        max-width: 972px;
        max-height: 972px;
    }
    
    .pointer {
        width: 80px;
        height: 80px;
        margin-bottom: -25px;
    }
    
    .center-logo {
        width: 138px;
        height: 138px;
    }
}

/* Estilo para indicar que a roleta está esperando clique do usuário */
.roulette-container.waiting-for-click {
    cursor: pointer;
}

.roulette-container.waiting-for-click .roulette-disk {
    animation: pulse-waiting 1.5s ease-in-out infinite;
    cursor: pointer;
}

.roulette-container.waiting-for-click .pointer {
    animation: pulse-waiting 1.5s ease-in-out infinite;
}

@keyframes pulse-waiting {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Para telas verticais */
@media screen and (orientation: portrait) {
    .container {
        width: 100vw;
        height: 100vh;
        padding-top: 8%;
    }
    
    .title {
        font-size: 11em;
    }
    
    .roulette-disk {
        width: 90vw;
        height: 90vw;
        max-width: 972px;
        max-height: 972px;
    }
    
    .pointer {
        width: 80px;
        height: 80px;
        margin-bottom: -25px;
    }
    
    .center-logo {
        width: 138px;
        height: 138px;
    }
}

/* Estilo para indicar que a roleta está esperando clique do usuário */
.roulette-container.waiting-for-click {
    cursor: pointer;
}

.roulette-container.waiting-for-click .roulette-disk {
    animation: pulse-waiting 1.5s ease-in-out infinite;
    cursor: pointer;
}

.roulette-container.waiting-for-click .pointer {
    animation: pulse-waiting 1.5s ease-in-out infinite;
}

@keyframes pulse-waiting {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.02);
        filter: brightness(1.1);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

/* Animação de pulso sutil para fatia premiada */
@keyframes pulse-slice {
    0% {
        filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.8));
    }
    100% {
        filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.6));
    }
}