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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #37003c 0%, #04f5ff 100%);
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

header {
    background: #37003c;
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #00cc6a;
}

.nav-links {
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
}

.hero-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid rgba(0, 255, 135, 0.28);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(4, 245, 255, 0.1));
    color: #00ff87;
    text-decoration: none;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.hero-link:hover {
    transform: translateY(-2px);
    border-color: rgba(4, 245, 255, 0.65);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(4, 245, 255, 0.18));
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.team-name {
    font-size: 1.3em;
    color: #04f5ff;
    margin-top: 10px;
}

.search-container {
    margin-top: 20px;
    display: flex;
    gap: 14px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.search-container input {
    padding: 14px 24px;
    font-size: 1.1em;
    border: 3px solid #00ff87;
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f5fff9 100%);
    color: #37003c;
    width: 260px;
    text-align: center;
    font-weight: bold;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.search-container input:focus {
    outline: none;
    border-color: #04f5ff;
    box-shadow: 0 0 0 4px rgba(4, 245, 255, 0.18), 0 12px 28px rgba(0, 0, 0, 0.24);
    transform: translateY(-1px);
}

.search-btn,
.friend-btn,
.section-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.search-btn {
    padding: 14px 34px;
    font-size: 1.1em;
    min-width: 150px;
    background: linear-gradient(135deg, #00ff87 0%, #00d978 100%);
    color: #37003c;
    box-shadow: 0 12px 24px rgba(0, 255, 135, 0.3);
}

.search-btn:hover {
    background: linear-gradient(135deg, #04f5ff 0%, #00ff87 100%);
    transform: translateY(-2px);
    box-shadow: 0 16px 32px rgba(4, 245, 255, 0.28);
}

.search-btn:active,
.friend-btn:active,
.section-btn:active,
.hero-link:active {
    transform: translateY(0);
}

.search-container label {
    color: white;
    font-size: 1.1em;
    font-weight: bold;
}

.friends-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.friend-btn {
    min-width: 48px;
    min-height: 44px;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
}

.friend-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #04f5ff;
    border-color: rgba(4, 245, 255, 0.45);
    transform: translateY(-2px);
    box-shadow: 0 12px 22px rgba(0, 0, 0, 0.24);
}

.section-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 22px;
}

.section-btn {
    min-height: 48px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
}

.compare-btn {
    color: #04f5ff;
    border-color: rgba(4, 245, 255, 0.35);
}

.ai-btn {
    color: #00ff87;
    border-color: rgba(0, 255, 135, 0.35);
}

.section-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.14);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.24);
}

.compare-btn:hover {
    border-color: rgba(4, 245, 255, 0.7);
    box-shadow: 0 14px 28px rgba(4, 245, 255, 0.16);
}

.ai-btn:hover {
    border-color: rgba(0, 255, 135, 0.7);
    box-shadow: 0 14px 28px rgba(0, 255, 135, 0.16);
}

.hero-link:focus-visible,
.search-btn:focus-visible,
.friend-btn:focus-visible,
.section-btn:focus-visible,
.search-container input:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.14), 0 0 0 7px rgba(4, 245, 255, 0.2);
}

.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 1.5em;
}

.progress-bar-wrap {
    width: 260px;
    max-width: 80%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin: 12px auto 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00ff87, #04f5ff);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-pct {
    font-size: 0.9em;
    color: #00ff87;
    margin: 0;
    letter-spacing: 1px;
}

.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    border: 6px solid rgba(255, 255, 255, 0.3);
    border-top: 6px solid #00ff87;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #ff4444;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    border-left: 5px solid #37003c;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.stat-label {
    color: #666;
    font-size: 0.9em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-value {
    color: #37003c;
    font-size: 2.5em;
    font-weight: bold;
}

.stat-value.chips {
    font-size: 1.8em;
    line-height: 1.2;
}

.stat-value.rank {
    color: #00cc6a;
}

.stat-value.positive {
    color: #00cc6a !important;
}

.stat-value.negative {
    color: #ff4444 !important;
}

.section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.section h2 {
    color: #37003c;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #00ff87;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    overflow-x: auto;
    display: block;
}

th {
    background: #37003c;
    color: white;
    padding: 15px;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 12px 15px;
    border-bottom: 1px solid #ddd;
    white-space: nowrap;
}

tr:hover {
    background: #f5f5f5;
}

.chip {
    display: inline-block;
    background: #00ff87;
    color: #37003c;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    margin: 2px;
}

.chip.used {
    background: #ddd;
    color: #666;
}

td.positive {
    color: #00cc6a;
}

td.negative {
    color: #ff4444;
}

.manager-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.info-label {
    color: #666;
    font-size: 0.9em;
    margin-bottom: 5px;
}

.info-value {
    color: #37003c;
    font-size: 1.3em;
    font-weight: bold;
}

/* Footer styles */
footer {
    background: rgba(55, 0, 60, 0.95);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-radius: 15px 15px 0 0;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
}

