/* =========================================================
   RADIOACTIVE ISOTOPE QUIZ
   ========================================================= */

.isotope-quiz {
    margin-top: 70px;
    padding-top: 50px;

    border-top:
        1px solid
        rgba(238, 172, 96, 0.18);
}


.isotope-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;

    gap: 24px;

    margin-bottom: 28px;
}


.isotope-quiz-header h2 {
    margin: 6px 0 8px;

    color: #fff;

    font-size:
        clamp(2rem, 4vw, 3.3rem);

    line-height: 1.05;
}


.isotope-quiz-header p {
    max-width: 720px;

    margin: 0;

    color:
        var(--color-text-muted);

    line-height: 1.6;
}


.isotope-quiz-score-card {
    min-width: 150px;

    padding: 12px 16px;

    border:
        1px solid
        rgba(238, 172, 96, 0.3);

    border-radius: 12px;

    background:
        rgba(20, 15, 12, 0.82);

    text-align: right;
}


.isotope-quiz-score-card span,
.isotope-quiz-score-card strong {
    display: block;
}


.isotope-quiz-score-card span {
    color:
        var(--color-text-muted);

    font-size: 11px;
}


.isotope-quiz-score-card strong {
    margin-top: 4px;

    color: #ffd39a;
}


.isotope-quiz-board {
    display: grid;

    grid-template-columns:
        minmax(260px, 1fr)
        150px
        minmax(260px, 1fr);

    gap: 20px;

    align-items: center;
}


.isotope-quiz-nucleus-card {
    padding: 18px;

    border:
        1px solid
        rgba(238, 172, 96, 0.25);

    border-radius: 16px;

    background:
        rgba(20, 15, 12, 0.82);

    text-align: center;
}


.isotope-quiz-nucleus-card h3 {
    margin: 8px 0 10px;

    color: #fff;

    font-size: 20px;
}


.isotope-quiz-nucleus-stage {
    position: relative;

    width:
        min(100%, 300px);

    aspect-ratio: 1 / 1;

    margin:
        12px auto 16px;

    overflow: hidden;

    border:
        1px solid
        rgba(238, 172, 96, 0.12);

    border-radius: 50%;

    background:
        radial-gradient(
            circle at center,
            rgba(238, 172, 96, 0.11) 0%,
            rgba(238, 172, 96, 0.035) 48%,
            transparent 72%
        );
}

.isotope-quiz-nucleus-stage
.nucleus-builder-particles {
    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;
}

/* Shared by Build a Nucleus and Isotope Quiz */
.nucleus-builder-particles {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    pointer-events: none;
}


.nucleus-builder-particle {
    position: absolute;
    display: block;

    border-radius: 50%;

    transform:
        translate(-50%, -50%);

    box-shadow:
        inset -3px -3px 5px
        rgba(0, 0, 0, 0.3),
        0 2px 7px
        rgba(0, 0, 0, 0.3);
}


.nucleus-builder-particle.proton {
    background:
        radial-gradient(
            circle at 35% 30%,
            #ffb0a4,
            #dc5549 60%,
            #8f2922
        );
}


.nucleus-builder-particle.neutron {
    background:
        radial-gradient(
            circle at 35% 30%,
            #b8d7ff,
            #5c8fca 60%,
            #31577f
        );
}

.isotope-quiz-notation {
    position: absolute;

    left: 50%;
    top: 14px;

    z-index: 6;

    transform:
        translateX(-50%);

    padding: 6px 11px;

    border:
        1px solid
        rgba(238, 172, 96, 0.22);

    border-radius: 9px;

    background:
        rgba(10, 8, 7, 0.9);

    color: #fff;

    font-size: 25px;
    font-weight: 800;

    pointer-events: none;
}


.isotope-quiz-notation sup,
.isotope-quiz-notation sub {
    font-size: 12px;
}


.isotope-quiz-counts {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 8px;
}


.isotope-quiz-counts div {
    padding: 10px;

    border-radius: 9px;

    background:
        rgba(255, 255, 255, 0.045);
}


.isotope-quiz-counts span {
    display: block;

    color:
        var(--color-text-muted);

    font-size: 10px;
}


.isotope-quiz-counts strong {
    display: block;

    margin-top: 4px;

    color: #fff;

    font-size: 19px;
}


.isotope-quiz-state {
    margin-top: 10px;

    padding: 7px 10px;

    border:
        1px solid
        rgba(238, 172, 96, 0.38);

    border-radius: 999px;

    color: #ffd39a;

    font-size: 11px;
    font-weight: 700;
}

