﻿:root {
    --sl-green: #5b8c3b;
    --sl-green-dark: #3f6f29;
    --sl-navy: #071a33;
    --sl-navy-soft: #123b60;
    --sl-slate: #64748b;
    --sl-border: #dfe7ef;
    --sl-page: #f3f6f9;
    --sl-gold: #f4c542;
    --sl-danger: #dc2626;
}

.set-lineup-page {
    min-height: 100vh;
    background: radial-gradient(circle at top right, rgba(91, 140, 59, .12), transparent 32rem), var(--sl-page);
    color: var(--sl-navy);
}

.set-lineup-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 20px;
    padding: 27px 29px;
    border-radius: 23px;
    background: linear-gradient(125deg, #071a33, #123b60);
    box-shadow: 0 20px 48px rgba(7, 26, 51, .17);
    color: #fff;
}

.set-lineup-eyebrow {
    display: inline-block;
    margin-bottom: 8px;
    color: #c4dfa9;
    font-size: .76rem;
    font-weight: 900;
}

.set-lineup-hero h1 {
    margin: 0;
    font-size: clamp(1.65rem, 3vw, 2.45rem);
    font-weight: 900;
}

.set-lineup-match-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 13px;
}

    .set-lineup-match-meta span {
        display: inline-flex;
        min-height: 30px;
        align-items: center;
        padding: 0 10px;
        border: 1px solid rgba(255, 255, 255, .15);
        border-radius: 999px;
        background: rgba(255, 255, 255, .08);
        color: rgba(255, 255, 255, .82);
        font-size: .7rem;
        font-weight: 800;
    }

.set-lineup-hero .btn {
    min-height: 43px;
    border-radius: 11px;
    font-weight: 900;
}

.set-lineup-overview {
    display: grid;
    grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(170px, .65fr));
    gap: 14px;
    margin-bottom: 18px;
}

    .set-lineup-overview article {
        min-height: 112px;
        padding: 18px;
        border: 1px solid var(--sl-border);
        border-radius: 18px;
        background: #fff;
        box-shadow: 0 11px 28px rgba(15, 23, 42, .06);
    }

.set-lineup-team-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.set-lineup-club-logo {
    display: grid;
    width: 72px;
    height: 72px;
    flex: 0 0 auto;
    overflow: hidden;
    place-items: center;
    border: 1px solid var(--sl-border);
    border-radius: 18px;
    background: #f8fafc;
    font-size: 1.5rem;
    font-weight: 900;
}

    .set-lineup-club-logo img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 7px;
    }

