/**
 * FOOTBALL MANAGER - Retro Pixel Art Theme
 * NES/Game Boy inspired dark theme with pixel fonts,
 * aggressive animations, and CRT scanline overlay.
 */

/* ============================================
   CSS VARIABLES (Retro NES/Game Boy Palette)
   ============================================ */
:root {
    /* Color Palette */
    --fm-primary: #0f380f;
    --fm-secondary: #306230;
    --fm-accent: #8bac0f;
    --fm-gold: #fcbc00;
    --fm-gold-hover: #ffe066;
    --fm-bg: #0a120a;
    --fm-card: #121e14;
    --fm-border: #2a4a2e;
    --fm-text: #e4e4e0;
    --fm-muted: #8a9a80;
    --fm-red: #e40058;
    --fm-blue: #0078f8;
    --fm-cyan: #00e8d8;
    --fm-pixel-border: #3a5c3e;

    /* Typography */
    --fm-font-heading: 'Press Start 2P', monospace;
    --fm-font-body: 'VT323', monospace;
    --fm-font-size-body: 1.25rem;
    --fm-font-size-heading: 0.85rem;

    /* Sidebar */
    --fm-sidebar-width: 220px;
    --fm-sidebar-bg: #0e1a0e;
    --fm-sidebar-border: #2a4a2e;
}

/* ============================================
   ANIMATION KEYFRAMES
   ============================================ */
@keyframes pixel-shimmer {
    0% { text-shadow: 0 0 2px var(--fm-gold); }
    50% { text-shadow: 0 0 6px rgba(252,188,0,0.5); }
    100% { text-shadow: 0 0 2px var(--fm-gold); }
}

@keyframes blink-cursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes pixel-fade-in {
    0% { opacity: 0; transform: translateY(-8px); }
    50% { opacity: 0.7; }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes loading-bar {
    0% { width: 0; }
    100% { width: 100%; }
}

@keyframes pixel-bounce {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-4px); }
    50% { transform: translateY(0); }
    75% { transform: translateY(-2px); }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 2px var(--fm-gold); }
    50% { box-shadow: 0 0 6px rgba(252,188,0,0.3); }
}