.isotope-quiz-change-grid {
    display: grid;

    gap: 8px;

    margin:
        14px 0;
}


.isotope-quiz-change-item {
    padding:
        9px 10px;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 9px;

    background:
        rgba(255, 255, 255, 0.035);
}


.isotope-quiz-change-item span {
    display: block;

    color:
        var(--color-text-muted);

    font-size: 10px;
}


.isotope-quiz-change-item strong {
    display: block;

    margin-top: 3px;

    color: #fff;

    font-size: 16px;
}


.isotope-quiz-energy-change {
    margin:
        8px 0 12px;

    padding:
        8px 10px;

    border:
        1px solid
        rgba(238, 172, 96, 0.3);

    border-radius: 9px;

    background:
        rgba(238, 172, 96, 0.08);

    color: #ffd39a;

    font-size: 11px;
}

.isotope-quiz-guide {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;

    margin-bottom: 18px;
}


.isotope-quiz-guide-item {
    padding: 12px;

    border:
        1px solid
        rgba(255, 255, 255, 0.08);

    border-radius: 10px;

    background:
        rgba(255, 255, 255, 0.025);
}


.isotope-quiz-guide-item strong,
.isotope-quiz-guide-item span,
.isotope-quiz-guide-item small {
    display: block;
}


.isotope-quiz-guide-item strong {
    margin-bottom: 6px;

    color: #ffd39a;

    font-size: 15px;
}


.isotope-quiz-guide-item span {
    color: #fff;

    font-size: 12px;
    line-height: 1.4;
}


.isotope-quiz-guide-item small {
    margin-top: 6px;

    color:
        var(--color-text-muted);

    font-size: 10px;
    line-height: 1.4;
}

.isotope-quiz-feedback-changes {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    margin:
        10px 0 8px;
}


.isotope-quiz-feedback-changes span {
    padding:
        6px 9px;

    border-radius: 7px;

    background:
        rgba(255, 255, 255, 0.05);

    color:
        var(--color-text-muted);

    font-size: 11px;
}


.isotope-quiz-feedback-changes b {
    color: #fff;
}


.isotope-quiz-feedback p {
    margin:
        8px 0 0;
}

.isotope-quiz-transition {
    text-align: center;
}


.isotope-quiz-emission {
    width: 72px;
    height: 72px;

    margin: 18px auto 4px;

    display: flex;

    align-items: center;
    justify-content: center;

    border:
        2px solid
        rgba(238, 172, 96, 0.55);

    border-radius: 50%;

    background:
        rgba(238, 172, 96, 0.08);

    color: #ffd39a;

    font-size: 36px;
    font-weight: 800;
}


.isotope-quiz-arrow {
    color:
        var(--color-text-muted);

    font-size: 34px;
}


.isotope-quiz-transition small {
    color:
        var(--color-text-muted);
}


.isotope-quiz-question {
    margin-top: 24px;

    padding: 20px;

    border:
        1px solid
        rgba(238, 172, 96, 0.22);

    border-radius: 16px;

    background:
        rgba(20, 15, 12, 0.72);
}


.isotope-quiz-question h3 {
    margin:
        0 0 16px;

    color: #fff;

    text-align: center;
}


.isotope-quiz-answers {
    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 12px;
}


.isotope-quiz-answers button {
    min-height: 94px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 12px;

    background:
        rgba(255, 255, 255, 0.045);

    color: #fff;

    cursor: pointer;
}


.isotope-quiz-answers button:hover {
    border-color:
        var(--color-accent);

    background:
        rgba(238, 172, 96, 0.10);
}


.isotope-quiz-answers button strong,
.isotope-quiz-answers button span {
    display: block;
}


.isotope-quiz-answers button strong {
    color: #ffd39a;

    font-size: 30px;
}


.isotope-quiz-answers button span {
    margin-top: 5px;

    font-size: 12px;
}


.isotope-quiz-answers button.correct {
    border-color:
        rgba(90, 210, 130, 0.8);

    background:
        rgba(90, 210, 130, 0.12);
}


.isotope-quiz-answers button.wrong {
    border-color:
        rgba(235, 90, 80, 0.8);

    background:
        rgba(235, 90, 80, 0.10);
}


.isotope-quiz-feedback {
    margin-top: 16px;

    padding: 13px 16px;

    border-left:
        3px solid
        var(--color-accent);

    background:
        rgba(238, 172, 96, 0.055);

    color:
        var(--color-text-muted);

    line-height: 1.5;
}


