/* Flop11 — style.css */

:root {
    --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --bg: #ffffff;
    --bg-subtle: #fafafa;
    --surface: #ffffff;
    --text: #111;
    --text-secondary: #737373;
    --accent: #4a8c3f;
    --accent-light: #5da04d;
    --accent-bg: #f2f9f1;
    --border: rgba(0,0,0,0.08);
    --border-strong: rgba(0,0,0,0.12);
    --success: #3cb46e;
    --error: #e25c3d;
    --warning: #ffc107;
    --gkp: #f0c040;
    --def: #4caf50;
    --mid: #2196f3;
    --fwd: #e53935;
    --radius: 6px;
    --sp: 8px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---- HEADER ---- */
#app-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 60px;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 calc(var(--sp)*3);
    height: 100%;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.header-left .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.logo-img {
    height: 28px;
    width: auto;
}
.header-mascot {
    height: 36px;
    width: 36px;
    object-fit: contain;
}

.header-nav { display: flex; gap: 4px; }
.header-nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: var(--radius);
    transition: all 0.15s;
}
.header-nav a:hover { color: var(--text); background: var(--bg-subtle); }
.header-nav a.active { color: var(--text); }

.header-right { display: flex; align-items: center; gap: calc(var(--sp)*1.5); }
.manager-name { font-size: 0.85rem; color: var(--text-secondary); }
.team-name-link {
    font-size: 0.85rem;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed var(--text-secondary);
    padding-bottom: 1px;
}
.team-name-link:hover { border-color: var(--text); }

/* ---- BUTTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 20px;
    font-size: 0.88rem;
    font-weight: 500;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.1s;
    text-decoration: none;
    font-family: var(--font);
    background: var(--surface);
    color: var(--text);
    gap: calc(var(--sp)*0.75);
}
.btn:hover:not(:disabled) { border-color: var(--text); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary { background: var(--text); color: var(--surface); border-color: var(--text); }
.btn-primary:hover:not(:disabled) { background: #262626; }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover:not(:disabled) { border-color: var(--text); }
.btn-small { padding: 5px 12px; font-size: 0.8rem; }
.btn-danger { background: var(--error); color: #fff; border-color: var(--error); }
.btn-danger-outline { background: transparent; color: var(--error); border-color: var(--error); }
.btn-danger-outline:hover:not(:disabled) { background: var(--error); color: #fff; }
.btn-danger-outline:disabled { opacity: 0.35; cursor: not-allowed; }

/* ---- CONTAINER ---- */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 24px;
}

/* ---- CARD ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: calc(var(--sp)*3);
}

/* ---- LOGIN PAGE ---- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
}
.login-card {
    text-align: center;
    max-width: 400px;
    width: 100%;
    padding: calc(var(--sp)*5) calc(var(--sp)*4);
}
.login-card h1 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: var(--sp);
}
.login-card .tagline {
    color: var(--text-secondary);
    margin-bottom: calc(var(--sp)*4);
    font-size: 1rem;
}
.google-btn {
    display: inline-flex;
    align-items: center;
    gap: calc(var(--sp)*1.5);
    padding: calc(var(--sp)*1.5) calc(var(--sp)*3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font);
    color: var(--text);
}
.google-btn:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.google-btn svg { width: 20px; height: 20px; }

/* ---- GW SELECTOR ---- */
.gw-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--sp)*2);
    margin-bottom: calc(var(--sp)*3);
}
.gw-selector .gw-label {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
}
.gw-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.15s;
    color: var(--text-secondary);
    font-family: var(--font);
}
.gw-arrow:hover:not(:disabled) { border-color: var(--text); color: var(--text); }
.gw-arrow:disabled { opacity: 0.25; cursor: not-allowed; }

/* ---- PITCH ---- */
.pitch {
    background: linear-gradient(180deg, #4a8c3f 0%, #3d7a33 50%, #4a8c3f 100%);
    border-radius: 12px;
    padding: 28px 16px 44px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}
.pitch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 1px;
    background: rgba(255,255,255,0.2);
}
.pitch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28%;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    pointer-events: none;
}
.pitch-label {
    position: absolute;
    top: calc(var(--sp)*1.5);
    right: calc(var(--sp)*2);
    color: rgba(255,255,255,0.7);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
    z-index: 1;
    pointer-events: none;
}
.pitch-label-logo {
    position: absolute;
    top: calc(var(--sp)*1.5);
    right: calc(var(--sp)*2);
    height: 24px;
    width: auto;
    pointer-events: none;
    z-index: 2;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}
.pitch-watermark {
    position: absolute;
    bottom: calc(var(--sp)*1);
    left: 50%;
    transform: translateX(-50%);
    height: 22px;
    width: auto;
    opacity: 0.25;
    pointer-events: none;
    z-index: 1;
}
.pitch-row {
    display: flex;
    justify-content: center;
    gap: calc(var(--sp)*2);
    margin-bottom: calc(var(--sp)*2.5);
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}
.pitch-row:last-of-type { margin-bottom: 0; }

