/* ==========================================================================
   Lineup Feature Stylesheet (Published Lineup View)

   Sections:
   1. Theme Variables & Base Layout Grid
   2. Top Bar, Controls & Formation Selectors
   3. Tactical Pitch, Turf Gradient & Pitch Markings
   4. Slots, Player Tags & Substitutes Bench
   5. Player Selection Drawer, Search & Club Filters
   6. Ranking Badges, Toggles & Personal vs Community Mode
   7. Reset & Share Dialogs
   8. Responsive Viewports & Mobile Breakpoints
   ========================================================================== */

/* ─── 1. Theme Variables & Base Layout Grid ────────────────────────────────── */
:root {
    --bg: #eeeeee;
    --card: #ffffff;
    --muted: #999999;
    --text: #666666;
    --accent: #22c55e;
    --danger: #ef4444;
    --line: #BBBBBB;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial;
    background: var(--bg);
    color: var(--text);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 18px;
}

h1 {
    font-size: 20px;
    margin: 0 0 12px;
    font-weight: 700;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 0.5rem;
}

.card {
    background: var(--card);
    border-radius: 5px;
    padding: 14px;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
}

.card--players {
    max-height: 638px;
    display: flex;
    flex-direction: column;
}

.formation-wrapper {
    display: flex;
}

.formation-wrapper label {
    margin-top: 2px;
    color: var(--text);
}

.formation-select {
    border: 1px solid var(--line);
    color: var(--text);
    padding: 4px 12px;
    padding-right: 20px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
}

.formation-select:hover {
    border-color: var(--accent);
}

.custom-select {
    position: relative;
    display: inline-block;
}

.dropdown-arrow {
    position: absolute;
    right: 5px;
    top: 48%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #999;
    font-size: 14px;
}

.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.row>* {
    flex: 0 0 auto;
}

.row-submit {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 20px;
}

.row-submit>* {
    flex: 0 0 auto;
}

label {
    font-size: 12px;
    color: var(--muted);
}

#clearSearch {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0);
    color: var(--text);
    font-size: 12px;
    line-height: 20px;
    cursor: pointer;
    display: none;
    /* hidden by default */
    padding: 0;
}

#clearSearch:hover {
    background: rgba(255, 255, 255, .9);
}

#clearSearch:active {
    background: rgba(255, 255, 255, .7);
}

/* add some right padding so text doesn't go under the button */
#search {
    padding-right: 36px;
    background: #EEEEEE;
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 10px;
    border-radius: 3px;
    outline: none;
}

#posFilter,
#clubFilter,
#rankSortFilter {
    background: #EEEEEE;
    border: 1px solid var(--line);
    color: var(--text);
    padding: 8px 10px;
    height: 38px;
    line-height: 20px;
    border-radius: 5px;
    outline: none;
    cursor: pointer;
    width: fit-content;
    max-width: 100%;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

.lineupwrap select option {
    background: #ffffff;
    color: #333333;
    font-size: 13px;
}

.custom-select-wrap,
.custom-sort-select {
    position: relative;
    width: 100%;
}

.formation-custom-select-wrap {
    position: relative;
    width: auto;
    display: inline-block;
    margin-left: 5px;
}

.custom-select-trigger,
.custom-sort-trigger {
    display: none;
}

.custom-select-menu,
.custom-sort-menu {
    display: none;
}

.lineupwrap .card--players>.row {
    align-items: flex-end;
}

.lineupwrap .card--players>.row>div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.lineupwrap .card--players>.row>div>br {
    display: none;
}

button {
    background: #0f1730;
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
}

button.primary {
    background: rgba(34, 197, 94, .15);
    border-color: rgba(34, 197, 94, .35);
}

button.primary:hover {
    filter: brightness(0.75)
}

button.danger {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
}

button.danger:hover {
    filter: brightness(0.75)
}

button:disabled {
    opacity: .5;
    cursor: not-allowed;
}


.instruction-tip {
    padding: 6px 10px;
    border-radius: 3px;
    font-size: 12px;
    border: 1px solid var(--line);
    color: var(--muted);
}

/* ─── 2. Tactical Pitch, Turf Gradient & Markings ──────────────────────────── */
/* Pitch */
.pitch {
    margin-top: 15px;
    position: relative;
    border-radius: 5px;
    background: linear-gradient(0deg, rgb(34 197 94 / 65%), rgb(0 232 85 / 65%)), repeating-linear-gradient(90deg, rgb(0 232 85 / 50%) 0 40px, rgb(255 255 255 / 0%) 40px 80px);
    /* background:#36e075; */
    border: 1px solid rgba(34, 197, 94, .25);
    min-height: 520px;
    height: auto;
    overflow: hidden;
    padding: 18px 14px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pitch::before {
    content: "";
    position: absolute;
    inset: 20px;
    border: 2px solid rgba(255, 255, 255, .40);
    border-radius: 10px;
    pointer-events: none;
}

.halfline {
    position: absolute;
    left: 20px;
    right: 20px;
    top: 50%;
    height: 0;
    border-top: 2px solid rgba(255, 255, 255, .40);
    pointer-events: none;
}

.circle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 140px;
    height: 140px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(255, 255, 255, .40);
    border-radius: 50%;
    pointer-events: none;
}