.set-lineup-team-copy,
.set-lineup-info-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
}

    .set-lineup-team-copy > span,
    .set-lineup-info-card > span {
        color: var(--sl-slate);
        font-size: .72rem;
        font-weight: 900;
    }

    .set-lineup-team-copy h2 {
        overflow: hidden;
        margin: 3px 0 0;
        font-size: 1.12rem;
        font-weight: 900;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .set-lineup-team-copy small,
    .set-lineup-info-card small {
        margin-top: 3px;
        color: var(--sl-slate);
        font-size: .68rem;
    }

    .set-lineup-info-card strong {
        margin-top: 5px;
        font-size: 1.15rem;
        font-weight: 900;
    }

.set-lineup-progress-track {
    height: 8px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 999px;
    background: #e8edf2;
}

    .set-lineup-progress-track span {
        display: block;
        height: 100%;
        border-radius: inherit;
        background: linear-gradient(90deg, var(--sl-green), #86b95d);
        transition: width .35s ease;
    }

.set-lineup-workspace {
    display: grid;
    grid-template-columns: minmax(520px, 1.45fr) minmax(350px, .8fr);
    grid-template-areas: "pitch roster";
    align-items: start;
    gap: 18px;
    direction: ltr;
}

.set-lineup-pitch-panel,
.set-lineup-roster-panel {
    direction: rtl;
    border: 1px solid var(--sl-border);
    border-radius: 21px;
    background: #fff;
    box-shadow: 0 14px 36px rgba(15, 23, 42, .07);
}

.set-lineup-pitch-panel {
    grid-area: pitch;
    padding: 21px;
}

.set-lineup-roster-panel {
    grid-area: roster;
    position: sticky;
    top: 12px;
    padding: 19px;
}

.set-lineup-panel-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 17px;
}

    .set-lineup-panel-heading > div > span {
        color: var(--sl-green-dark);
        font-size: .7rem;
        font-weight: 900;
    }

    .set-lineup-panel-heading h2 {
        margin: 3px 0 0;
        font-size: 1.12rem;
        font-weight: 900;
    }

    .set-lineup-panel-heading p {
        margin: 6px 0 0;
        color: var(--sl-slate);
        font-size: .78rem;
        line-height: 1.75;
    }

.set-lineup-tools {
    display: flex;
    gap: 7px;
    white-space: nowrap;
}

    .set-lineup-tools .btn {
        border-radius: 9px;
        font-size: .7rem;
        font-weight: 900;
    }

.set-lineup-pitch-shell {
    padding: 11px;
    border-radius: 20px;
    background: #e8eee5;
}

.set-lineup-pitch {
    position: relative;
    width: min(100%, 690px);
    aspect-ratio: 68 / 105;
    margin-inline: auto;
    overflow: visible;
    border: 5px solid rgba(255, 255, 255, .93);
    border-radius: 17px;
    background: #4a9138;
    box-shadow: 0 18px 36px rgba(24, 59, 23, .22);
    isolation: isolate;
}

.pitch-grass-stripes {
    position: absolute;
    inset: 0;
    z-index: -3;
    border-radius: 11px;
    background: repeating-linear-gradient( 0deg, rgba(255, 255, 255, .055) 0, rgba(255, 255, 255, .055) 9.09%, rgba(0, 0, 0, .025) 9.09%, rgba(0, 0, 0, .025) 18.18%);
}

.pitch-boundary {
    position: absolute;
    inset: 2.4%;
    z-index: -1;
    border: 2px solid rgba(255, 255, 255, .88);
}

.pitch-halfway {
    position: absolute;
    z-index: -1;
    top: 50%;
    right: 2.4%;
    left: 2.4%;
    border-top: 2px solid rgba(255, 255, 255, .88);
}

.pitch-centre-circle {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: 19%;
    aspect-ratio: 1;
    border: 2px solid rgba(255, 255, 255, .88);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.pitch-centre-dot {
    position: absolute;
    z-index: -1;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    transform: translate(-50%, -50%);
}

.pitch-penalty-area,
.pitch-goal-area,
.pitch-goal {
    position: absolute;
    z-index: -1;
    left: 50%;
    border: 2px solid rgba(255, 255, 255, .88);
    transform: translateX(-50%);
}

.pitch-penalty-area {
    width: 58%;
    height: 16%;
}

.pitch-goal-area {
    width: 29%;
    height: 7%;
}

.pitch-goal {
    width: 18%;
    height: 2.5%;
    border-style: dashed;
}

.pitch-penalty-area.is-top,
.pitch-goal-area.is-top {
    top: 2.4%;
    border-top: 0;
}

.pitch-goal.is-top {
    top: -.4%;
}

.pitch-penalty-area.is-bottom,
.pitch-goal-area.is-bottom {
    bottom: 2.4%;
    border-bottom: 0;
}

.pitch-goal.is-bottom {
    bottom: -.4%;
}

.formation-slot {
    position: absolute;
    z-index: 4;
    top: var(--slot-y);
    left: var(--slot-x);
    width: clamp(70px, 13%, 96px);
    min-height: 76px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    transform: translate(-50%, -50%);
    transition: transform .22s ease, filter .22s ease;
}

    .formation-slot:hover,
    .formation-slot.is-drop-target {
        z-index: 8;
        transform: translate(-50%, -50%) scale(1.08);
        filter: drop-shadow(0 8px 13px rgba(0, 0, 0, .25));
    }

.formation-slot-target {
    display: grid;
    width: 51px;
    height: 51px;
    margin: 0 auto;
    place-items: center;
    border: 2px dashed rgba(255, 255, 255, .92);
    border-radius: 50%;
    background: rgba(7, 26, 51, .36);
    color: #fff;
    backdrop-filter: blur(3px);
}

    .formation-slot-target span {
        font-size: .65rem;
        font-weight: 900;
    }

.formation-slot-player {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.formation-slot.is-filled .formation-slot-target {
    display: none;
}

.formation-slot.is-filled .formation-slot-player {
    display: flex;
}

.formation-player-photo {
    position: relative;
    display: grid;
    width: 55px;
    height: 55px;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--sl-navy), var(--sl-navy-soft));
    color: #fff;
    box-shadow: 0 7px 16px rgba(0, 0, 0, .28);
}

    .formation-player-photo img {
        width: 100%;
        height: 100%;
        border-radius: inherit;
        object-fit: cover;
    }

.formation-player-initial {
    font-size: 1rem;
    font-weight: 900;
}

.formation-player-photo b {
    position: absolute;
    right: -4px;
    bottom: -3px;
    display: grid;
    min-width: 22px;
    height: 22px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--sl-gold);
    color: var(--sl-navy);
    font-size: .58rem;
}