@keyframes rainbow-cycle {
    0% { color: #e40058; }
    16% { color: #fcbc00; }
    33% { color: #8bac0f; }
    50% { color: #00e8d8; }
    66% { color: #0078f8; }
    83% { color: #b53bef; }
    100% { color: #e40058; }
}

@keyframes screen-flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.85; }
    94% { opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ============================================
   GLOBAL OVERRIDES
   ============================================ */
body {
    background: var(--fm-bg);
    color: var(--fm-text);
    font-family: var(--fm-font-body);
    font-size: var(--fm-font-size-body);
    min-height: 100vh;
    image-rendering: pixelated;
}

/* CRT Scanline Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.12) 0px,
        rgba(0, 0, 0, 0.12) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Headings: pixel font */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--fm-font-heading);
    letter-spacing: 1px;
    line-height: 1.8;
}

h1, .h1 { font-size: 1.1rem; }
h2, .h2 { font-size: 0.95rem; }
h3, .h3 { font-size: 0.85rem; }
h4, .h4 { font-size: 0.75rem; }
h5, .h5 { font-size: 0.7rem; }
h6, .h6 { font-size: 0.65rem; }

a {
    color: var(--fm-gold);
}

a:hover {
    color: var(--fm-gold-hover);
}

/* ============================================
   CUSTOM BUTTONS (Pixel Art 3D)
   ============================================ */
.btn-gold {
    font-family: var(--fm-font-heading);
    font-size: 0.55rem;
    background: var(--fm-gold);
    color: #000;
    border: none;
    border-radius: 0;
    padding: 10px 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    box-shadow:
        4px 4px 0 0 #b38600,
        -2px -2px 0 0 #ffe066,
        0 4px 0 0 #b38600,
        4px 0 0 0 #b38600;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-gold:hover {
    color: #000;
    background: var(--fm-gold-hover);
    transform: translate(2px, 2px);
    box-shadow:
        2px 2px 0 0 #b38600,
        -1px -1px 0 0 #ffe066;
}

.btn-gold:active {
    color: #000;
    background: var(--fm-gold);
    transform: translate(4px, 4px);
    box-shadow: none;
}

.btn-gold:disabled, .btn-gold.disabled {
    background: #7a6a20;
    color: #444;
    box-shadow: 2px 2px 0 0 #5a4a10;
    cursor: not-allowed;
    transform: none;
}

.btn-game {
    font-family: var(--fm-font-heading);
    font-size: 0.55rem;
    background: var(--fm-secondary);
    color: var(--fm-accent);
    border: none;
    border-radius: 0;
    padding: 10px 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    box-shadow:
        4px 4px 0 0 #1a3a1a,
        -2px -2px 0 0 #4a7a4a;
    transition: transform 0.1s, box-shadow 0.1s;
}

.btn-game:hover {
    color: var(--fm-gold);
    background: var(--fm-accent);
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 0 #1a3a1a;
}

.btn-game:active {
    transform: translate(4px, 4px);
    box-shadow: none;
}

.btn-outline-secondary {
    font-family: var(--fm-font-heading);
    font-size: 0.5rem;
    border-radius: 0;
    border: 2px solid var(--fm-pixel-border);
    color: var(--fm-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.1s;
}

.btn-outline-secondary:hover {
    background: var(--fm-pixel-border);
    color: var(--fm-gold);
    border-color: var(--fm-gold);
}

.btn-outline-secondary:disabled {
    color: var(--fm-muted);
    border-color: #1f351f;
    background: transparent;
}

.btn-outline-light {
    font-family: var(--fm-font-heading);
    font-size: 0.5rem;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-outline-light:hover {
    background: rgba(255,255,255,0.1);
}

.btn-outline-danger {
    font-family: var(--fm-font-heading);
    font-size: 0.5rem;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Button size overrides */
.btn-lg {
    padding: 14px 28px;
    font-size: 0.6rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.45rem;
}

/* Button group - pixel borders */
.btn-group .btn {
    border-radius: 0 !important;
}

/* ============================================
   CARDS (Sharp Pixel Borders)
   ============================================ */
.card-dark,
.card.card-dark {
    background: var(--fm-card);
    border: 3px solid var(--fm-border);
    border-radius: 0;
    color: var(--fm-text);
    box-shadow:
        6px 6px 0 0 rgba(0,0,0,0.5),
        inset 0 0 0 1px rgba(255,255,255,0.05);
    animation: pixel-fade-in 0.4s ease-out;
}

.card-dark .card-header {
    background: rgba(0,0,0,0.4);
    border-bottom: 3px solid var(--fm-border);
    color: var(--fm-gold);
    font-family: var(--fm-font-heading);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 12px 16px;
    border-radius: 0;
}

.card-dark .card-footer {
    background: rgba(0,0,0,0.3);
    border-top: 3px solid var(--fm-border);
    border-radius: 0;
}

/* Card with Bootstrap's bg-dark */
.card.bg-dark {
    border-radius: 0 !important;
    border-color: var(--fm-border) !important;
    box-shadow: 4px 4px 0 0 rgba(0,0,0,0.4);
}

/* ============================================
   FORMS (Dark Retro)
   ============================================ */
.form-control-dark,
.form-control {
    background: rgba(0,0,0,0.5);
    border: 3px solid var(--fm-border);
    border-radius: 0;
    color: var(--fm-text);
    font-family: var(--fm-font-body);
    font-size: 1.2rem;
    padding: 8px 12px;
}

.form-control-dark:focus,
.form-control:focus {
    background: rgba(0,0,0,0.6);
    border-color: var(--fm-gold);
    color: var(--fm-text);
    box-shadow: 0 0 0 2px rgba(252,188,0,0.15);
}

.form-control-dark::placeholder,
.form-control::placeholder {
    color: var(--fm-muted);
}

.form-label {
    font-family: var(--fm-font-heading);
    font-size: 0.5rem;
    color: var(--fm-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.form-select {
    border-radius: 0;
    border: 3px solid var(--fm-border);
    background-color: rgba(0,0,0,0.5);
    color: var(--fm-text);
    font-family: var(--fm-font-body);
    font-size: 1.2rem;
}

/* ============================================
   MAIN MENU PAGE (Landing, Login, Register)
   ============================================ */
.main-menu {
    min-height: 100vh;
    background: var(--fm-bg);
    position: relative;
    overflow: hidden;
}

/* Pixel particle dots */
.main-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(2px 2px at 20% 30%, var(--fm-accent) 50%, transparent 50%),
        radial-gradient(2px 2px at 40% 70%, var(--fm-gold) 50%, transparent 50%),
        radial-gradient(2px 2px at 60% 20%, var(--fm-cyan) 50%, transparent 50%),
        radial-gradient(2px 2px at 80% 60%, var(--fm-accent) 50%, transparent 50%),
        radial-gradient(2px 2px at 10% 80%, var(--fm-gold) 50%, transparent 50%),
        radial-gradient(2px 2px at 50% 50%, var(--fm-blue) 50%, transparent 50%),
        radial-gradient(2px 2px at 90% 10%, var(--fm-cyan) 50%, transparent 50%),
        radial-gradient(2px 2px at 30% 90%, var(--fm-accent) 50%, transparent 50%);
    animation: screen-flicker 8s infinite;
    opacity: 0.25;
    pointer-events: none;
}

.game-title {
    font-family: var(--fm-font-heading);
    font-size: 1.3rem;
    color: var(--fm-gold);
    text-shadow:
        4px 4px 0 #b38600,
        -1px -1px 0 #ffe066;
    animation: pixel-shimmer 2s infinite;
    line-height: 2;
}

.game-title:hover {
    animation: rainbow-cycle 2s linear infinite;
    text-shadow: none;
}

/* ============================================
   TEAM SELECTION GRID
   ============================================ */
.team-card {
    background: rgba(0,0,0,0.3);
    border: 3px solid var(--fm-border);
    border-radius: 0;
    padding: 12px;
    cursor: pointer;
    transition: all 0.15s;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.team-card:hover {
    border-color: var(--fm-accent);
    transform: translate(-2px, -2px);
    box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
}

.team-card.selected {
    border-color: var(--fm-gold);
    background: rgba(252, 188, 0, 0.08);
    box-shadow: 4px 4px 0 rgba(252, 188, 0, 0.2);
}

/* ============================================
   SAVE LIST
   ============================================ */
.save-item {
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--fm-border);
    border-radius: 0;
    transition: all 0.15s;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.save-item:hover {
    border-color: var(--fm-accent);
    transform: translateX(4px);
}

/* ============================================
   DASHBOARD
   ============================================ */
.stat-value {
    font-family: var(--fm-font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fm-gold);
}

.match-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--fm-border);
    border-radius: 0;
}

.match-team {
    text-align: center;
    flex: 1;
}

.match-vs {
    padding: 0 1rem;
    color: var(--fm-muted);
    font-weight: bold;
    font-family: var(--fm-font-heading);
    font-size: 0.7rem;
}

/* ============================================
   ROLE BADGES
   ============================================ */
.badge {
    border-radius: 0;
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    letter-spacing: 1px;
    padding: 4px 8px;
    text-transform: uppercase;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.3);
}

.badge-gk { background: #fcbc00 !important; color: #000 !important; }
.badge-def { background: #0078f8 !important; color: #fff !important; }
.badge-mid { background: #8bac0f !important; color: #000 !important; }
.badge-fwd { background: #e40058 !important; color: #fff !important; }

.badge-injured { background: #c0392b !important; color: #fff !important; font-size: 0.4rem; }
.badge-suspended { background: #f39c12 !important; color: #000 !important; font-size: 0.4rem; }

/* ============================================
   TABLES (Dark Retro)
   ============================================ */
.table-dark-custom,
.table-dark,
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--fm-text);
    --bs-table-border-color: var(--fm-border);
    font-family: var(--fm-font-body);
    font-size: 1.15rem;
}

.table-dark-custom th,
.table-dark th,
.table th {
    background: rgba(0,0,0,0.4);
    color: var(--fm-gold);
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 3px solid var(--fm-gold) !important;
    padding: 10px 8px;
}

.table-dark-custom tr:hover td,
.table-dark tr:hover td,
.table-hover tr:hover td {
    background: rgba(139, 172, 15, 0.08);
}

/* ============================================
   ALERTS (Pixel)
   ============================================ */
.alert {
    border-radius: 0;
    border-width: 3px;
    font-family: var(--fm-font-body);
    font-size: 1.15rem;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

/* ============================================
   PLAYER PAGE
   ============================================ */
.player-row:hover {
    background: rgba(252, 188, 0, 0.08);
    cursor: pointer;
}

.player-link {
    color: inherit;
    text-decoration: none;
}

.player-link:hover {
    color: var(--fm-gold);
}

.player-unavailable {
    opacity: 0.6;
}

/* Attribute bars */
.attr-bar {
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 0;
    overflow: hidden;
    border: 1px solid var(--fm-border);
}

.attr-fill {
    height: 100%;
    border-radius: 0;
    transition: width 0.5s steps(10);
}

.attr-low { background: var(--fm-red); }
.attr-mid { background: #fcbc00; }
.attr-good { background: var(--fm-secondary); }
.attr-excellent { background: var(--fm-accent); }

.attr-value {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 600;
    font-family: var(--fm-font-body);
    font-size: 1.1rem;
}

/* Player detail page */
.player-header {
    background: linear-gradient(135deg, rgba(15, 56, 15, 0.8) 0%, rgba(10, 18, 10, 0.9) 100%);
    border: 3px solid var(--fm-border);
    border-radius: 0;
    padding: 2rem;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.5);
}

.player-overall {
    width: 100px;
    height: 100px;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--fm-font-heading);
    border: 4px solid var(--fm-gold);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
}

.overall-excellent { background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%); }
.overall-good { background: linear-gradient(135deg, #2980b9 0%, #3498db 100%); }
.overall-average { background: linear-gradient(135deg, #f39c12 0%, #f1c40f 100%); color: #000; }
.overall-low { background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%); }

.info-label {
    color: var(--fm-muted);
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-value {
    font-size: 1.25rem;
    font-weight: 600;
    font-family: var(--fm-font-body);
}

.attr-icon {
    width: 28px;
    text-align: center;
}

/* Player detail - larger attr bars */
.col-lg-8 .attr-bar {
    height: 24px;
    position: relative;
}

.col-lg-8 .attr-fill {
    display: flex;
    align-items: center;
    padding-left: 10px;
}

/* ============================================
   MARKET PAGE
   ============================================ */
.player-card {
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--fm-border);
    border-radius: 0;
    padding: 12px 16px;
    margin-bottom: 8px;
    transition: border-color 0.15s, transform 0.1s;
}

.player-card:hover {
    border-color: var(--fm-gold);
    transform: translateX(4px);
    box-shadow: -4px 0 0 0 var(--fm-gold);
}

/* ============================================
   CALENDAR PAGE
   ============================================ */
.match-card {
    background: rgba(0,0,0,0.3);
    border: 2px solid var(--fm-border);
    border-radius: 0;
    padding: 12px 16px;
    margin-bottom: 6px;
    transition: border-color 0.2s;
}

.match-card.played {
    opacity: 0.8;
}

.match-card.current {
    border-color: var(--fm-gold);
    background: rgba(252, 188, 0, 0.05);
    box-shadow: -4px 0 0 0 var(--fm-gold);
}

.match-score {
    font-family: var(--fm-font-heading);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0 1rem;
}

.matchday-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: center;
}

.view-toggle .btn {
    min-width: 100px;
}

/* ============================================
   STANDINGS PAGE
   ============================================ */
.division-tab {
    padding: 8px 16px;
    border: 2px solid var(--fm-border);
    background: transparent;
    color: var(--fm-text);
    text-decoration: none;
    border-radius: 0;
    margin-right: 4px;
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    text-transform: uppercase;
    transition: all 0.15s;
}

.division-tab:hover {
    background: rgba(252, 188, 0, 0.1);
    color: var(--fm-gold);
    border-color: var(--fm-gold);
}

.division-tab.active {
    background: var(--fm-card);
    border-bottom-color: var(--fm-card);
    color: var(--fm-gold);
    box-shadow: 0 -3px 0 0 var(--fm-gold);
}

.player-team-row {
    background: rgba(252, 188, 0, 0.1) !important;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-family: var(--fm-font-body);
}

.legend-box {
    width: 1rem;
    height: 1rem;
    border-radius: 0;
}

.legend-promotion { background: var(--fm-accent); }
.legend-relegation { background: var(--fm-red); }

/* Promotion/relegation zone overrides */
.table-success { background: rgba(139, 172, 15, 0.15) !important; }
.table-danger { background: rgba(228, 0, 88, 0.15) !important; }
.table-warning { background: rgba(252, 188, 0, 0.1) !important; }

/* ============================================
   SIMULATE PAGE
   ============================================ */
.match-display {
    background: rgba(0,0,0,0.4);
    border: 3px solid var(--fm-border);
    border-radius: 0;
    padding: 2rem;
    box-shadow: 6px 6px 0 rgba(0,0,0,0.4);
}

.team-name {
    font-family: var(--fm-font-heading);
    font-size: 0.55rem;
    font-weight: 600;
    line-height: 1.8;
}

.score-display {
    font-family: var(--fm-font-heading);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    animation: pixel-fade-in 1s ease-out;
}

.result-badge {
    font-family: var(--fm-font-heading);
    font-size: 0.6rem;
    border-radius: 0;
    padding: 8px 24px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.event-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    animation: slide-in-right 0.3s ease-out;
    font-family: var(--fm-font-body);
    font-size: 1.1rem;
}

.event-item:last-child {
    border-bottom: none;
}

.event-minute {
    display: inline-block;
    width: 45px;
    font-weight: 600;
    color: var(--fm-gold);
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
}

.event-icon {
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.events-column {
    max-height: 400px;
    overflow-y: auto;
}

.other-results {
    max-height: 300px;
    overflow-y: auto;
}

.result-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--fm-border);
    font-family: var(--fm-font-body);
}

.result-item:last-child {
    border-bottom: none;
}

/* ============================================
   SCORERS PAGE
   ============================================ */
.rank-1 { color: #ffd700; font-weight: 700; }
.rank-2 { color: #c0c0c0; font-weight: 700; }
.rank-3 { color: #cd7f32; font-weight: 700; }

.stat-highlight {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--fm-gold);
}

.your-team-row {
    background: rgba(252, 188, 0, 0.08);
}

/* Nav tabs retro override */
.nav-tabs {
    border-bottom: 3px solid var(--fm-border);
}

.nav-tabs .nav-link {
    border-radius: 0;
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    text-transform: uppercase;
    color: var(--fm-text);
    border: 2px solid transparent;
    padding: 8px 16px;
}

.nav-tabs .nav-link:hover {
    color: var(--fm-gold);
    border-color: var(--fm-border);
}

.nav-tabs .nav-link.active {
    background: var(--fm-card);
    color: var(--fm-gold);
    border-color: var(--fm-border);
    border-bottom-color: var(--fm-card);
}

/* ============================================
   SIDEBAR
   ============================================ */
.game-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--fm-sidebar-width);
    height: 100vh;
    background: var(--fm-sidebar-bg);
    border-right: 4px solid var(--fm-sidebar-border);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
    box-shadow:
        4px 0 0 0 var(--fm-border),
        inset -1px 0 0 0 rgba(255,255,255,0.05);
}

.sidebar-logo {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 3px solid var(--fm-border);
    background: rgba(0,0,0,0.3);
}

.sidebar-logo-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 6px;
    animation: pixel-bounce 2s infinite;
}

.sidebar-logo-text {
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    color: var(--fm-gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    display: block;
    line-height: 1.8;
}

.sidebar-team-info {
    padding: 12px;
    text-align: center;
    border-bottom: 2px solid var(--fm-border);
    background: rgba(139, 172, 15, 0.05);
}

.sidebar-team-name {
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    color: var(--fm-accent);
    margin-bottom: 4px;
    line-height: 1.6;
}

.sidebar-team-division {
    font-family: var(--fm-font-body);
    font-size: 1rem;
    color: var(--fm-muted);
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--fm-text);
    text-decoration: none;
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-left: 4px solid transparent;
    transition: all 0.15s;
    line-height: 1.8;
}

.sidebar-nav-item:hover {
    background: rgba(139, 172, 15, 0.1);
    color: var(--fm-gold);
    border-left-color: var(--fm-gold);
}

.sidebar-nav-item.active {
    background: rgba(252, 188, 0, 0.1);
    color: var(--fm-gold);
    border-left-color: var(--fm-gold);
}

.sidebar-nav-item.active .sidebar-icon {
    animation: pixel-bounce 2s infinite;
}

.sidebar-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 12px;
    border-top: 3px solid var(--fm-border);
    background: rgba(0,0,0,0.2);
}

.sidebar-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.sidebar-stat-label {
    font-family: var(--fm-font-heading);
    font-size: 0.4rem;
    color: var(--fm-muted);
    text-transform: uppercase;
}

.sidebar-stat-value {
    font-family: var(--fm-font-body);
    font-size: 1.1rem;
    color: var(--fm-gold);
}

.sidebar-actions {
    margin-top: 12px;
}

/* Main content shift when sidebar is present */
.has-sidebar {
    margin-left: var(--fm-sidebar-width);
}

.has-sidebar .container {
    max-width: 1100px;
}

/* ============================================
   8-BIT LOADING BAR
   ============================================ */
.pixel-loading {
    width: 200px;
    height: 20px;
    background: rgba(0,0,0,0.4);
    border: 3px solid var(--fm-border);
    position: relative;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.pixel-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--fm-accent);
    animation: loading-bar 2s steps(10) infinite;
}

/* ============================================
   AGGRESSIVE ANIMATIONS
   ============================================ */

/* Blinking cursor after card headers */
.card-dark .card-header h5::after,
.card-dark .card-header h2::after {
    content: '_';
    animation: blink-cursor 1s infinite;
    color: var(--fm-gold);
    margin-left: 4px;
}

/* Staggered card animations */
.has-sidebar .row > [class*="col-"]:nth-child(1) .card-dark { animation-delay: 0.05s; }
.has-sidebar .row > [class*="col-"]:nth-child(2) .card-dark { animation-delay: 0.15s; }
.has-sidebar .row > [class*="col-"]:nth-child(3) .card-dark { animation-delay: 0.25s; }
.has-sidebar .row > [class*="col-"]:nth-child(4) .card-dark { animation-delay: 0.35s; }

/* ============================================
   UTILITIES
   ============================================ */
.text-gold { color: var(--fm-gold) !important; }
.text-muted-custom { color: var(--fm-muted) !important; }
.bg-dark-custom { background: var(--fm-card) !important; }
.border-dark-custom { border-color: var(--fm-border) !important; }

/* Override Bootstrap's border-radius globally */
.border-secondary { border-color: var(--fm-border) !important; }
.rounded, .rounded-pill { border-radius: 0 !important; }

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--fm-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--fm-border);
    border: 1px solid var(--fm-bg);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--fm-muted);
}

/* ============================================
   LINEUP MANAGEMENT
   ============================================ */
.formation-display {
    background: rgba(0,0,0,0.3);
    border: 3px solid var(--fm-border);
    padding: 16px;
    text-align: center;
    margin-bottom: 16px;
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.formation-name {
    font-family: var(--fm-font-heading);
    font-size: 1.1rem;
    color: var(--fm-gold);
    animation: pixel-shimmer 2s infinite;
}

.formation-style {
    font-family: var(--fm-font-heading);
    font-size: 0.45rem;
    color: var(--fm-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

.formation-roles {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 8px;
}

.lineup-section {
    border-left: 4px solid var(--fm-gold);
    padding-left: 0;
}

.lineup-section.bench {
    border-left-color: var(--fm-muted);
    opacity: 0.85;
}

.lineup-section .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.starter-badge {
    background: var(--fm-accent) !important;
    color: #000 !important;
    font-size: 0.4rem;
}

.bench-badge {
    background: rgba(255,255,255,0.15) !important;
    color: var(--fm-muted) !important;
    font-size: 0.4rem;
}

.lineup-toggle-btn {
    font-family: var(--fm-font-heading);
    font-size: 0.4rem;
    border-radius: 0;
    padding: 4px 10px;
    text-transform: uppercase;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .game-sidebar {
        display: none;
    }

    .has-sidebar {
        margin-left: 0;
    }

    .game-title {
        font-size: 0.9rem;
    }
}