.centerSpot {
    position: absolute;
    margin-top: 1px;
    width: 10px;
    height: 10px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, .40);
    border-radius: 999px;
    pointer-events: none;
}

.boxTop,
.boxBottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 44%;
    height: 18%;
    border: 2px solid rgba(255, 255, 255, .40);
    pointer-events: none;
}

.boxTop {
    top: 20px;
    border-top: none;
    border-radius: 0 0 12px 12px
}

.boxBottom {
    bottom: 20px;
    border-bottom: none;
    border-radius: 10px 10px 0 0
}

.bench {
    margin-top: 10px;
    padding: 10px 10px 4px 10px;
    border-top: 1px solid rgba(255, 255, 255, .10);
    background-color: #d5caa7;
    border-radius: 5px;
    box-sizing: border-box;
}

.benchLabel {
    font-size: 12px;
    color: #666666;
    font-weight: bold;
    margin-bottom: 18px;
}

/* Bench slots: wrap into multiple rows when there are many subs */
.benchRow {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

/* Make SUB slots flexible so ~5 fit per row, then wrap */
.benchRow .slot {
    width: 96px;
    flex: 0 1 96px;
    min-width: 0;
    max-width: 96px;
    height: 68px;
    min-height: 68px;
    margin-top: 0;
    margin-bottom: 10px;
}

#pitchRows {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: 18px;
    padding: 12px 0 6px;
    width: 100%;
    box-sizing: border-box;
}

.slotRow {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    gap: 8px;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}

