body {
    margin: 0;
    min-height: 100vh;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 18px;
    padding: 24px;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #7c3aed, #2563eb, #0f766e);
    color: #f9fafb;
    overflow-x: hidden;
}

body > :not(script) {
    width: 100%;
    max-width: 540px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

script {
    display: none !important;
}

.question-box,
#answers,
.buttons {
    margin-left: auto;
    margin-right: auto;
}

h1 {
    margin: 0 0 24px 0;
    font-size: 2.3rem;
    font-weight: 800;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.question-box {
    width: min(100%, 420px);
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.16);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
    box-sizing: border-box;
}

h2 {
    margin: 0;
    text-align: center;
    width: 100%;
    font-size: 1.15rem;
    line-height: 1.4;
}

#result {
    min-height: 24px;
    font-weight: 800;
    color: #fef3c7;
    font-size: 1.05rem;
    margin: 0;
    text-align: center;
    width: 100%;
    letter-spacing: 0.04em;
}

#answers {
    display: grid;
    grid-template-columns: repeat(2, minmax(180px, 240px));
    gap: 16px;
    width: 100%;
    max-width: 540px;
}

#answers button {
    border: none;
    border-radius: 16px;
    padding: 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #111827;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    position: relative;
    overflow: visible;
    box-sizing: border-box;
}

#answers button::before {
    content: attr(data-feedback);
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translate(-50%, 100%);
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #ffffff;
    background: rgba(17, 24, 39, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    z-index: 5;
}

#answers button:nth-child(1)::before,
#answers button:nth-child(2)::before {
    bottom: auto;
    top: -12px;
    transform: translate(-50%, -100%);
}

#answers button.show-feedback::before {
    opacity: 1;
}

#answers button.correct-choice::before {
    background: #22c55e;
}

#answers button.wrong-choice::before {
    background: #ef4444;
}

#answers button:nth-child(1) { background: #fef3c7; }
#answers button:nth-child(2) { background: #dbeafe; }
#answers button:nth-child(3) { background: #dcfce7; }
#answers button:nth-child(4) { background: #ffe4e6; }

#answers button:hover:not(:disabled) {
    transform: translateY(-4px);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.22);
}

#answers button:disabled {
    cursor: not-allowed;
    opacity: 0.95;
}

.buttons {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

#nextBtn,
#restartBtn {
    border: none;
    border-radius: 999px;
    padding: 10px 22px;
    font-weight: 700;
    cursor: pointer;
    background: #111827;
    color: #ffffff;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

#nextBtn:hover,
#restartBtn:hover {
    transform: translateY(-2px);
    opacity: 0.95;
}

@media (max-width: 600px) {
    body {
        padding: 16px;
    }

    #answers {
        grid-template-columns: 1fr;
    }
}