/* =============================================================================
   FPLyzer — Shared squad pitch component
   =============================================================================
   The stats strip, the pitch and its player cards, the tooltip, and the AI
   review card. Extracted verbatim from wildcard_wrapper.html's inline <style>
   so the same component can render on three surfaces:

     /wildcard        AI Builder
     /squad-builder   Manual Builder
     /                public landing page (anonymous builder)

   Pairs with static/js/wc-pitch.js — that file builds the markup these rules
   style, and templates/partials/_squad_pitch.html is the container.

   CASCADE: this sheet must be linked *after* manual-builder.css. It used to be
   an inline <style> that sat below every <link>, so it has always won those
   conflicts; loading it earlier silently changes the pitch on both builders.

   Page chrome (.wc-page-header, .wc-crosslink, .wc-mode-*, .wc-handoff) stays
   inline in wildcard_wrapper.html — the landing page has its own.

   BREAKPOINTS — PITCH CARDS: 768 / 540 / 400. Deliberately not the house
   LAYOUT contract (1024/768/480/360, see manual-builder.css:13-27): empty
   slots must track .squad-player-card widths exactly or the rows go ragged.
   ============================================================================= */

/* ── Stats cards ── */
.wc-stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.wc-stat-card {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    overflow: hidden;
}
.wc-stat-card::before {
    content: '';
    position: absolute; top: 0; left: 0;
    width: 3px; height: 100%;
    border-radius: 3px 0 0 3px;
}
.wc-stat-card.stat-cost::before    { background: linear-gradient(180deg,#FFD700,#FFA500); }
.wc-stat-card.stat-budget::before  { background: linear-gradient(180deg,#00FF87,#00CC6A); }
.wc-stat-card.stat-pts::before     { background: linear-gradient(180deg,#E90052,#C0003E); }
.wc-stat-card.stat-formation::before { background: linear-gradient(180deg,#B47FFF,#8A2BE2); }
.wc-stat-card.stat-bank::before    { background: linear-gradient(180deg,#00BFFF,#0080FF); }
.wc-stat-icon  { font-size: 1.1rem; line-height: 1; }
.wc-stat-label {
    font-size: 0.65rem; font-weight: 600;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase; letter-spacing: 0.6px;
}
.wc-stat-value {
    font-size: 1.1rem; font-weight: 800;
    line-height: 1.1; color: #fff;
}
.wc-stat-card.stat-cost     .wc-stat-value { color: #FFD700; }
.wc-stat-card.stat-budget   .wc-stat-value { color: #00FF87; }
.wc-stat-card.stat-pts      .wc-stat-value { color: #FF6B9D; }
.wc-stat-card.stat-formation .wc-stat-value { color: #B47FFF; }
.wc-stat-card.stat-bank     .wc-stat-value { color: #00BFFF; }

@media (max-width: 768px) {
    .wc-stats-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .wc-stat-value { font-size: 0.9rem; }
    .wc-stat-label { font-size: 0.58rem; }
    .wc-stat-card { padding: 10px 10px; }
}
@media (max-width: 480px) {
    .wc-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Preseason drops the bank / selling-value card — 4 cards, not 5 (P.4.3) */
.wc-stats-grid.wc-stats-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 768px) {
    .wc-stats-grid.wc-stats-4 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================================
   🤖 AI Squad Review card
   Same visual language as the dashboard's AI review card, so every review
   surface in the app reads as one feature.
   ============================================================================ */
/* Mount point for the AI Review button + its disabled-reason line, centred
   under the pitch. manual-builder.js's renderExtraBar() renders both children
   in here when the element exists (#mbReviewCta on /squad-builder and on the
   public landing page) instead of inline in the summary bar — one code path
   for enabled/disabled/why, two placements. */
.wc-ai-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    margin: 28px 0 4px;
}
.wc-ai-trigger .mb-review-reason { flex-basis: auto; }
.wc-ai-review-btn {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    color: #1a1a1a; border: none; border-radius: 50px;
    padding: 11px 24px;
    font-family: 'Montserrat', sans-serif;
    font-size: clamp(0.78rem, 3.2vw, 1rem); font-weight: 800;
    letter-spacing: 0.3px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(255,165,0,0.35);
    transition: all 0.2s; max-width: 100%;
}
.wc-ai-review-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #FFE033, #FFB700);
    box-shadow: 0 6px 22px rgba(255,165,0,0.50);
    transform: translateY(-1px);
}
.wc-ai-review-btn:active:not(:disabled) { transform: scale(0.97); }
.wc-ai-review-btn:disabled {
    opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none;
}
.wc-ai-usage { opacity: 0.7; font-size: 0.82em; }
.wc-ai-hint {
    margin: 8px 0 0; font-size: 0.75rem;
    color: rgba(255,255,255,0.45);
}
.wc-ai-card {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(180,127,255,0.25);
    border-radius: 16px;
    padding: 20px; box-sizing: border-box;
    margin: 18px 0 6px;
}
.wc-ai-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.wc-ai-title {
    display: flex; align-items: center; gap: 10px;
    font-size: 1rem; font-weight: 700; color: #B47FFF;
}
.wc-ai-mode-badge {
    background: rgba(180,127,255,0.2); color: #B47FFF;
    padding: 2px 8px; border-radius: 10px;
    font-size: 0.72rem; font-weight: 600;
}
.wc-ai-refresh-btn {
    background: transparent;
    border: 1px solid rgba(180,127,255,0.35);
    color: #B47FFF; border-radius: 6px;
    padding: 4px 12px; font-size: 0.8rem; cursor: pointer;
    font-family: 'Montserrat', sans-serif; transition: all 0.2s;
}
.wc-ai-refresh-btn:hover:not(:disabled) { background: rgba(180,127,255,0.15); }
.wc-ai-refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.wc-ai-loading { display: flex; align-items: center; gap: 16px; padding: 16px 0; }
@keyframes wcAiSpin { to { transform: rotate(360deg); } }
.wc-ai-spinner {
    width: 32px; height: 32px; flex-shrink: 0;
    border: 3px solid rgba(180,127,255,0.2);
    border-top-color: #B47FFF; border-radius: 50%;
    animation: wcAiSpin 0.8s linear infinite;
}
.wc-ai-loading-text {
    display: flex; flex-direction: column; gap: 4px;
    color: #ccc; font-size: 0.88rem;
}
.wc-ai-loading-text strong { color: #B47FFF; }
.wc-ai-content { color: rgba(255,255,255,0.9); }
.wc-ai-content h3 {
    font-size: 0.98rem; font-weight: 700; color: #B47FFF;
    margin: 18px 0 6px; padding-bottom: 5px;
    border-bottom: 1px solid rgba(180,127,255,0.15);
}
.wc-ai-content h3:first-child { margin-top: 0; }
.wc-ai-content p {
    font-size: 0.88rem; line-height: 1.65;
    color: rgba(255,255,255,0.85); margin: 0 0 8px;
}
.wc-ai-content ul { margin: 4px 0 10px 20px; padding: 0; }
.wc-ai-content li {
    font-size: 0.88rem; line-height: 1.6;
    color: rgba(255,255,255,0.85); margin-bottom: 4px;
}
.wc-ai-content strong { color: #fff; font-weight: 700; }
.wc-ai-content em { color: #B47FFF; font-style: normal; font-weight: 600; }
.wc-ai-content hr {
    border: none; border-top: 1px solid rgba(255,255,255,0.08); margin: 12px 0;
}
.wc-ai-content code {
    background: rgba(255,255,255,0.08);
    padding: 1px 5px; border-radius: 3px; font-size: 0.82rem;
}
.wc-ai-content a { color: #00FF87; }
/* "Email me this squad" — the one warm colour in a purple card, because it is
   the only action here that leaves the page. */
.wc-ai-email { text-align: center; margin: 22px 0 4px; }
.wc-ai-email-btn {
    display: inline-block; font-family: 'Montserrat', sans-serif;
    background: linear-gradient(135deg, #FFD84D 0%, #FFB800 100%);
    color: #2D0030; font-weight: 800; font-size: 0.95rem;
    padding: 13px 30px; border: none; border-radius: 10px; cursor: pointer;
    box-shadow: 0 4px 14px rgba(255,184,0,0.35);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.wc-ai-email-btn:hover:not(:disabled) {
    transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,184,0,0.45);
}
.wc-ai-email-btn:focus-visible { outline: 2px solid #FFD84D; outline-offset: 3px; }
.wc-ai-email-btn:disabled {
    opacity: 0.45; cursor: not-allowed; box-shadow: none; transform: none;
}
.wc-ai-email-status {
    margin: 10px 0 0; font-size: 0.8rem; min-height: 1.1em;
    color: rgba(255,255,255,0.55);
}
.wc-ai-email-status.is-ok  { color: #00FF87; }
.wc-ai-email-status.is-err { color: #E90052; }

.wc-ai-disclaimer {
    margin-top: 14px; padding-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.07);
    font-size: 0.72rem; color: rgba(255,255,255,0.35); line-height: 1.5;
}
.wc-ai-error {
    text-align: center; padding: 20px;
    color: rgba(255,255,255,0.55); font-size: 0.88rem;
}
.wc-ai-retry-btn {
    background: rgba(180,127,255,0.12);
    border: 1px solid rgba(180,127,255,0.3);
    color: #B47FFF; border-radius: 6px;
    padding: 6px 16px; font-size: 0.82rem; cursor: pointer;
    font-family: 'Montserrat', sans-serif; margin-top: 10px;
    transition: all 0.2s;
}
.wc-ai-retry-btn:hover { background: rgba(180,127,255,0.22); }
.wc-ai-stale {
    margin: 0 0 12px; padding: 8px 12px;
    background: rgba(255,215,0,0.08);
    border-left: 3px solid #FFD700; border-radius: 5px;
    font-size: 0.78rem; color: #FFD700;
}
[dir="rtl"] .wc-ai-stale { border-left: none; border-right: 3px solid #FFD700; }

/* ============================================================================
   Pitch widget — identical CSS to dashboard (squad-* namespace)
   ============================================================================ */

.squad-pitch-widget {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    padding: 20px;
    box-sizing: border-box;
}
.squad-pitch-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 16px; flex-wrap: wrap; gap: 8px;
}
.squad-pitch-title {
    font-size: 1.2rem; font-weight: 800;
    color: #00FF87; margin: 0; letter-spacing: 0.5px;
}
.squad-pitch-gw {
    display: inline-flex; align-items: center;
    background: rgba(0,255,135,0.12);
    border: 1px solid rgba(0,255,135,0.35);
    color: #00FF87; font-size: 0.9rem; font-weight: 800;
    letter-spacing: 1px; padding: 3px 10px;
    border-radius: 20px; text-transform: uppercase;
}

/* Skeleton */
.squad-skeleton-pitch {
    width: 100%; max-width: 700px; margin: 0 auto;
    aspect-ratio: 2/3;
    background: rgba(255,255,255,0.04);
    border-radius: 10px; border: 2px solid rgba(255,255,255,0.08);
    display: flex; flex-direction: column;
    justify-content: space-around; padding: 16px 8px; box-sizing: border-box;
}
.squad-skeleton-row { display: flex; justify-content: center; gap: 12px; }
.squad-skeleton-card {
    width: 70px; height: 90px; border-radius: 8px;
    background: linear-gradient(90deg,rgba(255,255,255,0.06) 25%,rgba(255,255,255,0.12) 50%,rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: squadShimmer 1.5s infinite;
}
.squad-skeleton-bench {
    display: flex; justify-content: center; gap: 12px; margin-top: 14px;
}
@keyframes squadShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Pitch */
.squad-pitch {
    width: 100%; max-width: 760px; margin: 0 auto;
    background-image: url('/static/images/football-pitch.png');
    background-size: cover; background-position: center;
    border: 3px solid rgba(255,255,255,0.6);
    border-radius: 10px;
    display: flex; flex-direction: column;
    justify-content: space-evenly; align-items: center;
    padding: 12px 4px; box-sizing: border-box; gap: 6px;
    aspect-ratio: 2 / 3;
}
.squad-position {
    width: 100%; display: flex;
    justify-content: center; align-items: stretch; gap: 10px;
}
/* position-specific rows — kept for JS selector compat; inherit .squad-position */
.squad-position-gk  { display: flex; }
.squad-position-def { display: flex; }
.squad-position-mid { display: flex; }
.squad-position-fwd { display: flex; }

/* Player card */
.squad-player-card {
    width: 110px; text-align: center;
    position: relative; cursor: pointer;
    display: flex; flex-direction: column; align-items: center;
    --tooltip-offset: -8px;
}
.squad-player-jersey {
    width: 92px; height: 92px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
}
.squad-player-name {
    margin-top: 4px; font-size: 0.82rem; font-weight: 700;
    color: #fff; background: rgba(10,6,20,0.82);
    border-radius: 5px; padding: 2px 6px;
    text-align: center; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
    max-width: 112px; width: 100%; box-sizing: border-box;
    box-shadow: 0 1px 5px rgba(0,0,0,0.55);
    letter-spacing: 0.01em;
}

/* GW box */
.squad-gw-box {
    margin-top: 3px;
    background: rgba(8,4,18,0.85);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 5px; padding: 4px 5px;
    display: grid; grid-template-columns: auto 1fr auto auto;
    column-gap: 4px; row-gap: 1px; align-items: center;
    width: 100%; max-width: 112px;
    box-sizing: border-box;
    box-shadow: 0 2px 6px rgba(0,0,0,0.5);
    font-size: 0.70rem; line-height: 1.3;
}
/* Row wrapper invisible — its 4 children become direct grid items */
.squad-gw-row { display: contents; }
/* GW separator spans all 4 columns — appears BETWEEN GW groups */
.squad-gw-sep { grid-column: 1 / -1; height: 1px; background: rgba(255,255,255,0.15); margin: 1px 0; }
.squad-gw-opp.dgw-second { opacity: 0.85; }
.squad-gw-num  { color: rgba(255,255,255,0.42); font-weight: 700; font-size: inherit; white-space: nowrap; text-align: left; }
.squad-gw-opp  { font-weight: 700; font-size: inherit; white-space: nowrap; text-align: left; color: rgba(255,255,255,0.8); }
.squad-gw-opp.diff-easy   { color: #00FF87; }
.squad-gw-opp.diff-medium { color: #FFD700; }
.squad-gw-opp.diff-hard   { color: #ff6b6b; }
.squad-gw-opp.blank       { color: rgba(255,120,120,0.55); font-style: italic; }
.squad-gw-venue { font-weight: 800; font-size: inherit; white-space: nowrap; text-align: center; }
.squad-gw-venue.home { color: #00FF87; }
.squad-gw-venue.away { color: #E90052; }
.squad-gw-pts-mini { color: #00FF87; font-weight: 800; font-size: inherit; white-space: nowrap; text-align: right; }
.squad-gw-pts-mini.blank { color: rgba(255,120,120,0.65); }
.squad-pts-mobile-only { display: none; }
.squad-player-pts {
    font-size: 0.65rem; font-weight: 800; color: #fff;
    background: rgba(10,6,20,0.82); border-radius: 4px;
    padding: 1px 5px; margin-top: 3px; text-align: center;
}

/* Captain / VC badges */
.squad-captain-badge, .squad-vc-badge {
    position: absolute; top: 3px; left: 3px;
    background: #E90052; color: #fff;
    border-radius: 50%; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; font-weight: 800;
    border: 2px solid #fff; z-index: 2;
}
.squad-vc-badge { background: #38003C; }

/* Injury / availability */
.squad-injury-indicator {
    position: absolute; top: 3px; right: 3px;
    background: #E90052; color: #fff;
    border-radius: 50%; width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; font-weight: 800;
    border: 2px solid #fff; z-index: 2;
}
.squad-avail-indicator {
    position: absolute; top: 3px; right: 3px;
    background: #FFD700; color: #000;
    border-radius: 50%; width: 24px; height: 24px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.5rem; font-weight: 800;
    border: 2px solid #fff; z-index: 2;
}

/* Bench */
.squad-bench-label {
    text-align: center; font-size: 0.75rem; font-weight: 700;
    color: rgba(255,255,255,0.45); text-transform: uppercase;
    letter-spacing: 1px; margin: 14px 0 8px;
}
.squad-bench {
    display: flex; justify-content: center;
    gap: 12px; flex-wrap: wrap;
}
.squad-bench .squad-player-card  { width: 95px; opacity: 0.88; }
.squad-bench .squad-player-jersey { width: 78px; height: 78px; }
.squad-bench .squad-player-name  { font-size: 0.72rem; max-width: 95px; }
.squad-bench .squad-player-pts   { font-size: 0.65rem; }
.squad-bench .squad-gw-box       { max-width: 95px; }
.squad-bench .squad-pos-badge    { bottom: auto; top: 68px; }
.squad-bench .squad-player-card.bench-gk { margin-right: 24px; position: relative; }
.squad-bench .squad-player-card.bench-gk::after {
    content: ''; position: absolute; right: -14px; top: 10%;
    height: 80%; width: 1px; background: rgba(255,255,255,0.15);
}
.squad-pos-badge {
    position: absolute; bottom: 28px; right: -6px;
    background: rgba(56,0,60,0.85); color: rgba(255,255,255,0.85);
    border-radius: 3px; padding: 1px 4px;
    font-size: 0.55rem; font-weight: 800;
    border: 1px solid rgba(255,255,255,0.2);
}

/* Error */
.squad-pitch-error {
    text-align: center; padding: 40px 20px;
    color: rgba(255,255,255,0.5);
}
.squad-pitch-error span { font-size: 2rem; display: block; margin-bottom: 10px; }
.squad-pitch-error p    { margin-bottom: 14px; font-size: 0.9rem; }
.squad-pitch-error button {
    background: linear-gradient(135deg,#E90052,#c4003f);
    color: #fff; border: none; border-radius: 8px;
    padding: 8px 20px; font-size: 0.85rem; font-weight: 700; cursor: pointer;
}

/* ============================================================================
   PLAYER TOOLTIP  —  Visual Redesign (matches dashboard)
   ============================================================================ */
.squad-tooltip {
    position: fixed;
    width: 300px;
    max-width: calc(100vw - 16px);
    background: #0e0e1c;
    border: none;
    border-radius: 14px;
    padding: 0;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0,0,0,0.75), 0 2px 0 rgba(255,255,255,0.04) inset;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    box-sizing: border-box;
}
.squad-tooltip.tip-above::after {
    content: '';
    position: absolute;
    bottom: -9px; left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #0e0e1c;
}
.squad-tooltip.tip-below::after {
    content: '';
    position: absolute;
    top: -9px; left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-bottom-color: #0e0e1c;
}
.squad-tooltip.squad-tooltip-visible { opacity: 1; visibility: visible; }
/* Header */
.squad-tt-header {
    padding: 12px 14px 11px;
    background: linear-gradient(135deg, rgba(233,0,82,0.25) 0%, rgba(0,255,135,0.12) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; gap: 10px;
}
.squad-tt-header-text { flex: 1; min-width: 0; }
.squad-tt-price-pill {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 20px; padding: 3px 9px;
    font-size: 0.78rem; font-weight: 700; color: #fff;
    white-space: nowrap; flex-shrink: 0;
}
.squad-tt-name { font-weight: 800; font-size: 0.98rem; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.squad-tt-team { font-size: 0.73rem; color: rgba(255,255,255,0.55); margin-top: 2px; }
.squad-tt-pos-badge {
    display: inline-block; padding: 1px 6px; border-radius: 4px;
    font-size: 0.62rem; font-weight: 800; margin-left: 5px;
    vertical-align: middle; text-transform: uppercase; letter-spacing: 0.4px;
}
.squad-tt-pos-badge.gk  { background: rgba(255,215,0,0.2);  color: #FFD700; }
.squad-tt-pos-badge.def { background: rgba(0,191,255,0.18); color: #00BFFF; }
.squad-tt-pos-badge.mid { background: rgba(0,255,135,0.15); color: #00FF87; }
.squad-tt-pos-badge.fwd { background: rgba(233,0,82,0.18);  color: #ff6b9d; }
/* Key-stats strip */
.squad-tt-key-stats { display: grid; grid-template-columns: repeat(3,1fr); border-bottom: 1px solid rgba(255,255,255,0.06); }
.squad-tt-kstat { padding: 9px 10px; text-align: center; border-right: 1px solid rgba(255,255,255,0.06); }
.squad-tt-kstat:last-child { border-right: none; }
.squad-tt-kstat-val { font-size: 0.88rem; font-weight: 800; color: #fff; line-height: 1.1; }
.squad-tt-kstat-val.pink  { color: #E90052; }
.squad-tt-kstat-val.gold  { color: #FFD700; }
.squad-tt-kstat-val.green { color: #00FF87; }
.squad-tt-kstat-lbl { font-size: 0.62rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
/* Body */
.squad-tt-body { padding: 10px 12px; }
.squad-tt-news { margin: 0 0 9px; padding: 7px 10px; background: rgba(255,215,0,0.08); border-left: 3px solid #FFD700; border-radius: 5px; font-size: 0.73rem; color: #FFD700; font-style: italic; line-height: 1.4; }
.squad-tt-divider { display: flex; align-items: center; gap: 7px; font-size: 0.62rem; font-weight: 700; color: rgba(255,255,255,0.35); text-transform: uppercase; letter-spacing: 0.8px; margin: 10px 0 6px; }
.squad-tt-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,0.07); }
/* GW rows */
.squad-tt-gw-rows { display: flex; flex-direction: column; gap: 3px; margin-bottom: 4px; }
.squad-tt-gw-row { display: grid; grid-template-columns: 44px 1fr 55px; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 7px; background: rgba(255,255,255,0.04); font-size: 0.76rem; }
.squad-tt-gw-row:hover { background: rgba(255,255,255,0.07); }
.squad-tt-gw-lhs { font-size: 0.7rem; font-weight: 700; color: rgba(255,255,255,0.5); white-space: nowrap; display: flex; flex-direction: column; gap: 2px; }
.squad-tt-gw-fixtures { display: flex; flex-direction: column; gap: 3px; }
.squad-tt-fixture-line { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 5px; }
.squad-tt-opp { font-size: 0.73rem; font-weight: 700; color: rgba(255,255,255,0.75); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.squad-tt-opp.diff-easy   { color: #00FF87; font-weight: 700; }
.squad-tt-opp.diff-medium { color: #FFD700; font-weight: 700; }
.squad-tt-opp.diff-hard   { color: #E90052; font-weight: 700; }
.squad-tt-venue { font-size: 0.68rem; font-weight: 800; text-align: center; min-width: 22px; }
.squad-tt-venue.home { color: #00FF87; }
.squad-tt-venue.away { color: #E90052; }
.squad-tt-gw-col-hdrs { display: grid; grid-template-columns: 44px 1fr 55px; gap: 6px; padding: 0 8px 3px; font-size: 0.58rem; font-weight: 700; color: rgba(255,255,255,0.22); text-transform: uppercase; letter-spacing: 0.4px; }
.squad-tt-gw-fixtures-hdr { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 5px; }
.squad-tt-gw-fixtures-hdr span:not(:first-child) { min-width: 22px; text-align: center; }
.squad-tt-gw-col-hdrs .squad-tt-gw-pts-hdr { text-align: right; }
.squad-tt-gw-pts-cell { white-space: nowrap; font-size: 0.78rem; font-weight: 800; color: #00FF87; text-align: right; align-self: center; width: 55px; box-sizing: border-box; }
.squad-tt-gw-pts-cell.blank { color: rgba(255,107,107,0.7); }
.squad-tt-gw-pts-cell.avg   { color: #E90052; }
.squad-tt-diff { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 4px; font-size: 0.65rem; font-weight: 800; flex-shrink: 0; }
.squad-tt-diff.diff-1, .squad-tt-diff.diff-2 { background: rgba(0,255,135,0.15); color: #00FF87; }
.squad-tt-diff.diff-3 { background: rgba(255,215,0,0.15); color: #FFD700; }
.squad-tt-diff.diff-4, .squad-tt-diff.diff-5 { background: rgba(233,0,82,0.18); color: #E90052; }
.squad-tt-badge { display: inline-block; padding: 1px 5px; border-radius: 4px; font-size: 0.58rem; font-weight: 800; letter-spacing: 0.3px; }
.squad-tt-badge.bgw { background: rgba(255,107,107,0.2); color: #ff6b6b; border: 1px solid rgba(255,107,107,0.3); }
.squad-tt-badge.dgw { background: rgba(0,255,135,0.15);  color: #00FF87; border: 1px solid rgba(0,255,135,0.3); }
/* Season stat chips */
.squad-tt-stats-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 5px; margin-top: 6px; }
.squad-tt-stat-cell { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.07); border-radius: 7px; padding: 6px 6px 5px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.squad-tt-stat-cell span:first-child { font-size: 0.58rem; color: rgba(255,255,255,0.4); text-transform: uppercase; letter-spacing: 0.4px; white-space: nowrap; }
.squad-tt-stat-cell span:last-child { font-size: 0.9rem; font-weight: 800; color: #fff; line-height: 1; }
.squad-tt-stat-cell:first-child { border-color: rgba(0,255,135,0.2); background: rgba(0,255,135,0.06); }
.squad-tt-stat-cell:first-child span:last-child { color: #00FF87; }
/* Legacy (hidden) */
.squad-tt-stat { display: none; }
.squad-tt-gw-pts { font-weight: 700; color: #00FF87; }
.squad-tt-gw-pts.blank { color: #ff6b6b; }
.squad-tt-gw-pts.avg   { color: #E90052; }

/* Responsive */
@media (max-width: 768px) {
    .squad-player-card  { width: 88px; }
    .squad-player-jersey { width: 74px; height: 74px; }
    .squad-player-name  { font-size: 0.70rem; max-width: 88px; }
    .squad-gw-box       { max-width: 88px; font-size: 0.62rem; column-gap: 3px; }
    .squad-bench .squad-player-card  { width: 80px; }
    .squad-bench .squad-player-jersey { width: 64px; height: 64px; }
    .squad-bench .squad-player-name  { font-size: 0.64rem; max-width: 80px; }
    .squad-bench .squad-gw-box       { max-width: 80px; font-size: 0.57rem; }
    .squad-bench .squad-pos-badge    { top: 52px; }
    .squad-pitch { max-width: 98vw; padding: 10px 4px; gap: 4px; }
    .squad-position { gap: 8px; }
}
@media (max-width: 540px) {
    .squad-pitch-widget { padding: 12px 8px; }
    .squad-pitch { padding: 8px 3px; gap: 3px; }
    .squad-position { gap: 6px; }
    .squad-player-card  { width: 72px; }
    .squad-player-jersey { width: 58px; height: 58px; }
    .squad-player-name  { font-size: 0.60rem; max-width: 72px; }
    .squad-gw-box       { max-width: 72px; font-size: 0.52rem; column-gap: 2px; padding: 3px 3px; }
    .squad-captain-badge, .squad-vc-badge { width: 19px; height: 19px; font-size: 0.58rem; }
    .squad-bench { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; justify-content: flex-start; gap: 5px; padding-bottom: 4px; }
    .squad-bench .squad-player-card  { flex: 0 0 68px; width: 68px; min-width: 68px; }
    .squad-bench .squad-player-jersey { width: 54px; height: 54px; }
    .squad-bench .squad-player-name  { font-size: 0.57rem; max-width: 68px; }
    .squad-bench .squad-gw-box       { max-width: 68px; font-size: 0.49rem; }
    .squad-bench .squad-pos-badge    { top: 42px; font-size: 0.44rem; padding: 1px 3px; }
    .squad-injury-indicator          { width: 15px; height: 15px; font-size: 0.48rem; }
    .squad-avail-indicator           { width: 18px; height: 18px; font-size: 0.42rem; }
    .squad-skeleton-card { width: 54px; height: 70px; }
}
@media (max-width: 400px) {
    .squad-pitch { padding: 6px 2px; gap: 2px; }
    .squad-position { gap: 4px; }
    .squad-player-card   { width: 62px; }
    .squad-player-jersey { width: 50px; height: 50px; }
    .squad-player-name   { font-size: 0.54rem; max-width: 62px; }
    .squad-gw-box        { max-width: 62px; font-size: 0.46rem; column-gap: 2px; padding: 2px 2px; }
    .squad-bench .squad-player-card  { flex: 0 0 60px; width: 60px; min-width: 60px; }
    .squad-bench .squad-player-jersey { width: 48px; height: 48px; }
    .squad-bench .squad-player-name  { font-size: 0.52rem; max-width: 60px; }
    .squad-bench .squad-gw-box       { max-width: 60px; font-size: 0.44rem; }
    .squad-bench .squad-pos-badge    { top: 36px; font-size: 0.43rem; padding: 1px 3px; }
}