.slot {
    cursor: pointer;
    width: 96px;
    min-width: 0;
    max-width: 96px;
    flex: 0 1 96px;
    height: 68px;
    min-height: 68px;
    z-index: 100;
    border-radius: 5px;
    border: 1px dashed rgba(255, 255, 255, .18);
    background: rgba(0, 0, 0, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
}

.slot:has(.playerTag) {
    width: 96px;
    min-width: 0;
    max-width: 96px;
    height: 68px;
    min-height: 68px;
}

.slotPosLabel {
    color: #EEEEEE;
    font-size: 12px;
    padding: 12px 8px;
}

.slotActive {
    border-color: rgba(255, 255, 255, .28) !important;
    background: rgba(0, 0, 0, .60) !important;
}

.playerTag {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: inherit;
    background: rgba(15, 23, 48, 0.8);
    padding: 18px 4px 4px;
    box-sizing: border-box;
    cursor: pointer;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.playerTag:hover {
    background: rgba(10, 15, 32, 0.9);
}

.playerTag:active {
    background: rgba(10, 15, 32, 0.8);
}

.playerTagRow {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
}

.playerTagImg {
    position: absolute;
    top: -17px;
    left: 50%;
    transform: translateX(-50%);
    background: #EEEEEE;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, .12);
    flex: 0 0 auto;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
}

.playerTagInfo {
    padding: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    box-sizing: border-box;
    overflow: hidden;
}

.playerTagInfo>* {
    max-width: 100%;
    box-sizing: border-box;
}

.playerTagInfo .n {
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-align: center;
    width: 100%;
    word-break: break-word;
}

.playerTag .n {
    font-size: clamp(0.58rem, 2cqi, 0.68rem);
    color: #AAAAAA;
    font-weight: 700;
    line-height: 1.15;
}

.playerTag .m {
    font-size: clamp(0.5rem, 1.7cqi, 0.58rem);
    line-height: 1.15;
    max-height: 14px;
    color: #9ca3af;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 3px;
    margin-top: 1px;
    padding: 0 2px;
    width: 100%;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
}

.playerTag .m>span {
    font-size: inherit;
    color: inherit;
    line-height: inherit;
}

.playerTag .m>span:first-child {
    flex: 0 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.playerTag .m>span+span {
    flex: 0 0 auto;
}

.playerTag .m.m--single {
    justify-content: center;
}

.playerTag .m:empty {
    display: none;
    margin: 0;
}

.playerTag .x,
.playerTag .playerRemoveX {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 13px;
    height: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--red_btn_color, #A24242);
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    font-size: 8px;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    z-index: 5;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    transition: background-color 0.2s ease, transform 0.15s ease, color 0.2s ease;
    user-select: none;
}

.playerTag .x:hover,
.playerTag .playerRemoveX:hover {
    background: #FFFFFF;
    color: var(--red_btn_hover_color, #aa5055);
    transform: scale(1.12);
}

.playerTag .x:active,
.playerTag .playerRemoveX:active {
    background: #fdf5f5;
    color: var(--red_btn_active_color, #8e3237);
    transform: scale(0.92);
}

.playerTag .x svg,
.playerTag .playerRemoveX svg {
    display: block;
    width: 7px;
    height: 7px;
    pointer-events: none;
    stroke: currentColor;
    flex-shrink: 0;
}

/* ─── 3. Player Selection Drawer, Search & Club Filters ─────────────────────── */
/* Player list */
.list {
    overflow: auto;
    border: 1px solid var(--line);
    scrollbar-width: thin;
    contain: layout paint;
}

.listHeader {
    margin-top: 10px;
    background: #FFFFFF;
    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    padding: 10px;
    z-index: 2;
}

.listItem {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    gap: 10px;
}

.listItem:not(:last-child) {
    border-bottom: 1px solid #BBBBBB;
}

.listItem:hover {
    background: rgba(255, 255, 255, .03);
}

.playerImg {
    width: 55px;
    height: 55px;
    border-radius: 2px;
    background: #FAFAFA;
    box-shadow: 0 0 10px -5px black;
    object-fit: cover;
    flex: 0 0 auto;
    box-shadow: rgb(0 0 0 / 25%) 0px 1px 2px 0px, rgb(0 0 0 / 12%) 0px 0px 0px 1px;
}

.liMain {
    display: flex;
    gap: 10px;
    align-items: center;
    min-width: calc(100% - 100px);
}

.liText {
    min-width: 0;
}

.liName {
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.liDesc {
    font-size: 12px;
    color: #686868;
    line-height: 1.35;

    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    /* number of lines before ellipsis */
    -webkit-box-orient: vertical;

    margin: 2px 0 4px 0;
}

.liMeta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    gap: 10px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.playerprice {
    color: var(--text);
    font-weight: bold;
    border: 1px solid var(--line);
    padding: 0 4px;
    border-radius: 999px;
    text-align: center;
    align-self: center;
}

.liBtn {
    display: flex;
    gap: 8px;
}

.mini {
    padding: 8px 10px;
    font-size: 12px;
    border-radius: 3px;
}

.ok {
    color: var(--accent);
    font-weight: 700;
}

.bad {
    color: var(--danger);
    font-weight: 700;
}

.note {
    font-size: 10px;
    text-align: center;
    color: #444444;
    margin-top: 10px;
    line-height: 1.4;
}

.toast {
    margin-top: 0px;
    border-radius: 10px;
    text-align: center;
    padding: 10px 12px;
    display: none;
}

.toastOverlay {
    position: absolute;
    top: calc(50% - 20px);
    left: 50%;
    transform: translateX(-50%);
    width: min(520px, calc(100% - 28px));
    z-index: 200;

    box-shadow: 0 14px 30px rgba(0, 0, 0, .35);
    backdrop-filter: blur(6px);
}

.toast.error {
    background: rgba(255, 255, 255, .75);
}

.toast.success {
    background: rgba(255, 255, 255, .75);
}

.miniPitch {
    position: relative;
    width: 100%;
    max-width: 1080px;
    /* or whatever max size you want */
    aspect-ratio: 1 / 1;
    /* ← THIS makes it perfectly square */
    background: #40d878;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
}

/* subtle stripes */
.miniPitch:before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg,
            rgba(0, 0, 0, .00) 0 8.333333333%,
            rgba(255, 255, 255, .3) 8.333333333% 16.66666667%,
            rgba(0, 0, 0, .00) 16.66666667% 25%,
            rgba(255, 255, 255, .3) 25% 33.33333333%,
            rgba(0, 0, 0, .00) 33.33333333% 41.66666667%,
            rgba(255, 255, 255, .3) 41.66666667% 50%,
            rgba(0, 0, 0, .00) 50% 58.33333333%,
            rgba(255, 255, 255, .3) 58.33333333% 66.66666667%,
            rgba(0, 0, 0, .00) 66.66666667% 75%,
            rgba(255, 255, 255, .3) 75% 83.33333333%,
            rgba(0, 0, 0, .00) 83.33333333% 91.66666667%,
            rgba(255, 255, 255, .3) 91.66666667% 100%);
    opacity: .7;
    pointer-events: none;
}

/* markings */
.miniPitch .midLine {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: rgba(255, 255, 255, .40);
}

.miniPitch .centerCircle {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 28%;
    height: 28%;
    border: 2px solid rgba(255, 255, 255, .40);
    border-radius: 999px;
    transform: translate(-50%, -50%);
}

.miniPitch .centerSpot {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2.5%;
    height: 2.5%;
    background: rgba(255, 255, 255, .40);
    border-radius: 999px;
    transform: translate(-50%, -50%);
}

.miniPitch .penBoxTop,
.miniPitch .penBoxBottom {
    position: absolute;
    left: 50%;
    width: 44%;
    height: 18%;
    transform: translateX(-50%);
    border-right: 2px solid rgba(255, 255, 255, .40);
    border-left: 2px solid rgba(255, 255, 255, .40);
    box-sizing: border-box;
}

.miniPitch .penBoxTop {
    top: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-bottom: 2px solid rgba(255, 255, 255, .40);
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.miniPitch .penBoxBottom {
    bottom: 0;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top: 2px solid rgba(255, 255, 255, .40);
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.miniRow {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    pointer-events: none;
}

.miniAvatar {
    width: 10.75%;
    aspect-ratio: 1 / 1;
    border-radius: 5px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
    background: #FFFFFF;
}

#containerholderwrapper {
    min-width: 0;
}

#container,
#contentholder,
.lineupwrap {
    min-width: 0;
    max-width: 100%;
}

#contentholder {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#contenthighlightsbar {
    gap: 0;
}

.clickedcontentnumberofpeopleranked:after,
.contentviewnumber:after {
    display: none;
}

#contenttitlebarwide {
    width: 100%;
    border-radius: 5px;
    position: relative;
}

.contentflagandnotificationcontrol {
    z-index: 100;
}

.contentflagasdropdown {
    z-index: 1000;
}

#commentholder {
    width: 100%;
    border-radius: 5px;
    margin-top: 0 !important;
    box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
}

.lessrankprivacyoptions {
    position: relative;
}

.allcontentsharebutton {
    width: fit-content;
}

.contentintrodescriptioncontainer {
    width: 100% !important;
    border-radius: 5px;
}

#galleryimageonegetty {
    height: 100% !important;
}

.introimageclosebuttonformobile {
    top: 0 !important;
    display: none;
}

.withoutdesc {
    display: none;
}

.norelatedlisttitle {
    border-radius: 5px;
    box-shadow: var(--white_card_shadow);
}

#suggestionsholder_parent {
    position: relative;
}

