:root {
    --bg: #0f1210; /* base */
    --panel: #141917; /* card bg */
    --panel-2: #111513; /* header/footer */
    --ink: #e9eceb;
    --muted: #a7b0ab;
    --border: #2a332e;
    --accent: #2aa866;
    --accent-2: #42c07a;
    --shadow: 0 10px 26px rgba(0, 0, 0, 0.35);

    /* scrollbar */
    --sb-track: #101512;
    --sb-thumb: #243128;
    --sb-thumb-hover: #2f4336;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    background: var(--bg); /* IMPORTANT: no off-center radial here */
    color: var(--ink);
    font-family: Georgia, "Times New Roman", Times, serif;
}

/* Consistent vignette overlay (prevents weird side gradients) */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(
            180deg,
            rgba(66, 192, 122, 0.1) 0%,
            rgba(32, 40, 36, 0.16) 22%,
            rgba(24, 30, 27, 0.22) 45%,
            rgba(18, 22, 20, 0.3) 68%,
            rgba(0, 0, 0, 0.5) 100%
        ),
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.04) 0%,
            rgba(255, 255, 255, 0.02) 28%,
            rgba(0, 0, 0, 0) 55%,
            rgba(0, 0, 0, 0.28) 100%
        );
    z-index: 0;
    animation:
        bg-drift 22s ease-in-out infinite,
        vignette-shimmer 14s ease-in-out infinite;
}

body > * {
    position: relative;
    z-index: 1;
}

@keyframes bg-drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0);
        background-position: 50% 50%;
        filter: saturate(1);
    }
    50% {
        transform: translate3d(0, -10px, 0);
        background-position: 52% 48%;
        filter: saturate(1.05);
    }
}

@keyframes vignette-shimmer {
    0%,
    100% {
        opacity: 0.95;
    }
    50% {
        opacity: 1;
    }
}

.wrap {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: linear-gradient(
        180deg,
        rgba(17, 21, 19, 0.92) 0%,
        rgba(17, 21, 19, 0.84) 100%
    );
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.topbar__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 240px;
}
.brand__dots {
    display: flex;
    align-items: center;
    gap: 6px;
}
.brand__dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 5px rgba(42, 168, 102, 0.15);
    animation: dot-pulse 2.4s ease-in-out infinite;
}
.brand__dot:nth-child(2) {
    animation-delay: 0.3s;
}
.brand__dot:nth-child(3) {
    animation-delay: 0.6s;
}
.brand__title {
    font-weight: 700;
    letter-spacing: 0.2px;
}
.brand__subtitle {
    font-size: 13px;
    color: var(--muted);
    margin-top: 2px;
}

@keyframes dot-pulse {
    0%,
    100% {
        transform: scale(0.9);
        box-shadow:
            0 0 0 3px rgba(42, 168, 102, 0.12),
            0 0 12px rgba(66, 192, 122, 0.1);
        opacity: 0.75;
    }
    50% {
        transform: scale(1.2);
        box-shadow:
            0 0 0 8px rgba(42, 168, 102, 0.2),
            0 0 20px rgba(66, 192, 122, 0.25);
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand__dot {
        animation: none;
    }
}

.actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
}

.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: linear-gradient(180deg, #1a211e 0%, #141a17 100%);
    color: var(--ink);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.22);
}
.btn:hover {
    border-color: rgba(42, 168, 102, 0.5);
    box-shadow: 0 0 0 4px rgba(42, 168, 102, 0.1);
}
.btn:active {
    transform: translateY(1px);
}

.btn--ghost {
    background: transparent;
}

main {
    padding: 18px 0 26px;
}

.card {
    background: linear-gradient(
        180deg,
        rgba(20, 25, 23, 0.95) 0%,
        rgba(18, 22, 20, 0.92) 100%
    );
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 14px 14px 12px;
}

.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.card__title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-2);
}

.card__meta {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 13px;
}

.video {
    margin-top: 10px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    background: #000;
}
.video iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    display: block;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

/* No inner scrolling */
.text {
    font-size: 16px;
    line-height: 1.9;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.text--arabic {
    font-family:
        "Amiri", "Scheherazade New", "Noto Naskh Arabic", "Arial", sans-serif;
    font-size: 18px;
    line-height: 2.1;
}

.footer {
    border-top: 1px solid var(--border);
    background: rgba(17, 21, 19, 0.92);
    backdrop-filter: blur(8px);
    padding: 16px 0 22px;
}
.footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 13px;
}
.footer a {
    color: var(--accent-2);
    text-decoration: none;
    border-bottom: 1px dotted rgba(66, 192, 122, 0.55);
}
.footer a:hover {
    color: var(--ink);
    border-bottom-color: var(--ink);
}

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }
    .topbar__inner {
        align-items: flex-start;
    }
    .brand {
        min-width: unset;
    }
    .text {
        white-space: normal;
    }
}

/* =========================
   Custom Scrollbar
   ========================= */

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--sb-thumb) var(--sb-track);
}