#isotopeQuizNextBtn {
    display: block;

    margin:
        16px 0 0 auto;
}

/* =========================================================
   RADIATION DEFLECTION EXPERIMENT
   ========================================================= */

.radiation-deflection {
    margin-top: 70px;
    padding-top: 50px;

    border-top:
        1px solid
        rgba(238, 172, 96, 0.18);
}


.radiation-deflection-header {
    max-width: 800px;
    margin-bottom: 28px;
}


.radiation-deflection-header h2 {
    margin: 6px 0 8px;

    color: #fff;

    font-size:
        clamp(2rem, 4vw, 3.3rem);

    line-height: 1.05;
}


.radiation-deflection-header p {
    margin: 0;

    color:
        var(--color-text-muted);

    line-height: 1.65;
}


/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.radiation-deflection-layout {
    display: grid;

    grid-template-columns:
        minmax(280px, 0.72fr)
        minmax(0, 2fr);

    gap: 24px;

    align-items: start;
}


.radiation-simulation-card,
.radiation-control-card {
    border:
        1px solid
        rgba(255, 255, 255, 0.1);

    border-radius: 22px;

    background:
        rgba(10, 10, 10, 0.72);
}

.radiation-control-card {
    padding: 24px;
}

.radiation-simulation-card {
    padding: 22px;
}

.radiation-simulation-card {
    padding: 22px;
}


.radiation-control-card {
    padding: 24px;
}


/* =========================================================
   SIMULATION HEADER
   ========================================================= */

.radiation-simulation-top {
    display: flex;

    justify-content: space-between;
    align-items: center;

    gap: 20px;

    margin-bottom: 18px;
}


.radiation-plate-status {
    display: flex;
    gap: 16px;

    color:
        var(--color-text-muted);

    font-size: 0.9rem;
}


.radiation-plate-status strong {
    margin-left: 5px;

    color: #fff;

    font-size: 1.15rem;
}


/* =========================================================
   SVG
   ========================================================= */

.radiation-svg-wrap {
    width: 100%;

    overflow-x: auto;

    border-radius: 18px;

    background:
        radial-gradient(
            circle at center,
            rgba(255, 145, 40, 0.05),
            rgba(0, 0, 0, 0.15)
        );
}


.radiation-deflection-svg {
    display: block;

    width: 100%;
    min-width: 620px;

    height: auto;
}


/* Lead block */

.radiation-lead-block {
    fill:
        rgba(150, 150, 150, 0.22);

    stroke:
        rgba(255, 255, 255, 0.35);

    stroke-width: 2;
}


.radiation-opening {
    fill:
        rgba(0, 0, 0, 0.8);

    stroke:
        rgba(255, 255, 255, 0.25);

    stroke-width: 2;
}


/* Source */

.radiation-source {
    fill: #fff;

    stroke:
        rgba(255, 160, 50, 0.8);

    stroke-width: 6;
}


/* Plates */

.radiation-plate {
    fill:
        rgba(255, 255, 255, 0.12);

    stroke:
        rgba(255, 255, 255, 0.65);

    stroke-width: 2;
}


.radiation-plate-sign {
    fill: #fff;

    font-size: 30px;
    font-weight: 800;
}


/* Labels */

.radiation-svg-label,
.radiation-svg-small-label {
    fill:
        rgba(255, 255, 255, 0.72);
}


.radiation-svg-label {
    font-size: 15px;
    font-weight: 700;
}


.radiation-svg-small-label {
    font-size: 12px;
}


/* Detector */

.radiation-detector {
    fill:
        rgba(255, 255, 255, 0.22);

    stroke:
        rgba(255, 255, 255, 0.6);

    stroke-width: 2;
}


/* =========================================================
   RADIATION PATHS
   ========================================================= */

.radiation-ray {
    fill: none;

    stroke-width: 6;

    stroke-linecap: round;

    opacity: 0;

    stroke-dasharray: 900;
    stroke-dashoffset: 900;

    transition:
        opacity 0.25s ease;
}


.radiation-ray.visible {
    opacity: 1;

    animation:
        radiationRayTravel
        1.25s
        ease
        forwards;
}


.radiation-ray-alpha {
    stroke: #84d04f;
}


.radiation-ray-beta {
    stroke: #ef7049;
}


.radiation-ray-gamma {
    stroke: #b36ee8;
}


@keyframes radiationRayTravel {

    from {
        stroke-dashoffset: 900;
    }

    to {
        stroke-dashoffset: 0;
    }

}