.suggestionsfooter {
    border-bottom-left-radius: 5px;
    border-bottom-right-radius: 5px;
}

/* Smooth hover effect for player list items */
#players .listItem {
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

#players .listItem:hover {
    background-image: -webkit-linear-gradient(bottom, #FFFFFF 5%, #E5E5E5 50%);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.10);
}

/* Keep action buttons above the hover surface */
#players .listItem .liBtn {
    position: relative;
    z-index: 2;
}


/* ─── 4. Ranking Badges, Toggles & Mode Transitions ────────────────────────── */
/* Rank badges and toggles */
.rank-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    line-height: 1.4;
}

.avg-rank-pill {
    background: rgba(234, 179, 8, 0.15);
    color: #b45309;
    border: 1px solid rgba(234, 179, 8, 0.35);
}

.my-rank-pill {
    background: rgba(59, 130, 246, 0.15);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.playerTagRank {
    position: absolute;
    top: -6px;
    left: -4px;
    background: #d97706;
    color: #ffffff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 5px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none;
}

.lineupwrap .card>.row:first-child {
    width: 100%;
    min-width: 0;
}

.rank-type-toggle-wrapper {
    display: flex;
    flex-wrap: nowrap;
    padding: 6px 8px;
    align-items: center;
    min-height: 50px;
    height: auto;
    gap: 8px;
    background-color: var(--light_btn_color);
    border-radius: 3px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1 1 100%;
    justify-content: space-between;
    box-sizing: border-box;
}

.rank-pill-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    flex: 1 1 0;
    min-width: 0;
}

.rank-toggle {
    display: flex;
    gap: 5px;
    align-items: center;
    flex: 0 0 auto;
    margin-inline-start: auto;
}

.rank-toggle>div {
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.rank-toggle>div:hover {
    transform: scale(1.06);
}

.lineupwrap #analyticsbutton {
    position: relative !important;
    top: 0 !important;
    right: 0 !important;
    margin: 0 !important;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    background-image: var(--list_sprite_image);
    background-size: var(--list_sprite_size);
    background-position: -40px -160px;
    cursor: pointer;
    z-index: 1;
}

.pill {
    padding: 3px 5px;
    border-radius: 3px;
    font-size: 12px;
    border: 1px solid #999;
    color: #666;
    white-space: nowrap;
}

.pill strong {
    color: #333;
}

.rank-pill-header strong {
    color: #333;
}

