/* A contained daily-streak surface for the existing WordyKid home header. */
.home-dashboard-metrics .wk-streak-trigger {
    box-sizing: border-box;
    grid-column: 2 / 4;
    width: min(100%, 224px);
    justify-self: center;
    border: 2px solid rgba(190, 134, 24, .22);
    background: linear-gradient(145deg, #fff5c8, #ffd875);
    color: #593b10;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    white-space: nowrap;
    min-width: 108px;
    font-size: 14px;
    box-shadow: 0 6px 16px rgba(118, 73, 7, .14);
}
.wk-streak-trigger:focus-visible,
.wk-streak-dialog button:focus-visible {
    outline: 3px solid #245dc5;
    outline-offset: 3px;
}
.wk-streak-trigger__count { font-weight: 900; font-size: 20px; font-variant-numeric: tabular-nums; }
.wk-streak-trigger__label { font-weight: 800; font-size: 12px; }
.wk-streak-open { overflow: hidden !important; }
.wk-streak-overlay[hidden] { display: none !important; }
.wk-streak-overlay {
    position: fixed;
    inset: 0;
    z-index: 10100;
    box-sizing: border-box;
    background: rgba(30, 22, 55, .64);
    display: grid;
    place-items: center;
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    overscroll-behavior: contain;
}
.wk-streak-dialog {
    box-sizing: border-box;
    position: relative;
    width: min(100%, 510px);
    max-height: min(850px, 94dvh);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: linear-gradient(180deg, #fff9e7 0%, #fffdf6 42%, #ffffff 100%);
    border: 2px solid #ffdd82;
    border-radius: 28px;
    padding: 24px 22px 22px;
    color: #3a2854;
    box-shadow: 0 24px 76px rgba(23, 10, 50, .32);
}
.wk-streak-header {
    display: flex;
    align-items: center;
    gap: 16px;
    position: relative;
    padding-inline-end: 26px;
    margin-bottom: 18px;
}
.wk-streak-header__copy { min-width: 0; flex: 1; }
.wk-streak-title { font-size: clamp(21px, 5vw, 28px); line-height: 1.15; margin: 0 0 7px; font-weight: 900; color: #46306b; }
.wk-streak-subtitle { margin: 0; color: #70617f; font-size: 13px; line-height: 1.5; }
.wk-streak-close {
    position: absolute;
    inset-block-start: -11px;
    inset-inline-end: -10px;
    width: 35px;
    height: 35px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    font-size: 25px;
    color: #644a72;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(57, 37, 80, .13);
}
.wk-streak-owl {
    --owl-scale: 1;
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
    width: calc(40px * var(--owl-scale));
    height: calc(42px * var(--owl-scale));
    border-radius: 44% 44% 38% 38%;
    background: linear-gradient(135deg, #aa73e7 5%, #6848b3 90%);
    box-shadow: inset 0 -4px 0 rgba(40, 24, 97, .13), 0 4px 9px rgba(64, 39, 124, .2);
}
.wk-streak-header .wk-streak-owl { --owl-scale: 1.8; }
.wk-streak-owl__ear { position: absolute; width: 33%; height: 35%; background: #885ec7; top: -8%; z-index: 0; }
.wk-streak-owl__ear--left { left: 6%; transform: rotate(-26deg); border-radius: 5px 95% 5px 5px; }
.wk-streak-owl__ear--right { right: 6%; transform: rotate(26deg); border-radius: 95% 5px 5px 5px; }
.wk-streak-owl__face {
    position: absolute;
    z-index: 1;
    inset: 14% 7% 9%;
    border-radius: 45% 45% 47% 47%;
    background: #f9e9ff;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 5%;
    padding-top: 18%;
    box-sizing: border-box;
}
.wk-streak-owl__eye { width: 36%; height: 43%; background: white; border-radius: 50%; position: relative; box-shadow: inset 0 0 0 1px #b5a0d1; }
.wk-streak-owl__eye::after { content: ""; display: block; position: absolute; width: 42%; height: 52%; top: 29%; left: 35%; border-radius: 50%; background: #39245e; }
.wk-streak-owl__beak { position: absolute; left: 44%; top: 59%; width: 13%; height: 20%; background: #f9ae36; clip-path: polygon(0 0, 100% 0, 50% 100%); }
.wk-streak-owl__wing { position: absolute; top: 43%; width: 24%; height: 32%; background: #7a4fc3; border-radius: 50%; }
.wk-streak-owl__wing--left { left: -8%; transform: rotate(-25deg); }
.wk-streak-owl__wing--right { right: -8%; transform: rotate(25deg); }
.wk-streak-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.wk-streak-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 6px;
    border: 1px solid #e4d5f9;
    border-radius: 17px;
    background: #f4edfc;
}
.wk-streak-stat--main { background: #fff0c4; border-color: #f4cf6c; }
.wk-streak-stat__number { font-variant-numeric: tabular-nums; font-weight: 900; font-size: 33px; line-height: 1.1; color: #5c348f; }
.wk-streak-stat--main .wk-streak-stat__number { color: #9b5906; }
.wk-streak-stat__caption { margin-top: 5px; font-size: 12px; font-weight: 750; }
.wk-streak-status { min-height: 36px; font-size: 13px; line-height: 1.5; margin: 10px 0 12px; text-align: center; color: #675276; }
.wk-streak-month-nav { display: grid; grid-template-columns: 43px minmax(0, 1fr) 43px; align-items: center; gap: 8px; }
.wk-streak-month-nav__label { text-align: center; font-weight: 900; font-size: 17px; margin: 0; text-transform: capitalize; }
.wk-streak-month-nav__arrow {
    border: 0;
    background: #f3e9ff;
    color: #59398b;
    border-radius: 12px;
    min-height: 42px;
    cursor: pointer;
    font-weight: 900;
    font-size: 29px;
    line-height: 1;
}
.wk-streak-month-nav__arrow:disabled { opacity: .25; cursor: not-allowed; }
.wk-streak-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    direction: ltr;
    margin-top: 12px;
    margin-bottom: 20px;
    width: 100%;
}
.wk-streak-calendar__weekday { text-align: center; min-width: 0; font-size: 11px; font-weight: 850; color: #746585; overflow: hidden; }
.wk-streak-calendar__blank { min-height: 42px; }
.wk-streak-calendar__day {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 42px;
    position: relative;
    border: 2px solid transparent;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 750;
    background: #f5f2f8;
    color: #877e90;
    font-variant-numeric: tabular-nums;
}
.wk-streak-calendar__day.is-won {
    color: #5a3306;
    border-color: #f2c44c;
    background: linear-gradient(145deg, #fff6b8, #ffd35f);
    box-shadow: 0 3px 8px rgba(159, 102, 10, .14);
}
.wk-streak-calendar__day.is-today { border-color: #8461c7; }
.wk-streak-calendar__day.is-future { opacity: .4; }
.wk-streak-calendar__spark { width: 5px; height: 5px; border-radius: 50%; background: #9b5c0e; }
.wk-streak-milestones__heading { font-size: 16px; margin: 0 0 10px; text-align: start; }
.wk-streak-milestones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.wk-streak-milestone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 83px;
    border: 1px solid #e6e2ec;
    border-radius: 14px;
    background: #f4f2f7;
    color: #8b8194;
}
.wk-streak-milestone.is-earned {
    background: linear-gradient(150deg, #fff6c4, #ffdf87);
    border-color: #e9b74c;
    color: #68410b;
}
.wk-streak-milestone__number { font-size: 23px; line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.wk-streak-milestone__days { font-size: 10px; font-weight: 850; }
.wk-streak-milestone__status { font-size: 10px; }
.wk-streak-retry { display: block; margin: 16px auto 0; border: 0; background: #7652ba; border-radius: 12px; padding: 10px 22px; color: #fff; font-weight: 800; cursor: pointer; }
.wk-streak-retry[hidden] { display: none; }
@media (max-width: 540px) {
    .home-dashboard-metrics .wk-streak-trigger { min-width: auto; padding: 8px 12px; }
    .wk-streak-trigger__label { font-size: 11px; }
    .wk-streak-trigger .wk-streak-owl { --owl-scale: .8; }
    .wk-streak-dialog { border-radius: 22px; padding: 18px 14px 16px; }
    .wk-streak-header .wk-streak-owl { --owl-scale: 1.45; }
    .wk-streak-calendar { gap: 4px; }
    .wk-streak-calendar__day { min-height: 39px; }
    .wk-streak-milestones { gap: 5px; }
    .wk-streak-milestone { min-height: 73px; }
}
@media (prefers-reduced-motion: reduce) {
    .wk-streak-overlay, .wk-streak-dialog, .wk-streak-trigger { scroll-behavior: auto; animation: none !important; transition: none !important; }
}
.wk-streak-dialog[dir="rtl"] .wk-streak-calendar { direction: rtl; }
/* Streak leaderboard invitation */
.wk-streak-ranking-cta {
    box-sizing: border-box;
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    min-height: 78px;
    margin-top: 18px;
    padding: 13px 16px;
    border: 2px solid #a36ad7;
    border-radius: 19px;
    background: linear-gradient(
        115deg,
        #fff4c5 0%,
        #ffdb80 45%,
        #ffc85f 100%
    );
    color: #563079;
    text-align: start;
    font-family: inherit;
    cursor: pointer;
    box-shadow:
        0 5px 0 #a46a35,
        0 10px 22px rgba(116, 62, 139, .19),
        inset 0 2px 0 rgba(255,255,255,.9);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: wkStreakRankingBreathe 3.4s ease-in-out infinite;
}

.wk-streak-ranking-cta::before {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: -1;
    border: 1px solid rgba(255,255,255,.6);
    border-radius: 14px;
    pointer-events: none;
}

.wk-streak-ranking-cta__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 49px;
    height: 49px;
    border-radius: 15px;
    background: rgba(255,255,255,.64);
    box-shadow: 0 3px 9px rgba(126,77,24,.12);
    font-size: 29px;
}

.wk-streak-ranking-cta__copy {
    display: flex;
    flex: 1;
    min-width: 0;
    flex-direction: column;
    gap: 5px;
}

.wk-streak-ranking-cta__title {
    color: #512576;
    font-size: clamp(14px, 3.5vw, 17px);
    font-weight: 900;
    line-height: 1.25;
}

.wk-streak-ranking-cta__hint {
    color: #75517e;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.4;
}

.wk-streak-ranking-cta__arrow {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #7c45ae;
    color: #fff;
    font-size: 21px;
    font-weight: 900;
}

.wk-streak-dialog[dir="rtl"] .wk-streak-ranking-cta__arrow {
    transform: rotate(180deg);
}

@media (hover: hover) {
    .wk-streak-ranking-cta:hover {
        transform: translateY(-3px);
        box-shadow:
            0 8px 0 #a46a35,
            0 15px 28px rgba(116,62,139,.25);
        animation-play-state: paused;
    }
}

.wk-streak-ranking-cta:active {
    transform: translateY(2px);
    box-shadow: 0 2px 0 #a46a35;
    animation-play-state: paused;
}

@keyframes wkStreakRankingBreathe {
    0%, 100% {
        box-shadow:
            0 5px 0 #a46a35,
            0 10px 22px rgba(116,62,139,.19);
    }
    50% {
        box-shadow:
            0 5px 0 #a46a35,
            0 10px 29px rgba(156,88,205,.34);
    }
}

@media (max-width: 540px) {
    .wk-streak-ranking-cta {
        gap: 9px;
        min-height: 72px;
        padding: 10px;
    }

    .wk-streak-ranking-cta__icon {
        width: 42px;
        height: 42px;
        font-size: 25px;
    }

    .wk-streak-ranking-cta__hint {
        font-size: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wk-streak-ranking-cta {
        animation: none !important;
        transition: none !important;
    }
}

/* WK RANKING MOTION UPGRADE V1 */

.wk-streak-ranking-cta {
    overflow: hidden;
}

.wk-streak-ranking-cta::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 42%;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        transparent,
        rgba(255,255,255,.12) 25%,
        rgba(255,255,255,.58) 50%,
        rgba(255,255,255,.12) 75%,
        transparent
    );
    transform: translateX(-160%) skewX(-17deg);
    animation: wkStreakRankingSweep 5.2s ease-in-out infinite;
}

.wk-streak-ranking-cta__icon,
.wk-streak-ranking-cta__copy,
.wk-streak-ranking-cta__arrow {
    position: relative;
    z-index: 1;
}

.wk-streak-ranking-cta__icon {
    transform-origin: center bottom;
    animation: wkStreakTrophyFloat 3.2s ease-in-out infinite;
}

.wk-streak-ranking-cta__arrow {
    animation: wkStreakRankingArrowGlow 2.5s ease-in-out infinite;
}

.wk-streak-ranking-cta:focus-visible {
    outline: 3px solid #7b32d4;
    outline-offset: 4px;
}

@keyframes wkStreakRankingSweep {
    0%, 60% {
        transform: translateX(-160%) skewX(-17deg);
    }

    85%, 100% {
        transform: translateX(360%) skewX(-17deg);
    }
}

@keyframes wkStreakTrophyFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    40% {
        transform: translateY(-3px) rotate(-5deg);
    }

    55% {
        transform: translateY(-3px) rotate(4deg);
    }

    72% {
        transform: translateY(0) rotate(0deg);
    }
}

@keyframes wkStreakRankingArrowGlow {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(124,69,174,0);
        filter: brightness(1);
    }

    50% {
        box-shadow:
            0 0 0 5px rgba(124,69,174,.13),
            0 0 15px rgba(124,69,174,.32);
        filter: brightness(1.13);
    }
}

@media (prefers-reduced-motion: reduce) {
    .wk-streak-ranking-cta::after,
    .wk-streak-ranking-cta__icon,
    .wk-streak-ranking-cta__arrow {
        animation: none !important;
    }
}