.formation-player-name {
    display: block;
    width: 100%;
    overflow: hidden;
    padding: 3px 5px;
    border-radius: 7px;
    background: rgba(7, 26, 51, .86);
    color: #fff;
    font-size: .62rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.formation-slot-player small {
    color: #fff;
    font-size: .56rem;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
}

.formation-slot-remove {
    position: absolute;
    top: -4px;
    left: 3px;
    display: none;
    width: 23px;
    height: 23px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--sl-danger);
    color: #fff;
    font-size: .8rem;
    font-weight: 900;
}

.formation-slot.is-filled:hover .formation-slot-remove {
    display: grid;
}

.formation-slot.just-assigned .formation-player-photo {
    animation: player-arrives .58s cubic-bezier(.22, 1.3, .42, 1);
}

@keyframes player-arrives {
    0% {
        transform: translateY(-24px) scale(.35) rotate(-8deg);
        opacity: 0;
    }

    70% {
        transform: translateY(3px) scale(1.12) rotate(2deg);
        opacity: 1;
    }

    100% {
        transform: translateY(0) scale(1) rotate(0);
    }
}

.set-lineup-direction {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 5px 0;
    color: var(--sl-slate);
    font-size: .65rem;
    font-weight: 800;
}

    .set-lineup-direction b {
        color: var(--sl-green-dark);
    }

.set-lineup-roster-search {
    display: grid;
    grid-template-columns: 1fr 150px;
    gap: 8px;
    margin-bottom: 11px;
}

    .set-lineup-roster-search .form-control,
    .set-lineup-roster-search .form-select {
        min-height: 42px;
        border-color: var(--sl-border);
        border-radius: 10px;
        font-size: .75rem;
    }

.set-lineup-selected-player {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
    padding: 10px 12px;
    border: 1px solid rgba(91, 140, 59, .28);
    border-radius: 12px;
    background: rgba(91, 140, 59, .075);
}

.selected-player-indicator {
    width: 11px;
    height: 11px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 5px rgba(148, 163, 184, .15);
}

.set-lineup-selected-player.has-player .selected-player-indicator {
    background: var(--sl-green);
    box-shadow: 0 0 0 5px rgba(91, 140, 59, .16);
    animation: selected-pulse 1.5s infinite;
}

@keyframes selected-pulse {
    0%, 100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.25);
    }
}

.set-lineup-selected-player div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.set-lineup-selected-player strong {
    overflow: hidden;
    font-size: .78rem;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.set-lineup-selected-player small {
    color: var(--sl-slate);
    font-size: .66rem;
}

.set-lineup-player-list {
    display: grid;
    max-height: calc(100vh - 305px);
    min-height: 420px;
    gap: 8px;
    overflow-y: auto;
    padding: 2px 3px 2px 6px;
    scrollbar-color: rgba(91, 140, 59, .55) #e9eef3;
    scrollbar-width: thin;
}

.roster-player-card {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--sl-border);
    border-radius: 13px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

    .roster-player-card:hover,
    .roster-player-card:focus {
        transform: translateX(-3px);
        border-color: rgba(91, 140, 59, .52);
        outline: 0;
        box-shadow: 0 9px 22px rgba(15, 23, 42, .08);
    }

    .roster-player-card.is-selected {
        border-color: var(--sl-green);
        background: rgba(91, 140, 59, .07);
        box-shadow: 0 0 0 3px rgba(91, 140, 59, .11);
    }

    .roster-player-card.is-assigned {
        opacity: .52;
    }

        .roster-player-card.is-assigned:hover {
            opacity: .86;
        }

    .roster-player-card.is-dragging {
        opacity: .3;
        transform: scale(.97);
    }

.roster-player-photo {
    position: relative;
    display: grid;
    width: 51px;
    height: 51px;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--sl-navy), var(--sl-navy-soft));
    color: #fff;
    font-weight: 900;
}

    .roster-player-photo img {
        width: 100%;
        height: 100%;
        border-radius: inherit;
        object-fit: cover;
    }

    .roster-player-photo b {
        position: absolute;
        right: -3px;
        bottom: -2px;
        display: grid;
        min-width: 21px;
        height: 21px;
        place-items: center;
        border: 2px solid #fff;
        border-radius: 50%;
        background: var(--sl-green);
        color: #fff;
        font-size: .55rem;
    }

.roster-player-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.roster-player-name-row {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
}

    .roster-player-name-row strong {
        overflow: hidden;
        font-size: .78rem;
        font-weight: 900;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.roster-captain-badge {
    flex: 0 0 auto;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .15);
    color: #b45309;
    font-size: .52rem;
    font-weight: 900;
}