/* ─── Smooth Pitch Switch Transition ───────────────────────────────────────── */
#pitchRows {
    transition: opacity 0.18s cubic-bezier(0.4, 0, 0.2, 1), transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

#pitchRows.pitch-fading {
    opacity: 0.08;
    transform: scale(0.985);
}


@keyframes bannerFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pitch in Avg Rank Mode: read-only, non-interactive */
#pitch.avgRankReadOnly .slot {
    cursor: default;
    pointer-events: none;
}

#pitch.avgRankReadOnly .playerTag {
    cursor: default;
    pointer-events: none;
    opacity: 0.95;
}

/* Avg rank tag badge on pitch cards */
.playerTagRank.avgRankTag {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

/* My rank tag badge on pitch cards */
.playerTagRank.myRankTag {
    background: linear-gradient(135deg, #2563eb, #3b82f6);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.45);
}

/* Avg rank player card — subtle gold tint */
.playerTag.avgRankPlayer {
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(15, 23, 48, 0.8);
}

.contentintrothumbcontainer,
.contenttitlefollowunfollwbuttonstyle,
.allcontentsharebutton {
    border-radius: 3px;
}

.lineupwrap #communityranktoggleid,
.lineupwrap #personalranktoggleid {
    padding: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.relatedliholder {
    border-radius: 5px;
}

.relatedlisttitle {
    border-radius: 3px;
}

.selectedpersonalranktoggle,
.selectedcommunityranktoggle {
    border-radius: 3px;
}

.usersresponse_listboxinner.lineup_usersresponse_listboxinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

.usersresponse_listboxinner .lineupwrap {
    width: 100%;
    height: 100%;
    padding: 0 4px 4px;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
}

.usersresponse_listboxinner .lineupwrap .miniPitch {
    position: relative;
    width: min(100%, 380px);
    height: auto;
    max-height: 100%;
    aspect-ratio: 210 / 230;
    border-radius: 5px;
    margin: auto;
    overflow: hidden;
    background: linear-gradient(180deg, #6cdb95 0%, #40d878 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 2.69%;
    box-sizing: border-box;
}

.usersresponse_listboxinner .lineupwrap .miniPitch .miniPlayerItem {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 1 1 0;
    min-width: 0;
    max-width: 78px;
    padding: 0 2px;
    box-sizing: border-box;
}

.usersresponse_listboxinner .lineupwrap .miniPitch .miniAvatar {
    width: 2.9rem;
    height: 2.9rem;
    border-radius: 5px;
    object-fit: cover;
    border: 1.5px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    background: #fff;
    flex: 0 0 auto;
}

.usersresponse_listboxinner .lineupwrap .miniPitch .miniPlayerName {
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
    background: rgba(15, 23, 48, 0.78);
    padding: 1px 5px;
    border-radius: 3px;
    max-width: 100%;
    white-space: nowrap;
    overflow: clip;
    text-overflow: ellipsis;
    text-align: center;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.lineupwrap:has(.grid) {
    width: 100%;
    box-sizing: border-box;
}

.lineupwrap .grid {
    width: 100%;
    box-sizing: border-box;
}

.lineupwrap .card {
    min-height: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.lineupwrap .searchWrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
}

#submitinstructions {
    background-color: #fff;
    border-radius: 3px;
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
}

.contentintroductionthumb {
    max-inline-size: fit-content;
}

.postcommenttext,
#ranksubmitbutton {
    border-radius: 3px;
}

.newcontentsharepopuppreview,
#rankresetconfirmmessage {
    border-radius: 5px;
}

.new_social_share_popup_list_share_option_avg_rank_holder,
.new_social_share_popup_list_share_option_my_rank_holder,
.new_social_share_popup_item_share_option_avg_rank_holder,
.new_social_share_popup_item_share_option_my_rank_holder,
.new_social_share_popup_share_url_holder,
.new_social_share_popup_share_button_holder,
.facebook_icon_holder,
#rankresetconfirmmessagebuttondeleteonly,
#rankresetconfirmmessagebuttoncancel,
#redirecttosourceconfirmmessagebuttonconfirm,
#redirecttosourceconfirmmessagebuttoncancel,
.rankresetconfirmmessagebuttondelete,
#rankresetconfirmmessagebuttonundo,
#rankprivacybuttonclick,
#submitinstructionstext {
    border-radius: 3px;
}

#listembedcode {
    scrollbar-width: thin;
}

.listlikedusersgpopup,
.listembedpopup,
.newcontentsharepopup,
.usersresponsepopupview,
#analyticspopup,
#adsandrelated,
.contentitemquickviewpopup,
.contentitemsharepopup,
.contentitemsharepopup {
    border-radius: 5px;
}

