/* WordyKid streak navigation and home header layout - scoped FE-only override. */
/* Keep the original Settings tab in the DOM for the home.js tab controller. */
#homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-legacy-settings-tab {
    display: none !important;
}

/* Six visible destinations: Home, Games, Map, Shop, Friends, Streak. */
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab {
    position: relative;
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    min-height: 58px;
    height: auto;
    grid-column: auto;
    margin: 0;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid rgba(180, 116, 245, .56);
    background: linear-gradient(150deg, #f8edff 0%, #e4cbff 60%, #caa0ff 100%);
    box-shadow: 0 3px 12px rgba(103, 44, 191, .16), inset 0 1px 0 rgba(255, 255, 255, .8);
    color: #4b2578;
    text-shadow: none;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
    transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
    white-space: normal;
}
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab:hover,
#homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab[aria-expanded="true"] {
    background: linear-gradient(150deg, #f7d8ff, #e6b3ff);
    box-shadow: 0 4px 15px rgba(116, 40, 187, .25), inset 0 0 0 2px #fff;
}
#homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab .wk-streak-owl {
    position: relative;
    inset: auto;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    background: url("../img/streak/owl.webp") center / contain no-repeat;
    pointer-events: none;
    filter: drop-shadow(0 2px 2px rgba(73, 27, 107, .22));
}
#homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab .wk-streak-trigger__count {
    order: 0;
    position: absolute;
    z-index: 2;
    inset-block-start: 1px;
    inset-inline-start: 50%;
    min-width: 16px;
    line-height: 16px;
    padding: 1px 4px;
    background: #ffe7a0;
    color: #672c86;
    border: 1px solid #fff;
    border-radius: 15px;
    font-size: 10px;
    font-weight: 950;
    text-shadow: none;
    font-variant-numeric: tabular-nums;
}
#homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab .wk-streak-trigger__label {
    order: 0;
    min-width: 0;
    max-width: 94px;
    color: #4b2578;
    font-size: 12px;
    line-height: 1.05;
    font-weight: 900;
    text-align: center;
    text-wrap: balance;
    white-space: normal;
    text-shadow: none;
}
#homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab:focus-visible {
    outline: 3px solid #6038bb;
    outline-offset: 2px;
}

/* Profile contains the existing child selector and a separate settings entry. */
#homeScreen .home-dashboard-header .wk-streak-profile-slot {
    grid-area: profile;
    justify-self: end;
    width: min(100%, 360px);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}
#homeScreen .wk-streak-profile-slot > .home-dashboard-profile {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 300px;
    margin: 0;
}
#homeScreen .wk-streak-settings-launch {
    box-sizing: border-box;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 50%;
    color: #6331a6;
    background: radial-gradient(circle at 28% 22%, #fff 5%, #eee0ff 49%, #d3aeff 100%);
    box-shadow: 0 6px 16px rgba(75,36,130,.23), inset 0 2px 5px rgba(255,255,255,.87);
    display: grid;
    place-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform .15s ease, box-shadow .15s ease;
}
#homeScreen .wk-streak-settings-launch svg {
    display: block;
    width: 25px;
    height: 25px;
    fill: none;
}
#homeScreen .wk-streak-settings-launch:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 19px rgba(75,36,130,.32), inset 0 2px 5px #fff;
}
#homeScreen .wk-streak-settings-launch[aria-pressed="true"] {
    color: white;
    background: linear-gradient(135deg, #8050db, #b263dd);
}
#homeScreen .wk-streak-settings-launch:focus-visible {
    outline: 3px solid #493cc3;
    outline-offset: 3px;
}

