* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #fafafa;
    color: #333;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    height: 100%;
    max-width: 100vw;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
    border: 1px solid #d0d0d0;
    background-color: #ffffff;
    position: relative;
}

/* Header con controlli */
.header {
    padding: 20px 30px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.how-to-play-button {
    padding: 8px 16px;
    font-size: 14px;
    border: 2px solid #333;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.how-to-play-button:hover {
    background-color: #333;
    color: #ffffff;
}

.how-to-play-button:active {
    transform: scale(0.98);
}

.controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.language-select {
    padding: 8px 12px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.language-select,
.category-select {
    padding: 8px 12px;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.language-select:hover,
.category-select:hover {
    border-color: #999;
}

.language-select:focus,
.category-select:focus {
    outline: none;
    border-color: #333;
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
}

.question-wrapper {
    text-align: center;
    max-width: 80%;
    animation: fadeInBlurZoom 1.8s ease-out;
}

@keyframes fadeInBlurZoom {
    from {
        opacity: 0;
        filter: blur(12px);
        transform: scale(2);
    }
    to {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
}

.question {
    font-size: clamp(24px, 5vw, 48px);
    font-weight: 300;
    line-height: 1.6;
    color: #666;
    letter-spacing: 0.5px;
    font-family: 'Georgia', 'Garamond', serif;
    margin-bottom: 20px;
}

.question-type {
    font-size: 14px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Footer con pulsante */
.footer {
    padding: 30px;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: center;
    align-items: center;
}

.next-button {
    padding: 12px 40px;
    font-size: 16px;
    border: 2px solid #333;
    background-color: #ffffff;
    color: #333;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.next-button:hover {
    background-color: #333;
    color: #ffffff;
}

.next-button:active {
    transform: scale(0.98);
}

/* Responsive */
@media (max-width: 768px) {
    .header {
        padding: 15px 20px;
        flex-wrap: nowrap;
        gap: 15px;
    }

    .how-to-play-button {
        padding: 6px 12px;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .controls {
        gap: 10px;
        flex-shrink: 1;
        min-width: 0;
    }

    .language-select,
    .category-select {
        min-width: 0;
        flex: 1;
    }

    .main-content {
        padding: 30px 20px;
    }

    .question-wrapper {
        max-width: 95%;
    }

    .question {
        font-size: clamp(18px, 4vw, 32px);
    }

    .footer {
        padding: 20px;
    }

    .next-button {
        padding: 10px 30px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .container {
        border: none;
    }

    .header {
        padding: 12px 15px;
        gap: 10px;
    }

    .how-to-play-button {
        padding: 6px 10px;
        font-size: 11px;
    }

    .controls {
        gap: 8px;
    }

    .language-select,
    .category-select {
        padding: 6px 8px;
        font-size: 12px;
    }

    .main-content {
        padding: 20px 15px;
    }

    .question {
        font-size: clamp(20px, 5vw, 32px);
    }

    .question-type {
        font-size: 16px;
    }

    .footer {
        padding: 20px;
    }

    .next-button {
        padding: 14px 35px;
        font-size: 16px;
    }
}

/* Modal istruzioni */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.4s ease;
    overflow-y: auto;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background-color: #ffffff;
    padding: 40px;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.4s ease;
    margin: auto;
}

.modal.show .modal-content {
    transform: scale(1);
}

body.modal-open {
    overflow: hidden;
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.close-button:hover {
    color: #333;
}

.modal-content h2 {
    font-size: 28px;
    margin-bottom: 25px;
    color: #333;
    font-weight: 500;
}

.instructions p {
    font-size: 16px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

.instructions p:last-child {
    margin-bottom: 0;
}

.instructions strong {
    color: #333;
    font-weight: 600;
}

.rules {
    margin: 25px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #333;
}

.rules p {
    text-align: center;
    margin-bottom: 15px;
    font-size: 16px;
}

.rules p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .modal-content {
        padding: 30px;
        max-width: 90%;
    }

    .modal-content h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .instructions p {
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 25px;
        width: 95%;
    }

    .modal-content h2 {
        font-size: 22px;
        margin-bottom: 18px;
    }

    .instructions p {
        font-size: 14px;
    }

    .close-button {
        font-size: 28px;
        top: 10px;
        right: 15px;
    }
}

