* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #eeedee;
    font-family: "Poppins", sans-serif;
}

.quiz-page {
    width: 100%;
    min-height: 100vh;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Quiz Start */

.quiz-start {
    width: 100%;
    max-width: 850px;
}

.quiz-start-card {
    width: 100%;
    padding: 45px;
    background: #f9f9fa;
    border-radius: 20px;
    text-align: center;
}

.quiz-label {
    display: block;
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #5865FF;
}

.quiz-start-card h1 {
    margin: 0;
    font-size: 36px;
    background: linear-gradient(90deg, #b36bff, #5865FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-information {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.quiz-info-item {
    min-width: 180px;
    padding: 18px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.info-title {
    font-size: 13px;
    color: #888;
}

.info-value {
    font-size: 18px;
    font-weight: 600;
    color: #222;
}

.quiz-description {
    margin: 30px auto;
    max-width: 550px;
    color: #777;
    line-height: 1.6;
}

.last-score {
    display: none;
    margin: 20px auto;
    padding: 12px 18px;
    max-width: 350px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    color: #666;
    font-size: 14px;
}

.last-score strong {
    color: #5865FF;
}

.start-quiz-button,
.next-button,
.return-button {
    border: none;
    padding: 14px 30px;
    border-radius: 10px;
    background: linear-gradient(90deg, #b36bff, #5865FF);
    color: white;
    font-family: "Poppins", sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.start-quiz-button:hover,
.next-button:hover,
.return-button:hover {
    transform: translateY(-2px);
}


/* Attempt History */

.attempt-history {
    margin-top: 35px;
    padding-top: 30px;
    border-top: 1px solid #e5e5e5;
    text-align: left;
}

.attempt-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.attempt-history-header > div {
    display: flex;
    flex-direction: column;
}

.history-label {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #5865FF;
}

.attempt-history-header h3 {
    margin: 0;
    color: #222;
    font-size: 20px;
}

.attempt-count {
    padding: 6px 12px;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 20px;
    color: #777;
    font-size: 12px;
    white-space: nowrap;
}

.attempt-table-wrapper {
    width: 100%;
    overflow-x: auto;
    background: white;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
}

.attempt-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.attempt-table th {
    padding: 13px 15px;
    background: #f5f5f7;
    color: #777;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
}

.attempt-table td {
    padding: 14px 15px;
    border-top: 1px solid #eeeeee;
    color: #666;
    font-size: 13px;
}

.attempt-table td strong {
    color: #333;
}

.attempt-number {
    font-weight: 600;
    color: #333;
}

.latest-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 3px 7px;
    background: #eeeaff;
    border-radius: 6px;
    color: #5865FF;
    font-size: 10px;
    font-weight: 600;
}

.attempt-table tr.latest-attempt td {
    background: #faf9ff;
}


/* Quiz */

.quiz-container {
    display: none;
    width: 100%;
    max-width: 850px;
}

.quiz-header {
    margin-bottom: 20px;
    padding: 25px;
    background: #f9f9fa;
    border-radius: 18px;
}

.quiz-header h2 {
    margin: 0;
    color: #222;
    font-size: 22px;
}

.quiz-hp {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hp-label {
    font-size: 13px;
    font-weight: 700;
    color: #5865FF;
}

.hp-bar {
    flex: 1;
    height: 14px;
    background: #e5e5e5;
    border-radius: 20px;
    overflow: hidden;
}

.hp-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #b36bff, #5865FF);
    border-radius: 20px;
    transition: width 0.3s ease;
}

.hp-value {
    min-width: 55px;
    font-size: 13px;
    font-weight: 600;
    color: #555;
}

.question-card {
    padding: 35px;
    background: #f9f9fa;
    border-radius: 18px;
}

.question-card h2 {
    margin: 0 0 30px;
    color: #222;
    font-size: 23px;
    line-height: 1.5;
}

.identification-answer {
    width: 100%;
}

.identification-answer input {
    width: 100%;
    padding: 18px 20px;
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    outline: none;
    font-family: "Poppins", sans-serif;
    font-size: 16px;
    color: #333;
    transition: 0.2s ease;
}

.identification-answer input:focus {
    border-color: #5865FF;
    box-shadow: 0 0 0 3px rgba(88, 101, 255, 0.08);
}

.identification-answer input::placeholder {
    color: #aaa;
}

.quiz-navigation {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}


/* Exit Quiz */

.exit-quiz-button {
    display: block;
    margin: 15px auto 0;
    padding: 8px 15px;
    border: none;
    background: transparent;
    color: #888;
    font-family: "Poppins", sans-serif;
    font-size: 13px;
    cursor: pointer;
    transition: 0.2s ease;
}

.exit-quiz-button:hover {
    color: #5865FF;
}


/* Exit Modal */

.exit-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.35);
}

.exit-modal-card {
    width: 100%;
    max-width: 420px;
    padding: 35px;
    background: #f9f9fa;
    border-radius: 18px;
    text-align: center;
}

.exit-modal-label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.3px;
    color: #5865FF;
}

.exit-modal-card h2 {
    margin: 0 0 12px;
    color: #222;
    font-size: 26px;
}

.exit-modal-card p {
    margin: 0 auto 25px;
    color: #777;
    font-size: 14px;
    line-height: 1.6;
}

.exit-modal-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.cancel-exit-button,
.confirm-exit-button {
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    font-family: "Poppins", sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}

.cancel-exit-button {
    background: #e9e9eb;
    color: #555;
}

.cancel-exit-button:hover {
    background: #dedee1;
}

.confirm-exit-button {
    background: linear-gradient(90deg, #b36bff, #5865FF);
    color: white;
}

.confirm-exit-button:hover {
    transform: translateY(-2px);
}


/* Result */

.quiz-result {
    display: none;
    width: 100%;
    max-width: 650px;
}

.quiz-result-card {
    padding: 45px;
    background: #f9f9fa;
    border-radius: 20px;
    text-align: center;
}

.quiz-result-card h1 {
    margin: 0 0 25px;
    font-size: 34px;
    color: #222;
}

.score-circle {
    width: 180px;
    height: 180px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(90deg, #b36bff, #5865FF);
    display: flex;
    justify-content: center;
    align-items: center;
}

.score-circle > div {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: #f9f9fa;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.score-circle strong {
    font-size: 28px;
    color: #222;
}

.score-circle span {
    font-size: 13px;
    color: #888;
}

.quiz-result-card h2 {
    margin: 20px 0 5px;
    font-size: 30px;
    background: linear-gradient(90deg, #b36bff, #5865FF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.quiz-result-card p {
    color: #777;
}


/* Mobile */

@media (max-width: 600px) {

    .quiz-page {
        padding: 20px;
    }

    .quiz-start-card,
    .question-card,
    .quiz-result-card {
        padding: 25px;
    }

    .quiz-start-card h1 {
        font-size: 28px;
    }

    .quiz-information {
        flex-direction: column;
    }

    .quiz-hp {
        flex-wrap: wrap;
    }

    .attempt-history-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .attempt-count {
        align-self: flex-start;
    }

    .exit-modal-actions {
        flex-direction: column;
    }

    .cancel-exit-button,
    .confirm-exit-button {
        width: 100%;
    }

}