/* Reset e Variabili Globali */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --primary-color: #8b5cf6;
    --primary-hover: #7c3aed;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --error-color: #ef4444;
    --success-color: #22c55e;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Navbar */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background-color: rgba(30, 41, 59, 0.5);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid #334155;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
}

nav a {
    color: var(--text-muted);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--text-color);
}

/* Main Layout */
main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.container {
    width: 100%;
    max-width: 600px;
    background-color: var(--card-bg);
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    text-align: center;
}

/* Typography */
h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

p.description {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* Form e Inputs */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

select, input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

select:focus, input[type="number"]:focus {
    border-color: var(--primary-color);
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    background-color: #0f172a;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #334155;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
}

/* Bottoni */
.btn-submit {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
    text-decoration: none;
    display: inline-block;
}

.btn-submit:hover {
    background-color: var(--primary-hover);
}

.btn-submit:active {
    transform: scale(0.98);
}

/* Interfaccia di Gioco */
.quiz-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.question-box {
    background-color: #0f172a;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 1px solid #334155;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media(max-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-btn {
    padding: 1rem;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 6px;
    color: var(--text-color);
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
    text-align: center;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background-color: rgba(139, 92, 246, 0.1);
}

/* Stati di Errore */
.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}
.icon-red { color: var(--error-color); }
.icon-orange { color: #f97316; }

.btn-retry {
    margin-top: 1.5rem;
    background-color: #334155;
}
.btn-retry:hover {
    background-color: #475569;
}

/* Animazione Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 6px;
    border: none !important;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-text {
    height: 24px;
    width: 80%;
    margin: 0 auto;
}

.skeleton-btn {
    height: 50px;
    width: 100%;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid #334155;
}
