@font-face {
    font-family: 'Chronic';
    src: url('Chronic-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

body {
    font-family: 'Chronic', Arial, sans-serif;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: url('bg-schermate-vertical.png') center center / cover no-repeat;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: none;
}

/* Logo container styles */
.logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom:20px;
}

.logo-container .maxibon-logo {
    max-width: 180px;
    transform: rotate(8deg);
}

.logo-container .campaign-logo {
    max-width: 230px;
}

/* Step 1 - Welcome Screen */
.step-1 {
    padding: 10px;
    text-align: center;
    position: relative;
}

.step-1 .logo-container {
    margin-top: 10px;
}

.step-1 .start-button {
    text-align:center;
    margin: 30px 0;
}

.lorem-text {
    color: white;
    font-size: 28px;
    line-height: 1.2;
    max-width: 95%;
    margin: 2px auto;
    text-align: center;
}

/* Step 2 - Wheel Screen */
.step-2 {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 10px;
}

.wheel-header {
    position: relative;
    margin-top: 0px;
    text-align: center;
    width: 100%;
}

.wheel-header-result {
    position: absolute;
    top: 15px; /* Ridotto da 20px a 15px */
    text-align: center;
    width: 100%;
}

.wheel-header img {
    width: 90%;
    max-width: 300px;
    height: auto;
}

.wheel-instruction {
    color: white;
    font-size: 22px;
    text-align: center;
    margin: 30px 20px 20px 20px;
    padding: 0px;
    line-height: 1.5;
}

.wheel-container {
    position: relative;
    width: 100vw;
    height: 100vw;
    max-width: 400px;
    max-height: 400px;
    margin: 0 0 40px 0;
}

#wheelCanvas {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    cursor: grab;
    touch-action: none;
}

#wheelCanvas.grabbing {
    cursor: grabbing;
}

/* Center image fixed */
.center-image-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26%;
    height: 26%;
    border-radius: 50%;
    background: #E91E63;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.center-image {
    width: 140%;
    height: 140%;
    object-fit: contain;
}

/* --- FRECCIA CORRETTA --- */
.arrow {
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%) rotate(180deg);
    width: 40px;
    height: 40px;
    z-index: 15;
    filter: drop-shadow(0px 4px 6px rgba(0, 0, 0, 0.4));
}

.arrow::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 20px 0 20px 20px;
    border-color: transparent transparent transparent white;
    top: 0;
    left: 0;
}

.arrow::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 40px;
    background-color: white;
    top: 0;
    left: -15px;
}

/* Step 3 - Result Overlay */
.result-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1)),  url('bg-schermate-vertical.png') center center / cover no-repeat; */
    background: rgba(30, 58, 101, 0.9);

    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.result-content {
    position: relative;
    top: 60px; /* Ridotto da 90px a 60px per diminuire lo spazio */
    background: transparent;
    border-radius: 20px;
    padding: 10px;
    max-width: 90%;
    max-width: 400px;
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.result-title {
    color: #E30075;
    font-size: 34px;
    font-weight: bold;
    margin-bottom: 20px;
}

.result-message {
    color: #FFF;
    font-size: 26px;
    line-height: 1.1;
    margin-bottom: 50px;
}

/* Stile per il risultato senza titolo */
.result-content.no-title {
    top: 40px; /* Riduce ulteriormente lo spazio quando non c'è il titolo */
}

.result-content.no-title .result-message {
    margin-top: 15px; /* Ridotto da 30px a 15px */
    font-size: 30px;  /* Più grande quando non c'è il titolo */
    line-height: 1.3;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 40px; 
    height: 40px; 
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 150;
}

/* Button styles */
.start-button, .back-button {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0;
    cursor: pointer;
    display: inline-block;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.start-button img, .back-button img {
    display: block;
    height: auto;
    width: 200px;
}

.start-button:active img, .back-button:active img {
    transform: scale(0.95);
}

/* PWA Specific Styles */
@media (display-mode: standalone) {
    body {
        -webkit-user-select: none;
        user-select: none;
        -webkit-touch-callout: none;
        -webkit-text-size-adjust: none;
    }
}

/* iOS PWA Support */
@media (display-mode: standalone) {
    /* Nasconde la barra di stato su iOS quando in modalità standalone */
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Migliora l'aspetto del pulsante install su iOS */
#installBtn small {
    display: block;
    font-size: 10px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Animazione per il modal iOS */
#iosInstructions {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Splash screen styling for PWA */
@media (prefers-color-scheme: dark) {
    .step-1, .step-2, .result-overlay {
        background-color: #1a1a1a;
    }
}

/* Touch improvements for mobile */
button, .wheel-container {
    touch-action: manipulation;
}

/* Prevent zoom on double tap */