html, body {
    height: 100%;
    overflow: hidden;
    touch-action: manipulation;
}
body {
    background: #f7f7f7;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}
.main-flex {
    display: flex;
    flex-direction: row;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}
.container {
    flex: 1 1 0;
    max-width: 600px;
    margin: 80px auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 18px rgba(0,0,0,0.10);
    padding: 40px 20px 40px 20px;
    text-align: center;
    position: relative;
}
#word {
    font-size: 3em;
    margin: 40px 0 40px 0;
    color: #2a4d8f;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
}
#feedback {
    font-size: 1.2em;
    margin: 40px 0 40px 0;
    min-height: 48px;
    text-transform: uppercase;
}
.container.start-mode {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
    height: 100vh;
    width: 100%;
    max-width: 600px;
    background: #fff;
    box-shadow: 0 2px 18px rgba(0,0,0,0.10);
    border-radius: 18px;
    margin: 0 auto;
    padding: 0;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}
.start-text {
    font-size: 1.2em;
    font-weight: bold;
    color: #fff;
    background: #1e88e5;
    border-radius: 32px;
    width: 95%;
    max-width: 520px;
    height: 220px;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    text-align: center;
    letter-spacing: 2px;
    line-height: 1.1;
    margin: 0 auto;
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
    transition: background 0.2s, filter 0.1s;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    cursor: pointer;
}
.start-text:active, .start-text.touched {
    background: #1565c0 !important;
    filter: brightness(0.85);
}
.start-text span {
    display: block;
    width: 100%;
}
#start-btn, #next-btn, #replay-btn, #change-btn {
    font-size: 1.4em;
    min-height: 56px;
    padding: 16px 0;
    margin: 24px 0 0 0;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.15);
    border: none;
    background: #1e88e5;
    color: #fff;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
#start-btn span, #next-btn span {
    display: block;
    width: 100%;
}
#start-btn:active, #start-btn.touched, #next-btn:active {
    background: #1565c0;
    transform: scale(0.97);
}
#start-btn:disabled {
    background: #b0b0b0;
    color: #eee;
    cursor: not-allowed;
    opacity: 0.7;
    box-shadow: none;
}
#start-btn.hide {
    display: none !important;
}

/* Griglia 2x2 per la home */
.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 32px;
    height: 100vh;
    max-height: 100vh;
    width: 100vw;
    box-sizing: border-box;
    padding: 48px 16px 48px 16px;
    overflow: hidden;
    background: #f7f7f7;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.grid-btn {
    font-size: 4.4em;
    font-weight: bold;
    border: none;
    border-radius: 24px;
    color: #fff;
    width: 85%;
    height: 85%;
    cursor: pointer;
    transition: background 0.08s, transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 18px rgba(0,0,0,0.10);
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    text-transform: uppercase;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    margin: auto;
}
.grid-btn:active, .grid-btn.touched, .grid-btn:focus {
    filter: brightness(0.85);
    background: #222 !important;
    outline: 3px solid #fff;
    outline-offset: -6px;
}
.apprendimento {
    background: #e53935; /* rosso */
}
.leggi {
    background: #1e88e5; /* blu */
}
.extra1 {
    background: #fbc02d; /* giallo */
    color: #333;
}
.extra2 {
    background: #43a047; /* verde */
}
.side-menu {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 32px;
    padding: 32px 16px 32px 8px;
    background: transparent;
    min-width: 260px;
    max-width: 320px;
    height: 100vh;
    box-sizing: border-box;
}
.side-btn {
    font-size: 1.2em;
    min-height: 48px;
    margin-bottom: 16px;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border: none;
    color: #fff;
    background: #888;
    padding: 36px 0;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    cursor: pointer;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.side-btn.home { background: #222; }
.side-btn.apprendimento { background: #e53935; }
.side-btn.leggi { background: #1e88e5; }
.side-btn.extra1 { background: #fbc02d; color: #333; }
.side-btn.extra2 { background: #43a047; }
.side-btn.statistiche { background: #6c47ff; color: #fff; }
.side-btn:active, .side-btn:focus, .side-btn.touched {
    filter: brightness(0.85);
    outline: 3px solid #fff;
    outline-offset: -4px;
}
.side-btn:last-child {
    margin-bottom: 0;
}
@media (max-width: 900px) {
    .main-flex {
        flex-direction: column;
    }
    .side-menu {
        flex-direction: row;
        gap: 12px;
        min-width: 0;
        max-width: 100vw;
        height: auto;
        padding: 8px 4px;
        justify-content: flex-start;
        align-items: center;
    }
    .side-btn {
        font-size: 1em;
        min-height: 40px;
        margin-bottom: 10px;
        border-radius: 10px;
    }
}
@media (max-width: 700px) {
    .container {
        padding: 16px 2vw 16px 2vw;
        margin: 12px auto;
    }
    #word {
        font-size: 2em;
        margin: 20px 0 20px 0;
    }
    #feedback {
        font-size: 1em;
        margin: 18px 0 18px 0;
    }
    #start-btn, #next-btn, #replay-btn, #change-btn {
        font-size: 1.1em;
        min-height: 40px;
        padding: 10px 0;
        margin: 14px 0 0 0;
        border-radius: 10px;
    }
    .grid-container {
        padding: 8px;
        gap: 10px;
    }
    .grid-btn {
        font-size: 2.4em;
        border-radius: 12px;
    }
    .side-btn {
        font-size: 1em;
        min-height: 32px;
        margin-bottom: 6px;
        border-radius: 8px;
    }
} 
.dash-statistiche { background: #6c47ff; color: #fff; } 