* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    background-color: #fff;
    color: #000;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#quiz-section {
    max-width: 800px;
    margin: 0 auto;
}

#input-section {
    max-width: 800px;
    margin: 0 auto;
}

h1, h2 {
    text-align: center;
    margin-bottom: 20px;
}

.input-prompt {
    text-align: center;
    margin-bottom: 20px;
}

.instruction {
    font-size: 1.2em;
    font-weight: bold;
    margin: 20px 0;
}

.question {
    margin-bottom: 20px;
}

.question p {
    margin-bottom: 10px;
    font-weight: bold;
}

.question-number {
    display: inline;
    font-weight: bold;
    padding-right: 10px;
}

.option-a {
    padding-left: 0;
}

.option-b {
    padding-left: 25px;
}

.question label {
    display: block;
    margin: 5px 0;
}

#code-form {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 30px;
}

.code-input {
    width: 100px;
    padding: 8px;
    font-size: 16px;
    text-align: center;
    text-transform: uppercase;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 10px 20px;
    background-color: #333;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

button:hover {
    background-color: #555;
}

.error {
    color: red;
    text-align: center;
    margin-top: 10px;
}

.hidden {
    display: none;
}

#loading.hidden {
    display: none !important;
}

#loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.loader {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #333;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

th, td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f9f9f9;
}

img {
    max-width: 50px;
    height: auto;
    display: block;
}

td[data-label="Cover"] a {
    display: block;
    text-decoration: none;
}

td[data-label="Cover"] img {
    transition: opacity 0.2s ease;
}

td[data-label="Cover"] img:hover {
    opacity: 0.8;
    cursor: pointer;
}

#pagination {
    text-align: center;
    margin-bottom: 20px;
}

#pagination button {
    margin: 0 5px;
}

#pagination button.active {
    background-color: #333;
    color: #fff;
}

.question.error {
    border-left: 3px solid red;
    padding-left: 10px;
}

.code {
    font-size: 1.5em;
    font-weight: bold;
    display: inline-block;
    margin: 0 5px;
}

@media (max-width: 768px) {
    #code-form {
        flex-direction: column;
        align-items: center;
        margin-bottom: 10px;
    }

    .code-input {
        width: 150px;
    }

    .question label {
        font-size: 1em;
    }

    td, td:before {
        font-size: 18px;
    }

    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead {
        display: none;
    }

    tr {
        margin-bottom: 15px;
        border-bottom: 2px solid #ddd;
    }

    td {
        display: flex;
        justify-content: space-between;
        padding: 5px;
    }

    td:before {
        content: attr(data-label);
        font-weight: bold;
        width: 100px;
    }

    td[data-label="Description"]:before {
        content: none;
    }

    img {
        max-width: 100px;
    }

    .container, #quiz-section, #input-section {
        padding: 10px;
        max-width: 100%;
    }

    .input-prompt {
        text-align: left;
    }
}