/* Labels beside paths */

.radiation-path-label {
    font-size: 22px;
    font-weight: 800;

    opacity: 0;

    transition:
        opacity 0.25s ease;
}


.radiation-path-label.visible {
    opacity: 1;
}


.radiation-alpha-label {
    fill: #84d04f;
}


.radiation-beta-label {
    fill: #ef7049;
}


.radiation-gamma-label {
    fill: #b36ee8;
}


/* =========================================================
   SIMULATION BUTTONS
   ========================================================= */

.radiation-simulation-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 10px;

    margin-top: 18px;
}


/* =========================================================
   CONTROL PANEL
   ========================================================= */

.radiation-control-card h3 {
    margin:
        6px 0 14px;

    color: #fff;
}


.radiation-type-buttons {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;
}


.radiation-type-buttons button {
    display: flex;
    flex-direction: column;

    align-items: center;
    justify-content: center;

    min-height: 88px;

    padding: 12px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 14px;

    color: #fff;

    background:
        rgba(255, 255, 255, 0.045);

    cursor: pointer;

    transition:
        border-color 0.2s ease,
        background 0.2s ease,
        transform 0.2s ease;
}


.radiation-type-buttons button:hover {
    transform:
        translateY(-2px);

    border-color:
        rgba(238, 172, 96, 0.55);

    background:
        rgba(238, 172, 96, 0.08);
}


.radiation-type-buttons button.selected {
    border-color:
        rgba(238, 172, 96, 0.9);

    background:
        rgba(238, 172, 96, 0.14);
}


.radiation-type-buttons strong {
    font-size: 1.7rem;
}


.radiation-type-buttons span {
    margin-top: 4px;

    color:
        var(--color-text-muted);

    font-size: 0.82rem;
}


/* =========================================================
   PREDICTION
   ========================================================= */

.radiation-prediction-section {
    margin-top: 32px;
}


#radiationPredictionPrompt {
    min-height: 42px;

    color:
        var(--color-text-muted);

    line-height: 1.5;
}


.radiation-prediction-buttons {
    display: grid;
    gap: 8px;
}


.radiation-prediction-buttons button {
    min-height: 44px;

    padding: 10px 14px;

    border:
        1px solid
        rgba(255, 255, 255, 0.12);

    border-radius: 10px;

    color: #fff;

    background:
        rgba(255, 255, 255, 0.045);

    cursor: pointer;
}


.radiation-prediction-buttons button:hover:not(:disabled) {
    border-color:
        rgba(238, 172, 96, 0.7);

    background:
        rgba(238, 172, 96, 0.08);
}


.radiation-prediction-buttons button:disabled {
    opacity: 0.35;

    cursor: not-allowed;
}


/* =========================================================
   FEEDBACK
   ========================================================= */

.radiation-deflection-feedback {
    margin-top: 24px;

    padding: 15px;

    border:
        1px solid
        rgba(255, 255, 255, 0.09);

    border-radius: 12px;

    color:
        var(--color-text-muted);

    background:
        rgba(255, 255, 255, 0.035);

    line-height: 1.55;
}


.radiation-deflection-feedback.correct {
    border-color:
        rgba(90, 210, 120, 0.4);

    color:
        rgba(195, 255, 210, 0.95);

    background:
        rgba(50, 170, 90, 0.08);
}


.radiation-deflection-feedback.incorrect {
    border-color:
        rgba(255, 170, 80, 0.4);

    color:
        rgba(255, 215, 170, 0.95);

    background:
        rgba(255, 140, 40, 0.07);
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {

    .radiation-deflection-layout {
        grid-template-columns: 1fr;
    }

}


@media (max-width: 560px) {

    .radiation-simulation-top {
        align-items: flex-start;
        flex-direction: column;
    }


    .radiation-plate-status {
        flex-direction: column;
        gap: 4px;
    }


    .radiation-type-buttons {
        grid-template-columns: 1fr;
    }

}

@media (max-width: 850px) {

    .isotope-quiz-board {
        grid-template-columns: 1fr;
    }


    .isotope-quiz-transition {
        padding: 10px 0;
    }


    .isotope-quiz-arrow {
        transform: rotate(90deg);
    }
}


@media (max-width: 620px) {

    .isotope-quiz-header {
        align-items: flex-start;
        flex-direction: column;
    }


    .isotope-quiz-score-card {
        width: 100%;

        text-align: left;
    }


    .isotope-quiz-answers {
        grid-template-columns: 1fr;
    }
}