/* Desktop: no oversized logo transform, no overlapping metrics, one clear row. */
@media (min-width: 901px) {
    #homeScreen .home-dashboard-header {
        width: min(100%, 1160px);
        grid-template-columns: minmax(170px, .85fr) minmax(270px, 1fr) minmax(260px, 1.04fr);
        grid-template-areas: "brand metrics profile";
        gap: clamp(10px, 2vw, 22px);
        margin: 0 auto 16px;
        align-items: center;
    }
}
@media (min-width: 641px) {
    #homeScreen .home-dashboard-header .home-dashboard-brand {
        min-width: 0;
        padding: 0;
        justify-content: flex-start;
    }
    #homeScreen .home-dashboard-header .home-dashboard-logo-img {
        display: block;
        max-width: 100%;
        width: clamp(155px, 19vw, 245px);
        max-height: 96px;
        object-position: left center;
        transform: none;
    }
    #homeScreen .home-dashboard-header .home-dashboard-metrics {
        display: grid;
        justify-self: center;
        width: min(100%, 355px);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 10px;
    }
    #homeScreen .home-dashboard-header .home-dashboard-pill-coins,
    #homeScreen .home-dashboard-header .home-dashboard-pill-diamonds {
        min-height: 32px;
    }
    #homeScreen .home-dashboard-header .home-dashboard-pill-lang,
    #homeScreen .home-dashboard-header .home-dashboard-pill-level {
        min-height: 42px;
        padding-inline: 8px;
    }
    #homeScreen .home-dashboard-header .home-dashboard-lang-label {
        font-size: clamp(11px, 1vw, 14px);
    }
}
@media (min-width: 641px) and (max-width: 900px) {
    #homeScreen .home-dashboard-header {
        grid-template-columns: minmax(175px, 1fr) minmax(240px, 1.1fr);
        grid-template-areas: "brand profile" "metrics metrics";
        gap: 8px 14px;
        margin-bottom: 14px;
    }
    #homeScreen .home-dashboard-header .home-dashboard-metrics {
        width: min(100%, 470px);
    }
}
@media (max-width: 640px) {
    #homeScreen .home-dashboard-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas: "brand" "profile" "metrics";
        width: min(100%, 390px);
        gap: 8px;
        margin: 0 auto 12px;
        justify-items: center;
    }
    #homeScreen .home-dashboard-header .home-dashboard-brand {
        padding: 0;
        justify-content: center;
    }
    #homeScreen .home-dashboard-header .home-dashboard-logo-img {
        width: min(68vw, 255px);
        max-height: 110px;
        object-position: center;
        transform: none;
    }
    #homeScreen .home-dashboard-header .wk-streak-profile-slot {
        justify-self: center;
        width: min(100%, 342px);
        gap: 7px;
    }
    #homeScreen .wk-streak-profile-slot > .home-dashboard-profile {
        min-height: 58px;
        max-width: none;
        padding: 4px 12px 4px 5px;
    }
    #homeScreen .wk-streak-profile-slot .wk-streak-settings-launch {
        flex-basis: 44px;
        width: 44px;
        height: 44px;
    }
    #homeScreen .home-dashboard-header .home-dashboard-metrics {
        box-sizing: border-box;
        display: grid;
        width: min(100%, 342px);
        max-width: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px 8px;
        justify-self: center;
        padding: 0;
    }
    #homeScreen .home-dashboard-header .home-dashboard-pill-coins,
    #homeScreen .home-dashboard-header .home-dashboard-pill-diamonds {
        min-height: 30px;
        padding: 1px 5px;
    }
    #homeScreen .home-dashboard-header .home-dashboard-pill-lang,
    #homeScreen .home-dashboard-header .home-dashboard-pill-level {
        min-height: 42px;
        padding: 5px 6px;
    }
    #homeScreen .home-dashboard-header .home-dashboard-lang-label {
        font-size: 11px;
    }
    #homeScreen:not([hidden]) #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab {
        min-height: 58px;
        padding: 4px 1px;
        border-radius: 17px;
        flex-direction: column;
        justify-content: center;
        gap: 0;
    }
    #homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab .wk-streak-owl {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
    #homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab .wk-streak-trigger__label {
        max-width: 100%;
        font-size: clamp(8px, 2.4vw, 10px);
        line-height: 1;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
    #homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab .wk-streak-trigger__count {
        inset-block-start: 0;
        inset-inline-start: 56%;
        font-size: 9px;
        min-width: 13px;
        line-height: 13px;
    }
}
@media (max-width: 360px) {
    #homeScreen .home-dashboard-header { gap: 5px; }
    #homeScreen .home-dashboard-header .wk-streak-profile-slot,
    #homeScreen .home-dashboard-header .home-dashboard-metrics { width: min(100%, 306px); }
    #homeScreen .home-dashboard-header .home-dashboard-logo-img { width: min(64vw, 225px); }
    #homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab .wk-streak-owl {
        width: 27px;
        height: 27px;
        flex-basis: 27px;
    }
}
@media (prefers-reduced-motion: reduce) {
    #homeScreen .wk-streak-settings-launch,
    #homeScreen #homeMobileTabs.home-bottom-navigation .wk-streak-bottom-tab {
        transition: none !important;
    }
}