.noresponsetosharepopupshown,
#submitthensharepopupmsg {
    border-radius: 5px !important;
}
.newprofilesubscribebutton,
.newprofilesubscribedbutton,
.norelatedlistcreate {
    border-radius: 3px;
}

.twitterpreviewholder .new_social_share_popup_preview_image {
    border-radius: 0;
}

.newunsubscribeconfirmholder {
    border-radius: 5px;
    z-index: 105;
}

/* ─── 5. Responsive Viewports & Media Queries ──────────────────────────────── */
@media (max-width: 980px) {
    .grid {
        grid-template-columns: minmax(0, 1fr);
    }

    #adsandrelated {
        border-radius: 5px;
    }

    .lineupwrap .card,
    .lineupwrap .card--players {
        overflow: visible;
    }

    .lineupwrap .card>.row {
        position: relative;
        z-index: 25;
    }

    .lineupwrap .card--players>.row {
        position: relative;
        z-index: 20;
    }

    .lineupwrap .formation-custom-select-wrap {
        width: auto;
        min-width: 100px;
    }

    .lineupwrap .formation-custom-select-wrap .dropdown-arrow {
        display: none !important;
    }

    .lineupwrap .formation-custom-select-wrap .custom-select-trigger {
        width: 100%;
        min-width: 100px;
        height: 32px;
        line-height: 18px;
        padding: 4px 10px;
        font-size: 13px;
        font-weight: 600;
        background: #EEEEEE;
    }

    .lineupwrap .sort-by-filter-wrapper {
        position: relative;
    }

    .lineupwrap .custom-select-wrap,
    .lineupwrap .custom-sort-select {
        position: relative;
        width: 100%;
    }

    .lineupwrap .custom-select-wrap select,
    .lineupwrap .custom-sort-select #rankSortFilter {
        display: none !important;
    }

    .lineupwrap .custom-select-trigger,
    .lineupwrap .custom-sort-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: #EEEEEE;
        border: 1px solid var(--line);
        color: var(--text);
        padding: 8px 6px;
        height: 36px;
        line-height: 18px;
        border-radius: 3px;
        font-size: 12px;
        cursor: pointer;
        box-sizing: border-box;
        width: 100%;
        user-select: none;
        white-space: nowrap;
        overflow: hidden;
    }

    .lineupwrap .custom-select-trigger .custom-select-label,
    .lineupwrap .custom-sort-trigger .custom-sort-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1 1 auto;
        text-align: center;
    }

    .lineupwrap .custom-select-trigger .custom-select-arrow,
    .lineupwrap .custom-sort-trigger .custom-sort-arrow {
        font-size: 9px;
        color: #777;
        margin-left: 4px;
        flex: 0 0 auto;
    }

    .lineupwrap .custom-select-menu,
    .lineupwrap .custom-sort-menu {
        position: absolute;
        top: calc(100% + 4px);
        min-width: 150px;
        max-width: calc(100vw - 20px);
        max-height: 240px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #ffffff;
        border: 1px solid var(--line);
        border-radius: 6px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
        z-index: 1000;
        display: none;
        box-sizing: border-box;
    }

    .lineupwrap .custom-select-wrap.is-left .custom-select-menu {
        left: 0;
        right: auto;
    }

    .lineupwrap .custom-select-wrap.is-center .custom-select-menu {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }

    .lineupwrap .custom-select-wrap.is-right .custom-select-menu,
    .lineupwrap .custom-select-wrap.is-right-mobile .custom-select-menu,
    .lineupwrap .custom-sort-menu {
        right: 0;
        left: auto;
    }

    .lineupwrap .custom-select-wrap.is-open .custom-select-menu,
    .lineupwrap .custom-sort-select.is-open .custom-sort-menu {
        display: block;
    }

    .lineupwrap .custom-select-option,
    .lineupwrap .custom-sort-option {
        padding: 9px 12px;
        font-size: 12px;
        color: #333333;
        cursor: pointer;
        white-space: nowrap;
        transition: background 0.15s ease;
        text-align: left;
    }

    .lineupwrap .custom-select-option:hover,
    .lineupwrap .custom-select-option:active,
    .lineupwrap .custom-sort-option:hover,
    .lineupwrap .custom-sort-option:active {
        background: #f0f4f8;
        color: #111111;
    }

    .lineupwrap .custom-select-option.selected,
    .lineupwrap .custom-sort-option.selected {
        background: #e8f0fe;
        color: #1a73e8;
        font-weight: 600;
    }
}

@media (max-width: 1240px) {
    .lineupwrap .rank-type-toggle-wrapper {
        padding: 6px;
        gap: 6px;
    }

    .lineupwrap .rank-pill-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, max-content));
        gap: 4px 5px;
        flex: 0 1 auto;
    }

    .lineupwrap .pill {
        font-size: 11px;
        padding: 2px 5px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .lineupwrap .rank-toggle {
        gap: 4px;
    }
}

