:root {
    --clr-base: hsl(0, 0%, 40%);
    --clr-base-lt: hsl(0, 0%, 78%);
    --clr-base-dk: hsl(0, 0%, 20%);

    --clr-secondary-lt: #355f5d;
    --clr-secondary-dk: #031121;

    --clr-neutral-min: #fff;
    --clr-neutral-max: #000;

    --clr-rating-tier-1: hsl(211, 34%, 80%);
    --clr-rating-tier-1-lt: hsl(211, 34%, 90%);
    --clr-rating-tier-1-dk: hsl(211, 34%, 50%);
    --clr-rating-tier-2: hsl(212, 61%, 69%);
    --clr-rating-tier-2-dk: hsl(212, 61%, 50%);
    --clr-rating-tier-3: hsl(230, 96%, 72%);
    --clr-rating-tier-3-dk: hsl(230, 96%, 50%);
    --clr-rating-tier-4: hsl(262, 97%, 71%);
    --clr-rating-tier-4-dk: hsl(262, 97%, 50%);
    --clr-rating-tier-5: hsl(293, 54%, 59%);
    --clr-rating-tier-5-dk: hsl(293, 54%, 45%);
    --clr-rating-tier-6: hsl(0, 79%, 69%);
    --clr-rating-tier-6-dk: hsl(0, 79%, 50%);
    --clr-rating-tier-7: hsl(38, 86%, 63%);
    --clr-rating-tier-7-dk: hsl(38, 86%, 45%);

    --fs-xs: 0.75rem;
    --fs-sm: 0.8rem;
    --fs-base: 0.9rem;
}

html {
    height: 100dvh;
}

body {
    height: 100%;
    background: linear-gradient(
        to top right,
        var(--clr-secondary-lt) 0%,
        var(--clr-secondary-dk) 40%,
        var(--clr-secondary-dk) 60%,
        var(--clr-secondary-lt) 100%
    );
    color: var(--clr-neutral-min);
}

.content {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100dvh;
    background: linear-gradient(
        to top right,
        var(--clr-secondary-lt) 0%,
        var(--clr-secondary-dk) 40%,
        var(--clr-secondary-dk) 60%,
        var(--clr-secondary-lt) 100%
    );
    background-repeat: no-repeat;
}

.content__wrapper {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    gap: 1em;
    margin-inline: auto;
}

.content__wrapper > * {
    display: flex;
    flex-direction: column;
    width: 325px;
    height: 100%;
    padding: 0;
    background: rgba(31, 31, 31, 0.23);
    border-radius: 15px;
    box-shadow: 4px 4px 10px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(6.1px);
    -webkit-backdrop-filter: blur(6.1px);
}

@media (min-width: 700px) and (max-width: 1020px) {
    .content__wrapper {
        grid-template-columns: repeat(2, 1fr);
    }

    .content__wrapper > *:last-child {
        grid-column: span 2;
    }
}

@media (min-width: 1021px) {
    .content__wrapper {
        grid-template-columns: repeat(3, 1fr);
    }
}

.faceit__wrapper__recent {
    display: flex;
    flex-direction: column;
}

.upper-section__wrapper {
    display: flex;
    justify-content: flex-end;
    align-items: start;
    border-radius: 15px 17px 0 0;
}

.upper-section__wrapper.banned {
    background: linear-gradient(
        180deg,
        rgba(171, 0, 0, 1) 0%,
        rgba(255, 255, 255, 0) 90%
    );
}

.bans__wrapper {
    display: flex;
    align-items: center;
    gap: 0.5em;
    height: 100%;
    margin-inline: auto;
}

.ban-hammer {
    width: 20px;
    height: 100%;
    fill: var(--clr-neutral-min);
}

.logo__wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    align-self: end;
    width: 120px;
    height: 40px;
    background: #0f2638;
    border-radius: 0 15px 0 15px;
}

.content__leetify > .logo__wrapper {
    background: #16373f;
}

.content__leetify,
.content__faceit,
.content__steam {
    min-height: 400px;
}

.content__wrapper__inside {
    padding: 24px;
}

.image__logo {
    object-fit: cover;
    width: 80%;
    height: auto;
}

/*  */

.not_found__wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 40px;
    filter: invert(24%) sepia(83%) saturate(0%) hue-rotate(207deg)
        brightness(89%) contrast(87%);
}

.not_found_heading {
    font-size: 2rem;
    color: #4a4a4a;
    text-decoration: none;
}

.not_found_icon {
    width: 30%;
    height: auto;
}

.user__wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1em;
    margin-bottom: 1.5em;
    color: var(--clr-neutral-min);
}

.user__avatar {
    width: min(100%, 65px);
    border-radius: 100%;
}

.user__link {
    text-decoration: none;
}

.user__wrapper > * {
    text-decoration: none;
}

.user__name {
    font-size: 1.5rem;
    color: var(--clr-neutral-min);
}