.roster-player-copy > span {
    overflow: hidden;
    color: var(--sl-slate);
    font-size: .62rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.roster-player-copy p {
    margin: 2px 0 0;
    color: var(--sl-green-dark);
    font-size: .68rem;
    font-weight: 800;
}

    .roster-player-copy p small {
        margin-inline-start: 3px;
        color: var(--sl-slate);
    }

.roster-player-state {
    display: flex;
    min-width: 59px;
    justify-content: flex-end;
    font-size: .58rem;
    font-weight: 900;
}

.roster-available-text {
    color: var(--sl-green-dark);
}

.roster-assigned-text {
    display: none;
    color: var(--sl-slate);
}

.roster-player-card.is-assigned .roster-available-text {
    display: none;
}

.roster-player-card.is-assigned .roster-assigned-text {
    display: inline;
}

.set-lineup-empty-roster {
    display: flex;
    min-height: 360px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 25px;
    color: var(--sl-slate);
    text-align: center;
}

    .set-lineup-empty-roster > div {
        display: grid;
        width: 64px;
        height: 64px;
        margin-bottom: 11px;
        place-items: center;
        border-radius: 50%;
        background: rgba(91, 140, 59, .11);
        font-size: 1.7rem;
    }

    .set-lineup-empty-roster h3 {
        margin: 0;
        color: var(--sl-navy);
        font-size: .95rem;
        font-weight: 900;
    }

    .set-lineup-empty-roster p {
        margin: 6px 0 0;
        font-size: .74rem;
        line-height: 1.7;
    }

.set-lineup-save-bar {
    position: sticky;
    z-index: 20;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 18px;
    padding: 14px 18px;
    border: 1px solid var(--sl-border);
    border-radius: 17px 17px 0 0;
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 -12px 32px rgba(15, 23, 42, .10);
    backdrop-filter: blur(11px);
}

    .set-lineup-save-bar > div {
        display: flex;
        flex-direction: column;
    }

    .set-lineup-save-bar strong {
        font-size: .82rem;
        font-weight: 900;
    }

    .set-lineup-save-bar span {
        margin-top: 2px;
        color: var(--sl-slate);
        font-size: .66rem;
    }

.set-lineup-save-button {
    min-height: 46px;
    padding-inline: 23px;
    border: 1px solid var(--sl-green);
    border-radius: 11px;
    background: var(--sl-green);
    color: #fff;
    font-weight: 900;
    white-space: nowrap;
}

    .set-lineup-save-button:hover {
        border-color: var(--sl-green-dark);
        background: var(--sl-green-dark);
        color: #fff;
    }

    .set-lineup-save-button:disabled {
        border-color: #94a3b8;
        background: #94a3b8;
    }

.flying-player-clone {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    transition: transform .45s cubic-bezier(.22, .86, .35, 1), opacity .45s ease;
}

@media (max-width: 1199.98px) {
    .set-lineup-overview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .set-lineup-workspace {
        grid-template-columns: minmax(450px, 1.25fr) minmax(320px, .75fr);
    }
}

@media (max-width: 991.98px) {
    .set-lineup-workspace {
        grid-template-columns: 1fr;
        grid-template-areas: "pitch" "roster";
    }

    .set-lineup-roster-panel {
        position: static;
    }

    .set-lineup-player-list {
        max-height: 600px;
    }

    .set-lineup-pitch {
        max-width: 620px;
    }
}

@media (max-width: 767.98px) {
    .set-lineup-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 22px 18px;
    }

        .set-lineup-hero .btn {
            width: 100%;
        }

    .set-lineup-overview {
        grid-template-columns: 1fr;
    }

    .set-lineup-pitch-panel,
    .set-lineup-roster-panel {
        padding: 15px;
    }

    .set-lineup-panel-heading {
        flex-direction: column;
    }

    .set-lineup-tools {
        width: 100%;
    }

        .set-lineup-tools .btn {
            flex: 1;
        }

    .set-lineup-roster-search {
        grid-template-columns: 1fr;
    }

    .set-lineup-save-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .set-lineup-save-button {
        width: 100%;
    }

    .formation-slot {
        width: 68px;
    }

    .formation-player-photo {
        width: 47px;
        height: 47px;
    }

    .formation-player-name {
        font-size: .55rem;
    }
}

@media (max-width: 480px) {
    .set-lineup-pitch-shell {
        margin-inline: -7px;
        padding: 6px;
    }

    .set-lineup-pitch {
        border-width: 3px;
        border-radius: 12px;
    }

    .formation-slot {
        width: 58px;
        min-height: 64px;
    }

    .formation-slot-target {
        width: 42px;
        height: 42px;
    }

    .formation-player-photo {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }

    .formation-player-name {
        padding: 2px 3px;
        font-size: .5rem;
    }

    .formation-slot-player small {
        display: none;
    }
}
