/*
 * Hero Reward Jackpot
 * Restyled to match the Hero Egypt Store theme.
 * Primary: Hero blue
 * Accent: Hero red
 * Surface: clean white / light grey
 */

.hero-jackpot {
    --hj-primary: #0b4697;
    --hj-primary-dark: #07346f;
    --hj-primary-soft: #edf4ff;
    --hj-accent: #e30613;
    --hj-accent-dark: #b9000b;
    --hj-accent-soft: #fff0f1;
    --hj-bg: #ffffff;
    --hj-surface: #f7f9fc;
    --hj-text: #383838;
    --hj-muted: #6d7482;
    --hj-border: #e3e8ef;
    --hj-shadow: 0 28px 75px rgba(11, 70, 151, 0.18);

    position: relative;
    z-index: 10050;
    font-family: inherit;
    color: var(--hj-text);
}

/* Floating launcher */
.hero-jackpot-launcher {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 10040;

    display: grid;
    place-items: center;
    width: 60px;
    height: 60px;
    padding: 0;

    border: 3px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--hj-primary), var(--hj-primary-dark));
    color: #ffffff;

    font: inherit;
    font-size: 25px;
    box-shadow:
        0 12px 28px rgba(11, 70, 151, 0.28),
        0 0 0 0 rgba(227, 6, 19, 0.28);

    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease;
    animation: hjHeroPulse 2.6s infinite;
}

.hero-jackpot-launcher::after {
    content: "";
    position: absolute;
    top: 2px;
    right: 1px;
    width: 13px;
    height: 13px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--hj-accent);
}

.hero-jackpot-launcher:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 16px 34px rgba(11, 70, 151, 0.34);
}

.hero-jackpot-launcher:focus-visible,
.hero-jackpot-close:focus-visible,
.hero-jackpot-play:focus-visible,
.hero-jackpot-copy:focus-visible {
    outline: 3px solid rgba(11, 70, 151, 0.28);
    outline-offset: 3px;
}

[dir="rtl"] .hero-jackpot-launcher {
    right: auto;
    left: 22px;
}

[dir="rtl"] .hero-jackpot-launcher::after {
    right: auto;
    left: 1px;
}

/* Modal */
.hero-jackpot-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10060;

    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 22px;

    background: rgba(4, 29, 68, 0.58);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}

.hero-jackpot-backdrop[hidden],
.hero-jackpot-launcher[hidden],
.hero-jackpot-result[hidden] {
    display: none !important;
}

.hero-jackpot-dialog {
    position: relative;
    width: min(100%, 570px);
    padding: 34px 30px 26px;
    overflow: hidden;

    border: 1px solid rgba(11, 70, 151, 0.12);
    border-top: 5px solid var(--hj-primary);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0, rgba(11, 70, 151, 0.08), transparent 34%),
        radial-gradient(circle at 0 100%, rgba(227, 6, 19, 0.055), transparent 30%),
        #f7f7f7;

    color: var(--hj-text);
    text-align: center;
    box-shadow: var(--hj-shadow);
}

.hero-jackpot-dialog::before {
    content: "";
    position: absolute;
    top: -64px;
    left: -64px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: rgba(11, 70, 151, 0.07);
    pointer-events: none;
}

.hero-jackpot-dialog::after {
    content: "";
    position: absolute;
    right: -54px;
    bottom: -54px;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(227, 6, 19, 0.055);
    pointer-events: none;
}

.hero-jackpot-close {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 4;

    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;

    border: 1px solid var(--hj-border);
    border-radius: 50%;
    background: #ffffff;
    color: var(--hj-primary);

    font: inherit;
    font-size: 25px;
    line-height: 1;
    box-shadow: 0 5px 15px rgba(11, 70, 151, 0.09);
    cursor: pointer;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.hero-jackpot-close:hover {
    background: var(--hj-accent);
    color: #ffffff;
    transform: rotate(4deg);
}

[dir="rtl"] .hero-jackpot-close {
    right: auto;
    left: 16px;
}

/* Header */
.hero-jackpot-header {
    position: relative;
    z-index: 2;
}

.hero-jackpot-kicker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;

    border: 1px solid rgba(11, 70, 151, 0.12);
    border-radius: 999px;
    background: var(--hj-primary-soft);
    color: var(--hj-primary);

    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.hero-jackpot-header h2 {
    margin: 14px 0 8px;
    color: var(--hj-primary);
    font-size: clamp(26px, 5vw, 38px);
    font-weight: 900;
    line-height: 1.18;
}

.hero-jackpot-description {
    max-width: 440px;
    margin: 0 auto;
    color: var(--hj-muted);
    font-size: 15px;
    line-height: 1.7;
}

/* Wheel */
.hero-jackpot-wheel-shell {
    position: relative;
    z-index: 2;
    width: min(76vw, 330px);
    aspect-ratio: 1;
    margin: 24px auto 20px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow:
        0 0 0 1px var(--hj-border),
        0 14px 32px rgba(11, 70, 151, 0.15);
}

.hero-jackpot-wheel {
    position: absolute;
    inset: 9px;
    overflow: hidden;

    border: 7px solid #ffffff;
    border-radius: 50%;
    box-shadow:
        0 0 0 5px var(--hj-primary),
        0 0 0 9px rgba(11, 70, 151, 0.10),
        0 16px 32px rgba(11, 70, 151, 0.18);

    transition: transform 4.6s cubic-bezier(0.12, 0.76, 0.12, 1);
}

.hero-jackpot-segment-label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42%;
    margin-top: -14px;
    margin-left: -21%;

    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.48);

    transform-origin: 50% 14px;
}