.steam_level__wrapper {
    display: grid;
    justify-items: center;
    align-content: center;
    text-align: center;
    text-shadow: 1px 1px #1a1a1a;
    height: 32px;
    width: 32px;
    vertical-align: middle;
    background-repeat: no-repeat;
}

.steam_level__wrapper > * {
    text-decoration: none;
}

/* Steam level tier shapes */

.shape-1 {
    border-radius: 50%;
    border: solid #fff 2px;
}

.shape-2 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_hexagons.png");
}

.shape-3 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_shields.png");
}

.shape-4 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_books.png");
}

.shape-5 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_chevrons.png");
}

.shape-6 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_circle2.png");
}

.shape-7 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_angle.png");
}

.shape-8 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_flag.png");
}

.shape-9 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_wings.png");
}

.shape-10 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_arrows.png");
}

.shape-11 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_crystals.png");
}

.shape-12 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_space.png");
}

.shape-13 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_waterelement.png");
}

.shape-14 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_fireelement.png");
}

.shape-18 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_airelement_5-6.png");
}

.shape-29 {
    background-image: url("https://community.fastly.steamstatic.com/public/shared/images/community/levels_mandala_7-8.png?v=2");
}

/* Steam level tiers */

.tier-1 {
    background-position: 0 0;
    border-color: #9b9b9b;
}

.tier-2 {
    background-position: 0 -32px;
    border-color: #c02942;
}

.tier-3 {
    background-position: 0 -64px;
    border-color: #d95b43;
}

.tier-4 {
    background-position: 0 -96px;
    border-color: #fecc23;
}

.tier-5 {
    background-position: 0 -128px;
    border-color: #467a3c;
}

.tier-6 {
    background-position: 0 -160px;
    border-color: #4e8ddb;
}

.tier-7 {
    background-position: 0 -192px;
    border-color: #7652c9;
}

.tier-8 {
    background-position: 0 -224px;
    border-color: #c252c9;
}

.tier-9 {
    background-position: 0 -256px;
    border-color: #542437;
}

.tier-10 {
    background-position: 0 -288px;
    border-color: #997c52;
}

.header__faceit {
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 1em;
}

.user__stats {
    display: flex;
    flex-direction: column;
    gap: 0.25em;
}

.elo__wrapper {
    display: grid;
}

.elo__wrapper > .stat__elo {
    grid-area: 1 / 1;
}

.elo__wrapper > .stat__value {
    grid-area: 2 / 1;
}

.elo__wrapper > .stat__fc-level {
    grid-area: 1 / 2 / span 2;
}

/* Tabs */

/* Style the tab */
.tab {
    overflow: hidden;
    background-color: inherit;
}

.hidden {
    display: none;
}

/* --- Modern tabs --- */
.tab {
    /* theme vars (adjust to your palette) */
    --tab-accent: var(--clr-base-lt, #6366f1);
    --tab-fg: var(--clr-neutral-min, #111827);
    --tab-muted: 0.65; /* base opacity for idle tabs */
    --tab-pad-x: 14px;
    --tab-pad-y: 2px;
    --tab-radius: 12px;

    position: relative;
    display: inline-flex; /* shrink-wrap to buttons */
    gap: 2px; /* tight spacing */
    padding-top: 8px; /* space for the top line to sit above */
    margin-bottom: 0.5em;
}

/* Buttons: background-free, crisp, tappable */
.tab button {
    appearance: none;
    background: none;
    border: 0;
    padding: var(--tab-pad-y) var(--tab-pad-x);
    font-weight: 600;
    color: var(--tab-fg);
    opacity: var(--tab-muted);
    cursor: pointer;
    border-radius: var(--tab-radius);
    transition: opacity 0.18s ease, color 0.18s ease, transform 0.18s ease;
    white-space: nowrap;
}

/* Hover + focus: a touch of lift */
.tab button:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.tab button:focus-visible {
    outline: 2px solid color-mix(in oklab, var(--tab-accent) 70%, white);
    outline-offset: 2px;
}

/* Active tab text pops; still no background */
.tab button.active {
    opacity: 1;
    color: var(--tab-accent);
}

/* The animated top line that slides under the active tab (but placed above visually) */
.tab .tab__indicator {
    position: absolute;
    top: 0;
    height: 3px;
    left: var(--indicator-left, 0px);
    width: var(--indicator-width, 0px);
    background: var(--tab-accent);
    border-radius: 999px;
    transition: left 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}

/* Optional: subtle baseline below tabs (not a background) */
.tab::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    background: color-mix(in oklab, var(--tab-accent) 18%, transparent);
    opacity: 0.25;
    border-radius: 999px;
    filter: blur(0.3px);
    pointer-events: none;
    /* The real indicator sits on top of this faint track */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tab .tab__indicator,
    .tab button {
        transition: none !important;
    }
}

/* Style the tab content */
.tabcontent {
    display: flex;
    flex-direction: column;
}

.tabcontent {
    display: flex;
}

.stat {
    display: grid;
    font-size: var(--fs-base);
}

.stat--center {
    justify-items: center;
}

.stat__wrapper {
    display: flex;
    gap: 0.5em;
}

.stat__wrapper--even {
    display: flex;
    justify-content: space-between;
    gap: 0.25em;
}

.stat__wrapper__recent {
    display: grid;
    grid-template-rows: 1fr 1fr 1fr;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.25em;
}

.stat__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5em;
}

