:root {
    --bg-dark-blue: #003B5C;    /* Colore sfondo principale */
    --bg-light-blue: #0077A3;   /* Colore box regolamento */
    --accent-orange: #F38B00;   /* Colore testo e bottoni */
    --bg-danger-dark: #8B0000; /* Rosso scuro per errori */
}

body {
    background-color: var(--bg-dark-blue);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    min-height: 100vh;
}

/* Tipografia */
.text-orange {
    color: var(--accent-orange) !important;
}

.main-title {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 22px;
    line-height: 1.4;
}

/* Box Regolamento — usato anche per testo inizio (home) e testo fine (percorso completato) */
.rules-card {
    background-color: var(--bg-light-blue);
    border-radius: 30px; /* Bordi molto arrotondati come nel mockup */
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-size: 22px;
    line-height: 1.4;
}

.rules-list {
    text-align: left;
    font-size: 1.2rem;
    padding-left: 2rem; /* Spazio per i bullet points */
}

.rules-list li {
    margin-bottom: 0.2rem;
}

/* Stile per il messaggio di errore di geolocalizzazione */
.bg-danger-dark {
    background-color: var(--bg-danger-dark);
}


/* Input Code Area */
.input-label {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    display: block;
}

.custom-input-wrapper {
    background: white;
    border-radius: 50px; /* Forma a pillola */
    padding: 5px;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.custom-input {
    border: none;
    box-shadow: none;
    background: transparent;
    font-size: 22px;
    font-weight: 600;
    padding-left: 1.5rem;
    color: black;
    width: 100%;
}

.custom-input:focus {
    outline: none;
    background: transparent;
}

.btn-go {
    background-color: var(--accent-orange);
    color: white;
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0; /* Impedisce al bottone di schiacciarsi */
    transition: transform 0.2s;
}

.btn-go:hover {
    background-color: #d67a00;
    transform: scale(1.05);
    color: white;
}










/* --- Aggiunte per la Vista Domanda --- */

/* Navigazione Superiore (Progress Bar) */
.game-progress-bar {
    display: flex;
    justify-content: flex-start;
    gap: 10px; /* Spazio tra i cerchi */
    padding: 1rem 0;
    margin-bottom: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling su iOS */
    scroll-behavior: smooth;
    white-space: nowrap;
    width: 100%;
    max-width: 400px; /* Stessa larghezza del question-container */
}

.step-circle {
    width: 45px;
    height: 45px;
    min-width: 45px; /* Garantisce larghezza minima */
    margin: 2px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
    background-color: transparent;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Impedisce la riduzione dell'elemento */
}

/* Stato: Completato (Icona Check) */
.step-circle.completed {
    border-color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Stato: Attivo (Cerchio più grande o colorato) */
.step-circle.active {
    border-color: var(--accent-orange);
    color: white;
    transform: scale(1.1); /* Leggermente più grande */
    background-color: var(--bg-dark-blue);
    box-shadow: 0 0 10px rgba(243, 139, 0, 0.4);
    z-index: 2;
}

/* Stato: attualmente visualizzato (domanda passata cliccata, regolamento, ecc.) */
.step-circle.viewing {
    border-color: var(--accent-orange);
    box-shadow: 0 0 10px rgba(243, 139, 0, 0.4);
    z-index: 2;
}

/* Tappa 0: regolamento / schermata iniziale */
.step-circle.regolamento {
    border-color: white;
    background-color: rgba(255, 255, 255, 0.1);
    font-size: 1rem;
}

/* Stato: Bloccato (Lucchetto) */
.step-circle.locked {
    border-style: dashed;
    border-color: rgba(255, 255, 255, 0.35);
    color: rgba(255, 255, 255, 0.6);
}

/* Numero della domanda sempre visibile e ben leggibile */
.step-circle .step-number {
    font-size: calc(1.1rem + 2px);
    font-weight: 700;
    line-height: 1;
    color: inherit;
}

/* Piccolo badge di stato in basso a destra del cerchio */
.step-circle .step-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    line-height: 1;
    border: 2px solid var(--bg-dark-blue, #0b3a66);
    color: white;
}

.step-circle .step-badge-check,
.step-circle .step-badge-lock,
.step-circle .step-badge-penalty,
.step-circle .step-badge-help {
    background-color: white;
    color: var(--bg-dark-blue);
}

/* Contenitore Domanda */
.question-container {
    background-color: var(--bg-light-blue);
    border-radius: 20px; /* Arrotondamento meno accentuato del regolamento */
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
}

.question-title {
    color: var(--accent-orange);
    text-transform: uppercase;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.question-text {
    background-color: transparent;
    color: white;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 1rem 0;
    padding: 0.85rem 1rem;
}

.question-text > p:first-child { margin-top: 0; }
.question-text > p:last-child { margin-bottom: 0; }

.question-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    /* Placeholder style per l'immagine */
    object-fit: cover;
    aspect-ratio: 1/1;
}

/* Bottone Help (ambulanza + "Aiuto") — piccolo, a destra, bianco */
.btn-help {
    background-color: transparent;
    color: white;
    border: none;
    padding: 6px 10px;
    margin-top: 150px; /* distanza dal pulsante risposta */
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    opacity: 0.85;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-help .btn-help-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-help:hover {
    background-color: transparent;
    color: white;
    opacity: 1;
    transform: scale(1.05);
}

/* --- Aggiunte per la Vista Indizio (3° Riquadro) --- */

/* Testo di feedback (es. "Avete risposto correttamente") */
.feedback-text {
    color: white;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

/* Box Bianco dell'Indizio */
.clue-card {
    background-color: white;
    border-radius: 20px; /* Stesso raggio del contenitore padre per armonia */
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    color: var(--bg-dark-blue);
}

.clue-title {
    color: var(--accent-orange);
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.clue-description {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}

.clue-description > p:first-child { margin-top: 0; }
.clue-description > p:last-child { margin-bottom: 0; }
.clue-description p,
.clue-description span,
.clue-description li { font-size: inherit; }

/* Bottone "Prossima Domanda" (Pillola arancione) */
.btn-next-step {
    background-color: var(--accent-orange);
    color: white;
    font-weight: 700;
    text-transform: uppercase;
    padding: 12px 30px;
    border-radius: 50px;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 10px; /* Spazio tra testo e freccia */
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.btn-next-step:hover {
    background-color: #d67a00;
    transform: scale(1.05);
    color: white;
}

/* --- Overlay Modale (4° Riquadro) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 59, 92, 0.85); /* Sfondo blu scuro semi-trasparente */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.custom-modal-card {
    background-color: var(--accent-orange);
    border-radius: 30px;
    padding: 2.5rem 1.5rem;
    width: 100%;
    max-width: 350px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    color: white;
}

.modal-confirm-text {
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.modal-sub-text {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 2rem;
}

/* Bottoni Modale */
.btn-modal-cancel {
    background-color: var(--bg-dark-blue);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 0;
    width: 80%;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
}

.btn-modal-ok {
    background-color: white;
    color: black;
    border: none;
    border-radius: 50px;
    padding: 12px 0;
    width: 80%;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-modal-cancel:hover, .btn-modal-ok:hover {
    opacity: 0.9;
    color: inherit;
}

/* --- Stili per l'ultimo riquadro (Errore) --- */

/* Alert Superiore Arancione */
.alert-error-top {
    background-color: var(--accent-orange);
    color: white;
    width: 100%;
    max-width: 400px;
    border-radius: 20px;
    padding: 1rem 1.5rem;
    margin-bottom: -15px; /* Sovrapposizione parziale con la card sotto */
    position: relative;
    z-index: 5;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.alert-error-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.alert-error-body {
    font-size: 22px;
    line-height: 1.3;
    font-weight: 500;
}

/* Modifica alla card della domanda per lo stato di errore */
.question-container.error-state {
    padding-top: 2rem; /* Spazio extra per l'alert che si sovrappone */
    z-index: 1;
}