.player-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    cursor: default;
    position: relative;
}

.player-photo-wrap {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    position: relative;
    border: 2px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
}
.player-photo-wrap.gkp { background: var(--gkp); }
.player-photo-wrap.def { background: var(--def); }
.player-photo-wrap.mid { background: var(--mid); }
.player-photo-wrap.fwd { background: var(--fwd); }
.player-photo-wrap.no-photo.gkp { color: #333; }
.player-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Legacy .player-shirt kept for empty slots */
.player-shirt {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    position: relative;
    border: 2px solid rgba(255,255,255,0.3);
}
.player-shirt.gkp { background: var(--gkp); color: #333; }
.player-shirt.def { background: var(--def); }
.player-shirt.mid { background: var(--mid); }
.player-shirt.fwd { background: var(--fwd); }

.captain-badge, .vice-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid #fff;
}
.captain-badge { background: #333; color: #fff; }
.vice-badge { background: #fff; color: #333; }
.card-booster-badge {
    position: absolute;
    top: -4px;
    left: -4px;
    background: #f59e0b;
    color: #000;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 3px;
    border-radius: 3px;
    letter-spacing: 0.02em;
    pointer-events: none;
}
.early-bath-badge {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    background: #0ea5e9;
    color: #fff;
    font-size: 8px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 3px;
    border-radius: 3px;
    letter-spacing: 0.02em;
    pointer-events: none;
    white-space: nowrap;
}

.player-name {
    font-size: 0.7rem;
    color: #fff;
    text-align: center;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    max-width: 100px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-opp {
    font-size: 0.6rem;
    color: rgba(255,255,255,0.7);
    text-align: center;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.player-score {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.9);
    background: rgba(0,0,0,0.3);
    padding: 1px 6px;
    border-radius: 4px;
    margin-top: 2px;
    font-weight: 600;
}

/* Clickable slots in edit mode */
.pitch.edit-mode .player-slot { cursor: pointer; }
.pitch.edit-mode .player-slot:hover .player-photo-wrap,
.pitch.edit-mode .player-slot:hover .player-shirt { transform: scale(1.1); }

/* Live match — green ring around photo (white border + green outer ring for contrast on pitch) */
.player-photo-wrap.match-live {
    border: 2px solid #fff;
    box-shadow: 0 0 0 4px #22c55e, 0 0 14px rgba(34, 197, 94, 0.4);
    animation: live-ring-pulse 2s ease-in-out infinite;
}
@keyframes live-ring-pulse {
    0%, 100% { box-shadow: 0 0 0 4px #22c55e, 0 0 12px rgba(34, 197, 94, 0.35); }
    50%       { box-shadow: 0 0 0 6px #4ade80, 0 0 20px rgba(74, 222, 128, 0.55); }
}

/* Not started — dim the avatar, keep name/opp unchanged */
.player-photo-wrap.match-pending {
    opacity: 0.45;
}

/* Score badge for player whose match hasn't started yet */
.player-score.score-pending {
    color: rgba(255, 255, 255, 0.4);
    background: rgba(0, 0, 0, 0.15);
}

.empty-slot .player-shirt {
    background: rgba(255,255,255,0.15);
    border: 2px dashed rgba(255,255,255,0.4);
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
}

/* ---- BENCH ON PITCH ---- */
.player-photo-wrap.benched {
    filter: grayscale(1);
    opacity: 0.3;
}

.score-date {
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---- SUB WINDOW BANNER ---- */
.sub-window-banner {
    background: linear-gradient(135deg, #1a3a2a, #2d4a3a);
    border: 1px solid #4caf50;
    border-radius: var(--radius);
    padding: 10px 16px;
    margin-bottom: calc(var(--sp)*2);
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b8e6c8;
    font-size: 0.85rem;
}
.sub-window-banner strong { color: #4caf50; }
.sub-window-icon { font-size: 1.1rem; }
.score-bench { opacity: 0.4; }

/* sub action button in action menu */
.action-menu-btn.sub-action {
    background: #1a3a2a;
    color: #4caf50;
    border: 1px solid #4caf50;
}
.action-menu-btn.sub-action:hover { background: #2d4a3a; }

/* ---- SCORE SUMMARY ---- */
.score-summary {
    display: flex;
    justify-content: center;
    gap: calc(var(--sp)*4);
    margin-bottom: calc(var(--sp)*3);
    flex-wrap: wrap;
}
.score-box {
    text-align: center;
}
.score-box .label { font-size: 0.8rem; color: var(--text-secondary); text-transform: uppercase; }
.score-box .value { font-size: 1.8rem; font-weight: 700; color: var(--accent); }

/* ---- BOOSTER REMINDERS ---- */
#booster-reminders {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: calc(var(--sp)*2);
}
.booster-reminder-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    font-size: 0.82rem;
}
.booster-reminder-item.warn { border-color: rgba(245, 158, 11, 0.4); }
.booster-reminder-item.ok  { border-color: rgba(34, 197, 94, 0.3); }
.reminder-badge {
    flex-shrink: 0;
    font-size: 8px;
    font-weight: 700;
    padding: 3px 5px;
    border-radius: 3px;
    letter-spacing: 0.03em;
}
.reminder-badge-c  { background: #333; color: #fff; }
.reminder-badge-cb { background: #f59e0b; color: #000; }
.reminder-badge-eb { background: #0ea5e9; color: #fff; }
.reminder-text { display: flex; flex-direction: column; gap: 1px; }
.reminder-label { font-weight: 600; color: var(--text); }
.reminder-sub   { font-size: 0.72rem; color: var(--text-secondary); }
.booster-reminder-item.warn .reminder-label { color: #f59e0b; }
.booster-reminder-item.ok  .reminder-label { color: var(--success); }

/* ---- EDIT ACTIONS ---- */
.edit-actions {
    display: flex;
    justify-content: center;
    gap: var(--sp);
    margin-bottom: calc(var(--sp)*3);
}

/* ---- PLAYER PICKER MODAL ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}
.modal {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
#info-modal {
    align-items: center;
}
.player-info-modal {
    max-height: 80vh;
    border-radius: var(--radius);
}

/* ---- LOGIN MODAL ---- */
.login-modal {
    max-width: 400px;
    border-radius: var(--radius);
    max-height: none;
}
.login-form {
    padding: 0 24px 24px;
}
.login-hint {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.5;
}
.login-input {
    width: 100%;
    padding: 12px 14px;
    font-family: var(--font);
    font-size: 0.95rem;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
    margin-bottom: 12px;
    transition: border-color 0.15s;
}
.login-input:focus {
    border-color: var(--accent);
}
.login-btn {
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
}
.login-status {
    margin-top: 12px;
    font-size: 0.85rem;
    text-align: center;
    min-height: 1.2em;
}
.login-status.error { color: var(--error); }
.login-status.success { color: var(--success); }
.player-info-modal .modal-body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--sp)*2) calc(var(--sp)*2.5);
    border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font);
    margin-left: auto;
}

.modal-filters {
    padding: calc(var(--sp)*1.5) calc(var(--sp)*2.5);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: var(--sp);
    flex-wrap: wrap;
    align-items: center;
}
.modal-filters input[type="text"] {
    flex: 1;
    min-width: 120px;
    padding: calc(var(--sp)*0.75) calc(var(--sp)*1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font);
}
.modal-filters select {
    padding: calc(var(--sp)*0.75) calc(var(--sp)*1.5);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: var(--font);
    background: var(--surface);
}

.modal-body {
    overflow-y: auto;
    flex: 1;
}

.player-list-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.player-list-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
    padding: calc(var(--sp)*1) calc(var(--sp)*1.5);
    text-align: left;
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.player-list-table th:hover { color: var(--accent); }
.player-list-table td {
    padding: calc(var(--sp)*1) calc(var(--sp)*1.5);
    border-bottom: 1px solid var(--bg);
}
.player-list-table tr { cursor: pointer; transition: background 0.15s; }
.player-list-table tbody tr:hover { background: var(--accent-bg); }
.player-list-table .unavailable { opacity: 0.5; }
.player-list-table .in-squad { background: var(--accent-bg); pointer-events: none; opacity: 0.5; }
.player-list-table .team-full { opacity: 0.4; cursor: help; }
.player-list-table .team-full .info-btn { pointer-events: auto; }
.player-list-table .pos-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

/* ---- AUTO-SUBS INFO ---- */
.auto-subs-info {
    background: var(--accent-bg);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: calc(var(--sp)*1.5) calc(var(--sp)*2);
    margin-bottom: calc(var(--sp)*2);
    font-size: 0.85rem;
    color: var(--accent);
}

/* ---- GW SECTIONS SPACING ---- */
.gw-league {
    margin-top: 36px;
}
#flop11-section {
    margin-top: 36px;
}
.gw-league-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ---- FIXTURES CALENDAR ---- */
#fixtures-calendar {
    margin-top: 36px;
}
.fixtures-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.fixture-date-badge {
    text-align: center;
    padding: 10px 0 6px;
    border-top: 1px solid var(--border);
}
.fixture-date-badge:first-child,
.fixture-header + .fixture-date-badge {
    border-top: none;
}
.fixture-date-badge span {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #fff;
    background: var(--accent);
    padding: 3px 12px;
    border-radius: 10px;
}
.fixture-row {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    gap: 8px;
}
.fixture-team {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.fixture-team-home {
    text-align: right;
}
.fixture-team-away {
    text-align: left;
}
.fixture-middle {
    flex-shrink: 0;
    min-width: 54px;
    text-align: center;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-subtle);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 3px 8px;
}
.fixture-score-ft {
    background: var(--bg-subtle);
    color: var(--text);
    font-weight: 700;
}
.fixture-score-live {
    background: var(--accent-bg);
    color: var(--accent);
    font-weight: 700;
    border-color: var(--accent);
}
.fixture-xg {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 34px;
    text-align: center;
    padding: 4px 6px;
    border-radius: 5px;
    line-height: 1;
    background: #111;
    color: #fff;
}
.fixture-header {
    padding: 6px 16px 2px;
    border-top: none;
}
.fixture-xg-label {
    flex-shrink: 0;
    min-width: 34px;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
/* Source legend above fixtures */
.fixtures-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.legend-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    letter-spacing: 0.02em;
}
.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    flex-shrink: 0;
}
.fixture-cards-label {
    flex-shrink: 0;
    min-width: 34px;
    text-align: center;
    font-size: 0.6rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.fixture-cards {
    flex-shrink: 0;
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 34px;
    text-align: center;
    padding: 4px 6px;
    border-radius: 5px;
    line-height: 1;
    background: var(--warning);
    color: #111;
}
@media (max-width: 600px) {
    .fixture-row {
        padding: 8px 6px;
        gap: 4px;
    }
    .fixture-team {
        font-size: 0.8rem;
    }
    .fixture-middle {
        font-size: 0.72rem;
        min-width: 48px;
    }
    .fixture-xg {
        font-size: 0.75rem;
        min-width: 30px;
        padding: 3px 5px;
    }
    .fixture-xg-label,
    .fixture-cards-label {
        min-width: 30px;
    }
    .fixture-cards {
        font-size: 0.75rem;
        min-width: 30px;
        padding: 3px 5px;
    }
    .fixtures-legend { gap: 10px; }
    .legend-badge { font-size: 0.6rem; }
    .lineup-grid { flex-direction: column; gap: 0; }
    .lineup-side { border-right: none; border-bottom: 1px solid var(--border); }
    .lineup-side:last-child { border-bottom: none; }
}

/* Clickable fixture rows */
.fixture-row-clickable {
    cursor: pointer;
    transition: background 0.15s;
}
.fixture-row-clickable:hover {
    background: var(--bg-subtle);
}
.fixture-row-expanded {
    background: var(--accent-bg);
}

/* Lineup expanded panel */
.lineup-panel {
    border-top: 1px solid var(--border);
    background: var(--bg-subtle);
}
.lineup-grid {
    display: flex;
}
.lineup-side {
    flex: 1;
    padding: 10px 14px 12px;
}
.lineup-side:first-child {
    border-right: 1px solid var(--border);
}
.lineup-side-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border);
}
.lineup-player {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    font-size: 0.8rem;
}
.lineup-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}
.lineup-dot-starter { background: var(--accent); }
.lineup-dot-starter-ques { background: var(--warning); }
.lineup-dot-ques { background: #f08c00; }
.lineup-dot-out { background: var(--error); }
.lineup-pos {
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 18px;
}
.lineup-name {
    flex: 1;
    font-weight: 500;
    color: var(--text);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.lineup-stat {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.lineup-col-header {
    padding-bottom: 2px;
    margin-bottom: 2px;
}
.lineup-col-header .lineup-stat {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-secondary);
    opacity: 0.7;
}
/* Status legend below fixtures */
.fixtures-status-legend {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.status-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: var(--text-secondary);
}

.lineup-actions {
    display: inline-flex;
    gap: 4px;
    min-width: 38px;
    justify-content: flex-end;
    flex-shrink: 0;
}
.lineup-action-btn {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: var(--surface);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.15s;
    font-family: var(--font);
}
.lineup-action-btn:hover {
    background: var(--accent-bg);
    color: var(--accent);
    border-color: var(--accent);
}
.lineup-action-add {
    font-size: 0.85rem;
}
.lineup-action-add:hover {
    background: var(--accent);
    color: #fff;
}

.lineup-divider {
    border-top: 1px dashed var(--border-strong);
    margin: 6px 0;
}
.lineup-empty {
    font-size: 0.78rem;
    color: var(--text-secondary);
    padding: 8px 0;
    font-style: italic;
}
.lineup-stat-pos { color: var(--accent); font-weight: 600; }
.lineup-stat-neg { color: var(--error); font-weight: 600; }
.lineup-stat-zero { color: var(--text-secondary); opacity: 0.6; }
.lineup-divider { font-size: 0.6rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.fixture-status-badge {
    font-size: 0.6rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: center;
    letter-spacing: 0.02em;
}
.fixture-status-live {
    color: var(--error);
}

/* Picker lineup status dots */
.picker-lineup-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-left: 4px;
    vertical-align: middle;
}
/* Picker lineup legend */
.picker-lineup-legend {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 6px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
    flex-wrap: wrap;
}

.picker-lineup-starter { background: var(--accent); }
.picker-lineup-starter-ques { background: var(--warning); }
.picker-lineup-ques { background: #f08c00; }
.picker-lineup-out, .picker-lineup-sus { background: var(--error); }

/* ---- LEAGUE TABLE ---- */
.league-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.league-table th {
    padding: 12px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border);
    background: var(--bg-subtle);
}
.league-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.league-table tbody tr:last-child td { border-bottom: none; }
.league-table tbody tr { transition: background 0.1s; cursor: pointer; }
.league-table tbody tr:hover { background: var(--bg-subtle); }
.league-table tr.current-user { background: var(--accent-bg); }
.league-table tr.current-user:hover { background: #e5f2e3; }
.league-table .rank {
    font-weight: 700;
    color: var(--text-secondary);
    width: 44px;
    font-size: 0.9rem;
    text-align: center;
}
.league-table tr.current-user .rank { color: var(--accent); }
.league-table .played {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    width: 56px;
}
.league-table .score {
    font-weight: 700;
    color: var(--text);
    text-align: right;
    font-size: 0.9rem;
    font-variant-numeric: tabular-nums;
}

/* ---- LOADING / EMPTY ---- */
.loading {
    text-align: center;
    padding: calc(var(--sp)*6);
    color: var(--text-secondary);
}
.empty-state {
    text-align: center;
    padding: calc(var(--sp)*6);
    color: var(--text-secondary);
}
.empty-state p { margin-bottom: calc(var(--sp)*2); }

/* ---- STATUS MESSAGE ---- */
.status-msg {
    padding: calc(var(--sp)*1.5) calc(var(--sp)*2);
    border-radius: var(--radius);
    margin-bottom: calc(var(--sp)*2);
    font-size: 0.9rem;
    text-align: center;
}
.status-msg.error { background: #fde8e8; color: var(--error); }
.status-msg.success { background: #e8fde8; color: var(--success); }

/* ---- ACTION MENU ---- */
.action-menu {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    padding: calc(var(--sp)*0.75);
    min-width: 160px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.action-menu-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: calc(var(--sp)*0.5) calc(var(--sp)*1);
    border-bottom: 1px solid var(--border);
    margin-bottom: 2px;
}
.action-menu-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: calc(var(--sp)*0.75) calc(var(--sp)*1);
    border: none;
    background: none;
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
    border-radius: 4px;
    color: var(--text);
    transition: background 0.15s;
}
.action-menu-btn:hover:not(:disabled) { background: var(--accent-bg); color: var(--accent); }
.action-menu-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.action-menu-btn.danger { color: var(--error); }
.action-menu-btn.danger:hover:not(:disabled) { background: #fde8e8; }
.action-menu-sep {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    padding: 6px calc(var(--sp)*1) 2px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
}
.action-menu-profile {
    color: var(--accent);
    font-size: 0.78rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: calc(var(--sp)*0.75);
    margin-bottom: 2px;
}

/* ---- HOW TO PLAY (collapsible) ---- */
.htp-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.htp-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 20px;
    background: var(--accent-bg);
    border: none;
    cursor: pointer;
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s;
}
.htp-toggle:hover { background: #e5f2e3; }
.htp-chevron {
    font-size: 1rem;
    transition: transform 0.2s;
    color: var(--text-secondary);
}
.htp-section.open .htp-chevron { transform: rotate(90deg); }
.htp-content {
    display: none;
    padding: 0 20px 20px;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text-secondary);
}
.htp-section.open .htp-content { display: block; }
.htp-intro { margin-bottom: 16px; }
.htp-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.htp-card {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    cursor: default;
}
.htp-card-title {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 12px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.8);
    border-radius: 6px;
}
.htp-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0,0,0,0.7);
    opacity: 0;
    transition: opacity 0.25s;
}
.htp-card:hover .htp-card-overlay { opacity: 1; }
.htp-card-overlay p {
    font-size: 0.88rem;
    color: #fff;
    line-height: 1.6;
    margin: 0;
    text-align: center;
}
.htp-hook {
    font-weight: 500;
    font-style: italic;
    color: var(--text-secondary);
    margin-bottom: 12px;
}
.htp-scoring-link {
    display: inline-block;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.82rem;
    text-decoration: none;
    border-bottom: 1px solid var(--text-secondary);
    transition: color 0.15s, border-color 0.15s;
}
.htp-scoring-link:hover { color: var(--text); border-color: var(--text); }

/* ---- LANDING PAGE ---- */
.landing-hero {
    margin-bottom: 32px;
}
.htp-links {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}
.landing-cta {
    text-align: center;
    padding: 8px 0 24px;
}
.landing-cta-btn {
    padding: 14px 40px;
    font-size: 1rem;
}

/* ---- ANONYMOUS CTA ---- */
.anon-cta {
    text-align: center;
    padding: 16px 24px;
    margin-bottom: 20px;
    background: var(--accent-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.88rem;
    color: var(--text-secondary);
}
.anon-cta-link {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid var(--accent);
}
.anon-cta-link:hover { color: var(--accent-light); border-color: var(--accent-light); }

/* ---- GW HEADER ---- */
.gw-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}
.gw-header .gw-title {
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    min-width: 160px;
    letter-spacing: -0.02em;
}

/* ---- GW STATUS BANNER ---- */
.gw-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.85rem;
    flex-wrap: wrap;
}
.banner-label {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 4px;
}
.banner-detail { font-weight: 500; }
.banner-detail strong { font-weight: 700; }
.banner-rank { font-weight: 500; color: var(--text-secondary); }

.banner-selection {
    background: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.banner-selection .banner-label { background: var(--text); color: var(--surface); }

.banner-active {
    background: #f0faf4;
    border: 1px solid #c6e9d4;
    color: #1a6b3a;
}
.banner-active .banner-label { background: var(--success); color: #fff; }

.banner-finished {
    background: var(--bg-subtle);
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.banner-finished .banner-label { background: var(--text-secondary); color: #fff; }

/* ---- JOIN CTA (anonymous users) ---- */
.join-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 14px 24px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    background: var(--text);
    color: var(--surface);
    cursor: pointer;
    font-size: 0.88rem;
    flex-wrap: wrap;
    transition: background 0.15s;
}
.join-cta:hover { background: #262626; }
.cta-text { font-weight: 600; }
.cta-deadline { opacity: 0.7; font-size: 0.78rem; }

/* (squad counter removed — no longer used) */

/* ---- SUB LABEL ---- */
.sub-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- INFO BUTTON (player picker) ---- */
.info-cell { width: 24px; padding: 4px !important; }
.info-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--accent);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    font-family: var(--font);
    padding: 0;
}
.info-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

.stat-cell { font-weight: 600; text-align: right; }

/* ---- PLAYER INFO MODAL ---- */
.player-info-modal { max-width: 800px; }

/* Player info header card */
.info-player-header {
    display: flex;
    align-items: center;
    gap: calc(var(--sp)*2);
    padding: calc(var(--sp)*2) calc(var(--sp)*2.5);
    border-radius: var(--radius) var(--radius) 0 0;
    color: #fff;
}
.info-player-header.gkp { background: var(--gkp); color: #333; }
.info-player-header.def { background: var(--def); }
.info-player-header.mid { background: var(--mid); }
.info-player-header.fwd { background: var(--fwd); }

.info-player-photo {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255,255,255,0.2);
    flex-shrink: 0;
    border: 2px solid rgba(255,255,255,0.4);
}
.info-player-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.info-player-meta { min-width: 0; }
.info-player-name {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.2;
}
.info-player-detail {
    font-size: 0.85rem;
    opacity: 0.85;
    margin-top: 2px;
}
#info-title:empty { display: none; }
.info-player-header + .info-table-wrap,
.info-player-header + .breakdown-wrap,
.info-player-header + .info-section-title,
.info-player-header + .info-empty,
.info-player-header + .breakdown-opponent {
    margin-top: calc(var(--sp)*2);
}

/* Key stats row below header */
.info-key-stats {
    display: flex;
    border-bottom: 1px solid var(--border);
}
.info-key-stat {
    flex: 1;
    text-align: center;
    padding: calc(var(--sp)*1.5) var(--sp);
}
.info-key-val {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}
.info-key-label {
    font-size: 0.6rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    padding: calc(var(--sp)*1.5) calc(var(--sp)*2.5) calc(var(--sp)*1);
    color: var(--text);
}

.info-table-wrap {
    overflow: auto;
    max-height: 45vh;
    margin: 0 calc(var(--sp)*2);
    margin-bottom: calc(var(--sp)*2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.info-gw-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    white-space: nowrap;
}
.info-gw-table th {
    padding: 4px 6px;
    text-align: center;
    font-weight: 600;
    font-size: 0.7rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--surface);
}
.info-gw-table td {
    padding: 4px 6px;
    text-align: center;
    border-bottom: 1px solid var(--bg);
}
.info-gw-table tbody tr:hover { background: var(--accent-bg); }

/* Anti-score contribution colors */
.contrib-pos { color: var(--success); font-size: 0.65rem; font-weight: 600; white-space: nowrap; }
.contrib-neg { color: var(--error); font-size: 0.65rem; font-weight: 600; white-space: nowrap; }
.anti-total-pos { color: var(--success); }
.anti-total-neg { color: var(--error); }

.info-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: calc(var(--sp)*3);
    font-size: 0.9rem;
}

/* ---- AVAILABILITY FLAGS (FPL-style) ---- */
.avail-flag {
    display: inline-block;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
    cursor: help;
    line-height: 1.2;
}
.avail-flag.red { background: var(--error); color: #fff; }
.avail-flag.orange { background: #e67e22; color: #fff; }
.avail-flag.yellow { background: #f1c40f; color: #333; }

/* Opponent column in picker */
.opp-cell { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; }

/* Unavailable row tooltip */
.player-list-table .unavailable { opacity: 0.45; cursor: help; }
.player-list-table .unavailable td { cursor: help; }

/* ---- COACH SLOT (player-style) ---- */
.player-photo-wrap.coach {
    background: #444;
    border-color: rgba(255,255,255,0.5);
}
.player-photo-wrap.coach .photo-fallback {
    font-size: 0.65rem;
    letter-spacing: 0.5px;
}
.coach-empty {
    background: rgba(255,255,255,0.12) !important;
    border: 2px dashed rgba(255,255,255,0.35) !important;
    color: rgba(255,255,255,0.5) !important;
    font-size: 1.2rem !important;
}
.coach-row-divider {
    width: 60%;
    max-width: 300px;
    margin: 4px auto 8px;
    border: none;
    border-top: 1px dashed rgba(255,255,255,0.25);
    position: relative;
    z-index: 2;
}
.reminder-badge-coach {
    background: #8b5cf6;
    color: #fff;
    font-size: 10px;
    padding: 2px 4px;
}

/* ---- FLOP 11 PITCH ---- */
.flop11-pitch {
    background: linear-gradient(180deg, #222 0%, #111 50%, #222 100%);
}
.flop11-pitch::before {
    background: rgba(255,255,255,0.1);
}
.flop11-pitch::after {
    border-color: rgba(255,255,255,0.1);
}

/* ---- FLOP 11 STAR BADGE ---- */
.flop11-star {
    position: absolute;
    top: -5px;
    left: -5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f5c518;
    color: #fff;
    font-size: 9px;
    line-height: 16px;
    text-align: center;
    z-index: 2;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* ---- RETURN BUTTON (viewing other manager) ---- */
.return-btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--text);
    color: var(--surface);
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font);
}
.return-btn:hover { background: #262626; }

/* ---- BREAKDOWN MODAL ---- */
.breakdown-opponent {
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
    padding: calc(var(--sp)*1) calc(var(--sp)*2) 0;
    font-size: 0.9rem;
}
.breakdown-summary {
    text-align: center;
    padding: calc(var(--sp)*1.5) calc(var(--sp)*2);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: calc(var(--sp)*1.5);
    border-bottom: 1px solid var(--border);
}
.breakdown-captain { font-size: 0.8rem; opacity: 0.6; }
.breakdown-mins { font-size: 0.85rem; color: var(--text-secondary); }
.breakdown-wrap { padding: calc(var(--sp)*1) calc(var(--sp)*2) calc(var(--sp)*2); }
.breakdown-table td { padding: 6px 10px; }
.breakdown-total {
    border-top: 2px solid var(--border);
    background: var(--accent-bg);
}
.breakdown-total td { padding: 8px 10px; }

/* ---- PLAYERS PAGE ---- */
.players-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.players-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.players-filter-input,
.players-filter-select {
    font-family: var(--font);
    font-size: 0.85rem;
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s;
}
.players-filter-input:focus,
.players-filter-select:focus {
    border-color: var(--accent);
}
.players-filter-input {
    flex: 1;
    min-width: 160px;
}
.players-filter-select {
    min-width: 120px;
}

.players-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    max-height: 75vh;
    overflow-y: auto;
}

.players-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    white-space: nowrap;
}
.players-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg-subtle);
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-strong);
    user-select: none;
}
.players-table thead th.sortable {
    cursor: pointer;
    transition: color 0.15s;
}
.players-table thead th.sortable:hover {
    color: var(--text);
}
.players-table thead th.sortable.active {
    color: var(--accent);
}
.players-table thead th.sortable.active::after {
    content: ' ▼';
    font-size: 0.65rem;
}
.players-table thead th.sortable.active.sort-asc::after {
    content: ' ▲';
}
.players-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
}
.players-table tbody tr {
    cursor: pointer;
    transition: background 0.12s;
}
.players-table tbody tr:hover {
    background: var(--accent-bg);
}

.col-rank {
    width: 36px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
}
.col-pos { width: 44px; }
.col-name { min-width: 140px; font-weight: 500; }
.col-team { min-width: 50px; color: var(--text-secondary); font-size: 0.8rem; }
.col-stat { text-align: right; min-width: 44px; }
.players-table tbody td:nth-child(n+5) { text-align: right; }

.stat-highlight {
    font-weight: 700;
    color: var(--accent);
}

.players-table .pos-badge {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
}

.players-count {
    margin-top: 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

/* ---- RESPONSIVE ---- */
@media (max-width: 600px) {
    .container { padding: 20px 12px; }
    .header-inner { padding: 0 16px; }
    .header-nav { gap: 2px; }
    .header-nav a { font-size: 0.82rem; padding: 6px 10px; }
    .player-slot { width: 68px; }
    .player-photo-wrap { width: 38px; height: 38px; }
    .player-shirt { width: 38px; height: 38px; }
    .player-name { font-size: 0.6rem; max-width: 68px; }
    .player-opp { font-size: 0.55rem; }
    .modal { max-height: 90vh; border-radius: var(--radius) var(--radius) 0 0; }
    .score-summary { gap: calc(var(--sp)*2); }
    .info-player-photo { width: 48px; height: 48px; }
    .info-player-name { font-size: 1rem; }
    .info-key-val { font-size: 0.95rem; }
    .htp-cards { grid-template-columns: 1fr; }
    .htp-card { aspect-ratio: 4/3; }
    .htp-card-overlay { opacity: 1; background: rgba(0,0,0,0.55); }
    .players-filters { flex-direction: column; }
    .players-filter-input { min-width: 100%; }
    .players-table { font-size: 0.78rem; }
    .players-table thead th { padding: 8px 8px; font-size: 0.72rem; }
    .players-table tbody td { padding: 6px 8px; }
    .col-name { min-width: 100px; }
}

/* ============================================================
   ANIMATIONS & MICROINTERACTIONS
   ============================================================ */

/* 1. Staggered section reveal on page load */
@keyframes section-reveal {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
.section-reveal {
    animation: section-reveal 0.35s ease-out both;
}

/* 2. Lineup/score panel slide-down */
.lineup-panel {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease-out, opacity 0.25s ease-out;
}
.lineup-panel.panel-open {
    max-height: 2000px;
    opacity: 1;
}

/* 3. Score panel row stagger */
@keyframes row-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.lineup-player.row-animated {
    animation: row-fade-in 0.2s ease-out both;
}

/* 4. Player slot hover on pitch (all modes) */
.player-slot {
    transition: transform 0.2s ease-out;
}
.player-slot:hover {
    transform: translateY(-3px);
}
.player-slot:hover .player-photo-wrap,
.player-slot:hover .player-shirt {
    transform: scale(1.06);
    filter: brightness(1.05);
}
.player-photo-wrap { transition: transform 0.2s ease-out, filter 0.2s ease-out, box-shadow 0.2s ease-out; }
.player-shirt { transition: transform 0.2s ease-out, filter 0.2s ease-out; }

/* 5. Fixture row hover sweep */
.fixture-row-clickable {
    position: relative;
    overflow: hidden;
}
.fixture-row-clickable::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, var(--accent-bg) 0%, transparent 100%);
    transform: translateX(-100%);
    transition: transform 0.35s ease-out;
    z-index: 0;
    pointer-events: none;
}
.fixture-row-clickable:hover::before {
    transform: translateX(0);
}
.fixture-row-clickable > * {
    position: relative;
    z-index: 1;
}

/* 7. Status badge pulse for live matches */
@keyframes live-badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
.fixture-status-live {
    color: var(--error);
    animation: live-badge-pulse 2s ease-in-out infinite;
}

/* 8. Save success feedback */
@keyframes success-pop {
    0%   { transform: scale(0.8); opacity: 0; }
    50%  { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}
.status-msg.success {
    animation: success-pop 0.35s ease-out;
}

/* 9. Player add/remove feedback */
@keyframes slot-pop-in {
    0%   { transform: scale(0.7); opacity: 0; }
    60%  { transform: scale(1.08); }
    100% { transform: scale(1); opacity: 1; }
}
.player-slot.slot-just-added {
    animation: slot-pop-in 0.3s ease-out;
}

/* 10. Skeleton shimmer loading */
@keyframes shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}
.skeleton {
    background: linear-gradient(90deg, var(--bg-subtle) 25%, #e8e8e8 50%, var(--bg-subtle) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}
.skeleton-pitch {
    height: 280px;
    margin: 16px 0;
}
.skeleton-fixtures {
    height: 200px;
    margin: 16px 0;
}
.skeleton-league {
    height: 150px;
    margin: 16px 0;
}

/* League table row entrance */
@keyframes table-row-in {
    from { opacity: 0; transform: translateX(-8px); }
    to   { opacity: 1; transform: translateX(0); }
}
.league-table tbody tr {
    animation: table-row-in 0.25s ease-out both;
}

/* Modal entrance */
@keyframes modal-slide-up {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}
@keyframes backdrop-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-backdrop {
    animation: backdrop-fade 0.2s ease-out;
}
.modal-backdrop .modal {
    animation: modal-slide-up 0.3s ease-out;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