.stat__name {
    color: var(--clr-base-lt);
    font-size: var(--fs-sm);
    text-transform: uppercase;
}

.stat__value {
    font-size: var(--fs-base);
    align-self: flex-end;
}

.stat__country {
    width: 30px;
}

.stat__elo {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat__fc-level {
    height: 75%;
    align-self: center;
    width: auto;
}

.stat__recent-games {
    display: flex;
    gap: 0.25em;
}

.stat__recent-games--win {
    color: green;
}

.stat__recent-games--loss {
    color: red;
}

.stat__map {
    position: relative;
    display: grid;
    height: 30px;

    .map {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        filter: brightness(70%) saturate(150%);
    }

    .stat__value {
        position: relative;
        align-self: center;
        justify-self: center;
        font-weight: 700;
        text-shadow: 1px 2px 2px var(--clr-neutral-max);
        z-index: 5;
    }
}

.positive {
    color: green;
}

.negative {
    color: red;
}

.rating__wrapper {
    display: grid;
    place-items: center;
    width: 90%;
}

.rating__wrapper > img,
.rating__wrapper > .stat__value {
    grid-area: 1 / 1;
}

.rating__wrapper > .stat__value {
    justify-self: center;
    align-self: center;
    margin-left: 0.5em;
    font-style: italic;
    font-weight: 700;
    text-shadow: 1px 2px 0px black;

    &.tier1 {
        color: var(--clr-rating-tier-1);
    }

    &.tier2 {
        color: var(--clr-rating-tier-2);
    }

    &.tier3 {
        color: var(--clr-rating-tier-3);
    }

    &.tier4 {
        color: var(--clr-rating-tier-4);
    }

    &.tier5 {
        color: var(--clr-rating-tier-5);
    }

    &.tier6 {
        color: var(--clr-rating-tier-6);
    }

    &.tier7 {
        color: var(--clr-rating-tier-7);
    }
}

.divider {
    height: 2px;
    margin-block: 0.25em;
    background-color: var(--clr-secondary-lt);
    border-radius: 10px;
    opacity: 0.45;
}

/* Index */

.search-wrapper {
    display: grid;
    gap: 5em;
    width: min(25rem, 100%);
    margin-inline: auto;
}

.app-title {
    display: flex;
    justify-content: center;
    font-size: 3rem;
    color: var(--clr-base-lt);

    & .win {
        line-height: 0;
    }

    & .com {
        text-decoration: line-through;
        color: var(--clr-base);
    }

    & > p {
        align-self: flex-end;
    }
}

.profile-input {
    width: 100%;
    padding: 0.5rem;
    background-color: hsla(0, 0%, 0%, 0.7);
    color: white;
    border: none;
    border-radius: 8px 0px 0px 8px;

    &:focus-within {
        outline: 1px solid var(--clr-secondary-lt);
    }
}

.search {
    display: grid;
    grid-template-columns: 1fr auto;
    box-shadow: 0 0 150px 10px var(--clr-secondary-lt);
    transition: box-shadow ease-in-out 0.25s;

    &:focus-within {
        box-shadow: 0 0 150px 10px var(--clr-secondary-dk);
    }
}

.search-btn {
    border: none;
    padding-inline: 0.5em;
    background-color: var(--clr-base-lt);
    border-radius: 0 8px 8px 0;
    transition: background-color ease-in-out 0.15s;

    & > svg {
        width: 18px;
    }

    &:focus-within {
        outline: 1px solid var(--clr-secondary-lt);
    }

    &:hover {
        cursor: pointer;
    }
}

.floating-input-wrapper {
    position: relative;

    & > label {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        color: rgb(120, 120, 120);
        padding: 0.5rem;
        font-size: 0.85rem;
        transition: all 0.3s ease-in-out;
        user-select: none;
    }

    &:focus-within > label,
    & > label:has(+ input:not(:placeholder-shown)) {
        transform: translateY(-180%);
        color: rgb(231, 231, 231);
        font-size: 1rem;
        padding: 0;
    }
}

.content__in-game {
    margin: 0 auto;
    text-decoration: none;
    color: var(--clr-base-lt);
    border: 2px solid orange;
    width: 325px;
    border-radius: 15px;
    padding: 10px;
}

.in-game__wrapper {
    display: flex;
    justify-content: space-between;
}