html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top, #1e293b, #020617);
    background-image: linear-gradient(rgba(0, 0, 0, .42), rgba(0, 0, 0, .42)), url('/img/trivia/bg.jpg');
    background-size: cover;
    background-position: center;
    color: #fff;
    overflow: hidden;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

#questions-data {
    display: none;
}

.wrap {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 4vw;
    box-sizing: border-box;
    justify-content: space-between;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 4vw;
}

.timer {
    font-weight: 700;
    background: #ffffff22;
    padding: .45em .9em;
    border-radius: 999px;
    font-size: 1.18em;
    box-shadow: 0 0 18px rgba(255, 255, 255, .18);
}

.q {
    font-size: 7vw;
    line-height: 1.15;
    font-weight: 700;
    margin-top: 3vh;
    text-shadow: 0 4px 18px rgba(0, 0, 0, .45);
    opacity: 0;
}

.answers {
    display: grid;
    gap: 1.8vh;
    margin-top: 3vh;
}

.ans {
    padding: 1em;
    border-radius: 18px;
    font-size: 4.8vw;
    line-height: 1.25;
    border: 1px solid #ffffff22;
    transition: all 0.2s ease;
    opacity: 0;
    cursor: pointer;
    user-select: none;
}

    .ans:hover:not(.dimmed):not(.correct) {
        transform: translateY(-2px);
        filter: brightness(1.1);
        box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    }

    .ans:active:not(.dimmed):not(.correct) {
        transform: scale(0.98);
    }

    .ans:nth-child(1) {
        background: #3b82f6;
    }

    .ans:nth-child(2) {
        background: #22c55e;
    }

    .ans:nth-child(3) {
        background: #f59e0b;
    }

    .ans:nth-child(4) {
        background: #ef4444;
    }

    .ans.dimmed {
        background: rgba(255, 255, 255, 0.1) !important;
        opacity: 0.3;
        transform: scale(0.95);
        pointer-events: none;
    }

    .ans.correct {
        background: #22c55e !important;
        box-shadow: 0 0 25px #22c55e;
        transform: scale(1.05);
        z-index: 2;
        border-color: #fff;
        opacity: 1;
        pointer-events: none;
        animation: successPulse 0.5s ease infinite alternate;
    }

@keyframes successPulse {
    from {
        box-shadow: 0 0 10px #22c55e;
    }

    to {
        box-shadow: 0 0 25px #22c55e;
    }
}

.bar {
    height: 10px;
    background: #ffffff22;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 2vh;
}

.fill {
    height: 100%;
    width: 100%;
    background: #22c55e;
    transition: width .1s linear, background .3s;
}

.danger {
    background: #ef4444 !important;
}

.start {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000a;
    z-index: 10;
}

button {
    font-size: 6vw;
    padding: .7em 1.2em;
    border: none;
    border-radius: 18px;
    cursor: pointer;
    background: #fff;
    color: #000;
    font-weight: bold;
}

@media(min-width:800px) {
    .wrap {
        padding: 30px;
        max-width: 800px;
        margin: auto;
    }

    .q {
        font-size: 42px;
    }

    .ans {
        font-size: 26px;
    }

    .top {
        font-size: 24px;
    }

    button {
        font-size: 28px;
    }
}

.showQ {
    animation: pop .45s ease forwards;
}

.showA {
    animation: slideIn .45s ease forwards;
}

.fadeOut {
    opacity: 0;
    transform: translateX(-20px);
    transition: .35s;
}

@keyframes pop {
    0% {
        transform: scale(.6);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideIn {
    0% {
        transform: translateY(40px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    50% {
        transform: translateX(3px);
    }

    75% {
        transform: translateX(-3px);
    }
}

.shake {
    animation: shake .25s linear infinite;
}

.panic {
    animation: zoomPanic .35s alternate infinite;
}

@keyframes zoomPanic {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.03);
    }
}

.devil {
    animation: devilbg 1.2s linear infinite alternate;
}

@keyframes devilbg {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(35deg);
    }
}

.particles {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: .12;
    background-image: radial-gradient(#fff 1px, transparent 1px);
    background-size: 22px 22px;
    animation: drift 8s linear infinite;
}

@keyframes drift {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(22px);
    }
}

.cta {
    font-size: 8vw;
    font-weight: 700;
    text-align: center;
    animation: pop .5s ease forwards;
    text-shadow: 0 0 18px #fff5;
}


#score-display {
    background: rgba(34, 197, 94, 0.2); /* ירקרק שקוף */
    color: #22c55e;
    border: 1px solid #22c55e44;
    min-width: 60px;
    text-align: center;
}

/* עיצובים לדף הסיום */
.end-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 15px;
    text-align: center;
    height: 100%;
    max-width: 600px; /* מגביל את הרוחב כדי שלא ימרח במחשב */
    margin: 0 auto;
}

.end-title {
    font-size: clamp(24px, 8vw, 42px); /* מינימום 24, מקסימום 42 */
}

.end-score {
    font-size: clamp(48px, 14vw, 80px); /* מגביל את גודל הניקוד */
    color: #22c55e;
    margin: 10px 0;
    font-weight: 800;
}

.btn-download {
    background: #22c55e;
    color: #fff;
    padding: 18px 30px;
    border-radius: 50px;
    font-size: clamp(18px, 5vw, 24px); /* גודל כפתור שפוי */
    box-shadow: 0 4px 15px rgba(34,197,94,0.4);
    text-decoration: none;
    display: inline-block;
    animation: pulseHook 1s ease infinite;
}

.btn-retry {
    font-size: clamp(14px, 4vw, 18px);
    cursor: pointer;
    color: #aaa;
    margin-top: 10px;
    text-transform: uppercase;
}