@media (max-width: 640px) {
    .lineupwrap .formation-wrapper {
        width: 100%;
        align-items: center;
        justify-content: space-between;
    }

    .lineupwrap .formation-wrapper br {
        display: none;
    }

    .lineupwrap .formation-custom-select-wrap {
        width: auto;
        min-width: 90px;
    }

    .lineupwrap .formation-custom-select-wrap .custom-select-trigger {
        min-width: 90px;
        height: 30px;
        font-size: 12px;
        padding: 4px 8px;
    }

    .lineupwrap .rank-type-toggle-wrapper {
        padding: 6px;
        gap: 6px;
    }

    .lineupwrap .rank-pill-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, max-content));
        gap: 4px 5px;
        flex: 0 1 auto;
    }

    .lineupwrap .pill {
        font-size: 11px;
        padding: 2px 5px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .lineupwrap .rank-toggle {
        gap: 4px;
    }

    .lineupwrap .note {
        font-size: 11px;
        padding: 0 4px;
    }

    .lineupwrap .pitch {
        min-height: 400px;
        padding: 12px 6px;
        margin-top: 10px;
        border-radius: 5px;
    }

    .lineupwrap .pitch::before {
        inset: 10px;
        border-radius: 5px;
    }

    .lineupwrap .halfline {
        left: 10px;
        right: 10px;
    }

    .lineupwrap .boxTop {
        top: 10px;
        width: 48%;
    }

    .lineupwrap .boxBottom {
        bottom: 10px;
        width: 48%;
    }

    .lineupwrap .circle {
        width: 96px;
        height: 96px;
    }

    .lineupwrap #pitchRows {
        gap: 14px;
        padding: 10px 0 4px;
    }

    .lineupwrap .slotRow {
        gap: 4px;
        padding: 0 2px;
    }

    .lineupwrap .slot,
    .lineupwrap .slot:has(.playerTag),
    .lineupwrap .benchRow .slot {
        width: 76px;
        flex: 0 1 76px;
        min-width: 0;
        max-width: 76px;
        height: 60px;
        min-height: 60px;
        border-radius: 5px;
    }

    .lineupwrap .slotPosLabel {
        font-size: 10px;
        padding: 8px 4px;
    }

    .lineupwrap .playerTag {
        padding: 14px 3px 3px;
        border-radius: 5px;
    }

    .lineupwrap .playerTagImg {
        width: 28px;
        height: 28px;
        top: -14px;
    }

    .lineupwrap .playerTag .n {
        font-size: 0.6rem;
        line-height: 1.15;
    }

    .lineupwrap .playerTag .m {
        font-size: 0.52rem;
        gap: 2px;
        padding: 0 1px;
    }

    .lineupwrap .playerTagRank {
        font-size: 8px;
        padding: 1px 4px;
        top: -5px;
        left: -2px;
    }

    .lineupwrap .bench {
        padding: 8px 6px 4px;
    }

    .lineupwrap .benchLabel {
        margin-bottom: 14px;
    }

    .lineupwrap .benchRow {
        gap: 6px;
    }

    .lineupwrap .benchRow .slot {
        margin-bottom: 8px;
    }

    .lineupwrap .card--players {
        max-height: 520px;
    }

    .lineupwrap .card--players>.row {
        gap: 8px;
        align-items: flex-end;
    }

    .lineupwrap .card--players>.row>div {
        display: flex;
        flex-direction: column;
        gap: 4px;
        min-width: 0;
    }

    .lineupwrap .card--players>.row>div>br {
        display: none;
    }

    .lineupwrap .card--players>.row>div:first-child {
        flex: 1 1 100%;
        width: 100%;
    }

    .lineupwrap #search {
        width: 100%;
        box-sizing: border-box;
    }

    .lineupwrap .card--players>.row>div:not(:first-child) {
        flex: 1 1 calc(33.333% - 6px);
        min-width: 0;
    }

    .lineupwrap #posFilter,
    .lineupwrap #clubFilter,
    .lineupwrap #rankSortFilter {
        width: 100%;
        height: 36px;
        line-height: 18px;
        box-sizing: border-box;
        padding: 8px 6px;
        font-size: 12px;
    }

    .lineupwrap .listItem {
        padding: 8px;
        gap: 8px;
    }

    .lineupwrap .liMain {
        flex: 1 1 0;
        min-width: 0;
    }

    .lineupwrap .playerImg {
        width: 44px;
        height: 44px;
    }

    .usersresponse_listboxinner .lineupwrap .miniPitch .miniAvatar {
        width: 2.25rem;
        height: 2.25rem;
    }

    .usersresponse_listboxinner .lineupwrap .miniPitch .miniPlayerName {
        font-size: 0.56rem;
        padding: 1px 3px;
    }

    #listembedpopup {
        margin-top: 20px;
    }

    .listlikedusersgpopup,
    .usersresponsepopupview {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    #contenttitlebarwide {
        position: relative;
        width: 100%;
        border-radius: 0;
        background-color: #fff;
        box-shadow: rgba(0, 0, 0, 0.05) 0px 6px 24px 0px, rgba(0, 0, 0, 0.08) 0px 0px 0px 1px;
        padding: 10px 10px 48px;
        box-sizing: border-box;
    }

    .lineupwrap .card {
        padding: 10px;
        border-radius: 0;
    }

    #contenttitletext {
        font-size: 15px;
        font-weight: 700;
        color: #1e293b;
        line-height: 1.25;
        margin: 0 0 3px 0;
        padding-right: 28px;
        word-break: break-word;
    }

    .contentintrothumbcontainer {
        width: 62px;
        height: 62px;
        border-radius: 3px;
        overflow: hidden;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .contenttitlewide {
        width: calc(100% - 72px);
        margin-left: 10px;
    }

    .contenttitledetailsholder {
        width: calc(100% - 72px);
        margin-left: 10px;
        position: static;
    }

    .contenttitlebarbottomsection {
        position: static;
        margin-top: 0;
        gap: 2px;
    }

    .contentpublishdate {
        font-size: 11px;
        color: #888;
        line-height: 1.2;
    }

    #contenthighlightsbar {
        font-size: 11px;
        color: #888;
        line-height: 1.2;
        margin: 1px 0 4px;
    }

    .contenttitlelikedislikeandsharebuttonholder {
        margin-top: 2px;
    }

    .contenttitlechannelholder {
        position: absolute !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 44px;
        padding: 0 10px;
        box-sizing: border-box;
        border-top: 1px solid var(--line, #e2e8f0);
        background: #fafafa;
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: nowrap;
        gap: 8px;
    }

    .channelinnerwrapper {
        display: flex;
        align-items: center;
        min-width: 0;
        flex: 1 1 auto;
    }

    .channelinnerwrapper a {
        display: flex;
        align-items: center;
        gap: 7px;
        min-width: 0;
        text-decoration: none;
    }

    .channelinnerwrapper .channelimage {
        width: 26px;
        height: 26px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
    }

    #contenttitlechannelname {
        font-size: 12px;
        font-weight: 600;
        color: #334155;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .subscribebuttonholder {
        flex-shrink: 0;
        margin-left: auto;
    }

    .followbuttonbackground {
        height: 26px !important;
        line-height: 26px !important;
        padding: 0 10px !important;
        font-size: 11px !important;
        font-weight: 600 !important;
        border-radius: 3px !important;
        transition: background-color 0.15s ease, transform 0.1s ease;
    }

    .allcontentsharebutton {
        border-radius: 3px;
        height: 26px;
        line-height: 26px;
        padding: 0 8px;
        font-size: 11px;
    }

    .newcontentsharepopuppreview {
        height: 100%;
        border-radius: 0;
    }

    #analyticspopupclose {
        top: 5px;
    }

    #contenttitlebarwide .contentflagandnotificationcontrol {
        top: 6px;
        right: 6px;
        width: 26px;
        height: 26px;
        border-radius: 4px;
        z-index: 100;
    }

    .contentflagasdropdown {
        border-radius: 5px;
        z-index: 1000;
        box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
        border: 1px solid rgba(0, 0, 0, 0.08);
    }

    #analyticspopup,
    #submitinstructions,
    #commentholder,
    #adsandrelated,
    .newcontentsharepopup {
        border-radius: 0;
    }

    .contenttitlelikedislikeandsharebuttonholder {
        border-radius: 5px;
    }
}

@media (max-width: 390px) {
    .lineupwrap .rank-type-toggle-wrapper {
        padding: 5px;
        gap: 4px;
    }

    .lineupwrap .pill {
        font-size: 10px;
        padding: 2px 4px;
    }

    .lineupwrap .slot,
    .lineupwrap .slot:has(.playerTag),
    .lineupwrap .benchRow .slot {
        width: 66px;
        flex: 0 1 66px;
        min-width: 0;
        max-width: 66px;
        height: 54px;
        min-height: 54px;
    }

    .lineupwrap .playerTag {
        padding: 12px 2px 2px;
    }

    .lineupwrap .playerTagImg {
        width: 24px;
        height: 24px;
        top: -12px;
    }

    .lineupwrap .playerTag .n {
        font-size: 0.55rem;
    }

    .lineupwrap .playerTag .m {
        font-size: 0.48rem;
    }
}