.hero-jackpot-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    z-index: 5;

    width: 0;
    height: 0;

    border-right: 17px solid transparent;
    border-left: 17px solid transparent;
    border-top: 36px solid var(--hj-accent);

    filter: drop-shadow(0 5px 4px rgba(101, 0, 6, 0.25));
    transform: translateX(-50%);
}

.hero-jackpot-wheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 4;

    display: grid;
    place-items: center;
    width: 62px;
    height: 62px;

    border: 6px solid #ffffff;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--hj-primary), var(--hj-primary-dark));
    color: #ffffff;

    font-size: 24px;
    box-shadow: 0 8px 20px rgba(11, 70, 151, 0.26);
    transform: translate(-50%, -50%);
}

/* Primary action */
.hero-jackpot-play {
    position: relative;
    z-index: 2;

    min-width: 220px;
    min-height: 52px;
    padding: 13px 24px;

    border: 0;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--hj-primary), var(--hj-primary-dark));
    color: #ffffff;

    font: inherit;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(11, 70, 151, 0.22);
    cursor: pointer;
    transition: transform 170ms ease, box-shadow 170ms ease, background 170ms ease;
}

.hero-jackpot-play:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 13px 28px rgba(11, 70, 151, 0.3);
}

.hero-jackpot-play:active:not(:disabled) {
    transform: translateY(0);
}

.hero-jackpot-play:disabled {
    cursor: wait;
    opacity: 0.68;
}

/* Result and coupon */
.hero-jackpot-result {
    position: relative;
    z-index: 2;
    max-width: 460px;
    margin: 0 auto 16px;
    padding: 17px 18px;

    border: 1px solid rgba(11, 70, 151, 0.14);
    border-radius: 13px;
    background: linear-gradient(180deg, #ffffff, var(--hj-primary-soft));
    box-shadow: 0 8px 20px rgba(11, 70, 151, 0.08);
}

.hero-jackpot-result h3 {
    margin: 0 0 6px;
    color: var(--hj-primary);
    font-size: 21px;
    font-weight: 900;
}

.hero-jackpot-result p {
    margin: 0;
    color: var(--hj-muted);
    line-height: 1.55;
}

.hero-jackpot-coupon {
    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    margin-top: 13px;
}

.hero-jackpot-code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;

    border: 1px dashed var(--hj-primary);
    border-radius: 8px;
    background: #ffffff;
    color: var(--hj-primary);

    font-weight: 900;
    letter-spacing: 0.09em;
}

.hero-jackpot-copy {
    min-height: 42px;
    padding: 9px 14px;

    border: 0;
    border-radius: 8px;
    background: var(--hj-accent);
    color: #ffffff;

    font: inherit;
    font-weight: 900;
    box-shadow: 0 6px 14px rgba(227, 6, 19, 0.18);
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.hero-jackpot-copy:hover {
    background: var(--hj-accent-dark);
    transform: translateY(-1px);
}

.hero-jackpot-note {
    position: relative;
    z-index: 2;
    margin: 14px 0 0;
    color: #8a909b;
    font-size: 12px;
    line-height: 1.5;
}

.hero-jackpot-error {
    color: var(--hj-accent) !important;
}

/* Motion */
@keyframes hjHeroPulse {
    0%,
    100% {
        box-shadow:
            0 12px 28px rgba(11, 70, 151, 0.28),
            0 0 0 0 rgba(227, 6, 19, 0.30);
    }

    60% {
        box-shadow:
            0 12px 28px rgba(11, 70, 151, 0.28),
            0 0 0 13px rgba(227, 6, 19, 0);
    }
}

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

    .hero-jackpot-wheel {
        transition-duration: 0.01ms;
    }
}

/* Mobile */
@media (max-width: 575px) {
    .hero-jackpot-backdrop {
        align-items: flex-end;
        padding: 8px;
    }

    .hero-jackpot-dialog {
        width: 100%;
        max-height: calc(100dvh - 16px);
        overflow-y: auto;
        padding: 28px 16px 20px;
        border-radius: 21px 21px 12px 12px;
    }

    .hero-jackpot-header h2 {
        padding-inline: 24px;
        font-size: 27px;
    }

    .hero-jackpot-description {
        font-size: 14px;
    }

    .hero-jackpot-wheel-shell {
        width: min(80vw, 300px);
        margin-top: 19px;
    }

    .hero-jackpot-launcher {
        right: 15px;
        bottom: 84px;
        width: 56px;
        height: 56px;
        font-size: 23px;
    }

    [dir="rtl"] .hero-jackpot-launcher {
        right: auto;
        left: 15px;
    }

    .hero-jackpot-play {
        width: 100%;
        min-width: 0;
    }

    .hero-jackpot-coupon {
        flex-direction: column;
    }

    .hero-jackpot-code,
    .hero-jackpot-copy {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .hero-jackpot-dialog {
        padding-inline: 13px;
    }

    .hero-jackpot-wheel-shell {
        width: min(79vw, 270px);
    }
}
