/* ================= GLOBAL ================= */
body {
    font-family: 'Poppins', Arial, sans-serif;
    background: #f3f6fb;
    margin: 0;
    padding: 0;
    color: #1f2937;
}

/* ================= MAIN WRAPPER ================= */
.mainsec {
    max-width: 1100px;
    margin: 40px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 35px rgba(0,0,0,0.08);
    text-align: center;
}

/* ================= HEADING ================= */
h2 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #0f172a;
}

/* ================= TIMER ================= */
#timer {
    display: inline-block;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #b91c1c;
    background: #fee2e2;
    padding: 10px 18px;
    border-radius: 10px;
}

/* ================= BUTTONS ================= */
.top-buttons {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 30px;
}

.top-buttons button {
    padding: 10px 22px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
}

/* Refresh */
#refreshBtn {
    background: #dcfce7;
    color: #166534;
}
#refreshBtn:hover {
    background: #bbf7d0;
}

/* Submit */
#submitBtn {
    background: #2563eb;
    color: #ffffff;
}
#submitBtn:hover {
    background: #1e40af;
}

/* ================= GRID ================= */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 18px;
    width: 100%;
    margin: 0 auto;
}

/* ================= QUESTION BOX ================= */
.question-box {
    background: #f8fafc;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: inset 0 0 0 1px #e5e7eb;
    font-size: 18px;
}

/* Question text */
.question-box span {
    font-weight: 600;
    color: #111827;
}

/* ================= INPUT ================= */
.question-box input {
    width: 65px;
    height: 34px;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid #cbd5f5;
    text-align: center;
    outline: none;
    transition: 0.2s ease;
}

.question-box input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37,99,235,0.2);
}

/* ================= FOOT NOTE ================= */
.mainsec::after {
    content: "⏱ Solve quickly. Accuracy matters more than speed.";
    display: block;
    margin-top: 30px;
    font-size: 13px;
    color: #6b7280;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .mainsec {
        padding: 25px;
        margin: 20px;
    }

    h2 {
        font-size: 24px;
    }

    #timer {
        font-size: 18px;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }

    .question-box {
        font-size: 16px;
    }

    .question-box input {
        width: 55px;
        font-size: 15px;
    }
}

/* ================= RESULT BOX ================= */
.result-box {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8fafc, #eef2ff);
    border-radius: 18px;
    border: 1px solid #e5e7eb;
}

.result-box h3 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 25px;
    color: #0f172a;
}

/* ================= RESULT GRID ================= */
.result-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* ================= RESULT CARD ================= */
.result-item {
    background: #ffffff;
    padding: 22px;
    border-radius: 14px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.06);
    text-align: center;
    transition: transform 0.2s ease;
}

.result-item:hover {
    transform: translateY(-3px);
}

.result-item span {
    display: block;
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.result-item strong {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
}

/* ================= STATUS COLORS ================= */
.result-item.correct strong {
    color: #16a34a;
}

.result-item.wrong strong {
    color: #dc2626;
}

/* ================= FULL WIDTH ================= */
.result-item.full {
    grid-column: span 4;
    background: #0f172a;
}

.result-item.full span,
.result-item.full strong {
    color: #ffffff;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 768px) {
    .result-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-item.full {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-item.full {
        grid-column: span 1;
    }
}