footer a {
    color: #00ff87;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

footer a:hover {
    color: #04f5ff;
    text-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
}

footer .disclaimer {
    margin-top: 15px;
    font-size: 0.75em;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #00ff87;
    color: #37003c;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    background: #04f5ff;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 255, 135, 0.5);
}

.scroll-to-top:active {
    transform: translateY(-2px);
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 1.8em;
    }

    .team-name {
        font-size: 1.1em;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-value {
        font-size: 2em;
    }

    header {
        padding: 20px;
    }

    .section {
        padding: 20px;
    }

    .search-container input {
        width: 220px;
        font-size: 1em;
        padding: 10px 15px;
    }

    .search-btn {
        padding: 10px 25px;
        font-size: 1em;
    }

    .search-container label {
        font-size: 1em;
    }

    table {
        font-size: 0.85em;
    }

    th, td {
        padding: 10px 8px;
    }

    .manager-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-item {
        width: 100%;
    }

    .info-value {
        font-size: 1.1em;
    }

    canvas {
        max-height: 300px !important;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5em;
    }

    .stat-value {
        font-size: 1.8em;
    }

    .search-container {
        flex-direction: column;
        gap: 15px;
    }

    .search-container input,
    .search-btn {
        width: 100%;
        max-width: 320px;
    }

    .section-buttons,
    .friends-buttons {
        gap: 10px;
    }

    .section-btn {
        width: 100%;
        max-width: 320px;
    }

    table {
        font-size: 0.75em;
    }

    th, td {
        padding: 8px 5px;
    }

    .scroll-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
}

/* Better table scroll on mobile */
@media (max-width: 768px) {
    .section {
        overflow-x: auto;
    }

    table {
        min-width: 600px;
    }
}
/* Pitch and Squad Visualization */
.pitch-container {
    margin: 20px 0;
}

.pitch {
    background: linear-gradient(180deg, #2d8a3e 0%, #1f6b2e 50%, #2d8a3e 100%);
    border: 3px solid white;
    border-radius: 10px;
    padding: 30px 20px;
    position: relative;
    min-height: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.pitch::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.6);
    transform: translateY(-50%);
}

.pitch::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 120px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.pitch-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.pitch-row {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.pitch-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.player-emoji {
    font-size: 2.5em;
    line-height: 1;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-shirt {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #37003c 0%, #04f5ff 100%);
    border: 3px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    position: relative;
}

.player-shirt.captain::after {
    content: 'C';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #00ff87;
    color: #37003c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    border: 2px solid white;
}

.player-shirt.vice-captain::after {
    content: 'V';
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #04f5ff;
    color: #37003c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 12px;
    border: 2px solid white;
}

.player-name {
    background: white;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: bold;
    color: #37003c;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.player-points {
    background: #37003c;
    color: #00cc6a;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 0.85em;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.bench-section {
    margin-top: 30px;
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.bench-section h3 {
    color: #37003c;
    margin-bottom: 15px;
    font-size: 1.3em;
    text-align: center;
}

.bench-players {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.bench-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 80px;
}

.bench-player .player-shirt {
    opacity: 0.7;
    border-color: #ccc;
}

.bench-player .player-name {
    background: #f0f0f0;
    color: #666;
}

.bench-player .player-points {
    background: #666;
    color: white;
}

/* Responsive pitch layout */
@media (max-width: 768px) {
    .pitch {
        padding: 20px 10px;
        min-height: 400px;
    }

    .pitch-row {
        gap: 10px;
    }

    .pitch-player {
        min-width: 60px;
    }

    .player-shirt {
        width: 50px;
        height: 50px;
        font-size: 0.6em;
    }

    .player-name {
        font-size: 0.75em;
        padding: 4px 8px;
    }

    .player-points {
        font-size: 0.75em;
        padding: 3px 8px;
    }

    .bench-players {
        gap: 10px;
    }
}
/* Chart Styles */
.chart-container {
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.chart-container:hover {
    border-color: #00cc6a;
    box-shadow: 0 6px 12px rgba(0, 204, 106, 0.2);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.chart-header h2 {
    margin: 0;
    color: #37003c;
    font-size: 1.3em;
}

.fullscreen-btn {
    background: linear-gradient(135deg, #00cc6a 0%, #04f5ff 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2em;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.fullscreen-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 204, 106, 0.3);
}

.fullscreen-btn:active {
    transform: scale(0.95);
}

.chart-wrapper {
    position: relative;
    height: 400px;
    width: 100%;
    touch-action: pan-x pan-y;
}

.zoom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #f0f0f0;
}

.zoom-btn {
    background: #37003c;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.zoom-btn:hover {
    background: #00cc6a;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 204, 106, 0.3);
}

.zoom-hint {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

/* Fullscreen mode styles */
.chart-container.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    background: #fff;
    padding: 30px;
    overflow: auto;
}

.chart-container.fullscreen-mode .chart-wrapper {
    height: calc(100vh - 200px);
}

.chart-container.fullscreen-mode .chart-header h2 {
    font-size: 2em;
}

.chart-container.fullscreen-mode .fullscreen-btn {
    font-size: 1.5em;
    padding: 12px 24px;
}

.chart-container.fullscreen-mode .zoom-controls {
    font-size: 1.2em;
}

.chart-container.fullscreen-mode .zoom-btn {
    font-size: 1.1em;
    padding: 12px 30px;
}

/* Mobile optimizations for charts */
@media (max-width: 768px) {
    .chart-wrapper {
        height: 350px;
    }
    
    .chart-header h2 {
        font-size: 1.1em;
    }
    
    .fullscreen-btn {
        padding: 6px 12px;
        font-size: 1em;
    }
    
    .zoom-hint {
        font-size: 0.8em;
    }
    
    .chart-container.fullscreen-mode {
        padding: 15px;
    }
    
    .chart-container.fullscreen-mode .chart-wrapper {
        height: calc(100vh - 180px);
    }
}

@media (max-width: 480px) {
    .chart-wrapper {
        height: 300px;
    }
    
    .zoom-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .zoom-btn {
        width: 100%;
    }
    
    .zoom-hint {
        text-align: center;
    }
}