/* WebKit (Chrome/Edge/Safari) */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}
::-webkit-scrollbar-track {
    background: var(--sb-track);
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--sb-thumb), #1a241d);
    border: 3px solid var(--sb-track);
    border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--sb-thumb-hover), #223126);
}
::-webkit-scrollbar-corner {
    background: var(--sb-track);
}
/* =========================
   Audio Play Prompt
   ========================= */

.audio-prompt {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(
        600px 400px at 50% 45%,
        rgba(42, 168, 102, 0.18),
        rgba(0, 0, 0, 0.72)
    );
    backdrop-filter: blur(6px);
    z-index: 999;
}

.audio-prompt.hidden {
    display: none;
}

.audio-prompt__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.audio-prompt__btn {
    appearance: none;
    border: 1px solid rgba(66, 192, 122, 0.6);
    background: linear-gradient(180deg, #1c2a23, #131b17);
    color: #e9eceb;
    padding: 16px 26px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 999px;
    cursor: pointer;
    box-shadow:
        0 0 0 1px rgba(66, 192, 122, 0.15),
        0 20px 60px rgba(0, 0, 0, 0.6);
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.audio-prompt__btn:hover {
    transform: translateY(-1px);
    box-shadow:
        0 0 0 1px rgba(66, 192, 122, 0.35),
        0 26px 80px rgba(0, 0, 0, 0.7);
}

.audio-prompt__btn:active {
    transform: translateY(0);
}

.audio-prompt__btn--ghost {
    background: transparent;
    border-color: rgba(66, 192, 122, 0.35);
    color: #c9d6cf;
    padding: 12px 22px;
    font-size: 15px;
}

/* =========================
   Music Confetti
   ========================= */
.confetti {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1000;
}

.confetti__piece {
    position: absolute;
    left: var(--x);
    top: var(--y);
    font-size: var(--size);
    color: var(--color);
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    animation: confetti-burst var(--dur) ease-out forwards;
}

@keyframes confetti-burst {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
    }
    15% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy)))
            scale(1.1) rotate(var(--rot));
    }
}

/* =========================
   Floating Music Notes
   ========================= */
.side-notes {
    position: fixed;
    top: 0;
    bottom: 0;
    width: 120px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    z-index: 5;
}

.side-notes--left {
    left: 0;
}

.side-notes--right {
    right: 0;
}

.side-notes span {
    position: absolute;
    left: 50%;
    font-size: 18px;
    color: rgba(66, 192, 122, 0.6);
    transform: translateX(-50%);
    animation: note-float 6.5s linear infinite;
    opacity: 0;
}

.side-notes span:nth-child(1) {
    top: 88%;
    left: 24%;
    animation-delay: 0s;
    font-size: 22px;
}
.side-notes span:nth-child(2) {
    top: 96%;
    left: 68%;
    animation-delay: 1.2s;
    font-size: 14px;
}
.side-notes span:nth-child(3) {
    top: 83%;
    left: 46%;
    animation-delay: 2.4s;
    font-size: 24px;
}
.side-notes span:nth-child(4) {
    top: 92%;
    left: 18%;
    animation-delay: 3.6s;
    font-size: 13px;
}
.side-notes span:nth-child(5) {
    top: 86%;
    left: 76%;
    animation-delay: 4.8s;
    font-size: 21px;
}
.side-notes span:nth-child(6) {
    top: 97%;
    left: 38%;
    animation-delay: 6s;
    font-size: 15px;
}
.side-notes span:nth-child(7) {
    top: 90%;
    left: 62%;
    animation-delay: 7.2s;
    font-size: 18px;
}
.side-notes span:nth-child(8) {
    top: 95%;
    left: 30%;
    animation-delay: 8.4s;
    font-size: 26px;
}
.side-notes span:nth-child(9) {
    top: 84%;
    left: 72%;
    animation-delay: 9.6s;
    font-size: 14px;
}
.side-notes span:nth-child(10) {
    top: 93%;
    left: 52%;
    animation-delay: 10.8s;
    font-size: 20px;
}
.side-notes span:nth-child(11) {
    top: 86%;
    left: 12%;
    animation-delay: 12s;
    font-size: 23px;
}
.side-notes span:nth-child(12) {
    top: 98%;
    left: 86%;
    animation-delay: 13.2s;
    font-size: 14px;
}
.side-notes span:nth-child(13) {
    top: 82%;
    left: 58%;
    animation-delay: 14.4s;
    font-size: 17px;
}
.side-notes span:nth-child(14) {
    top: 94%;
    left: 28%;
    animation-delay: 15.6s;
    font-size: 21px;
}

body.audio-playing .side-notes {
    opacity: 1;
}

@keyframes note-float {
    0% {
        transform: translate(-50%, 0) scale(0.9);
        opacity: 0;
    }
    10% {
        opacity: 0.7;
    }
    100% {
        transform: translate(calc(-50% + 18px), -120vh) scale(1.1);
        opacity: 0;
    }
}
