body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #000;
    font-family: 'Poppins', sans-serif; /* Apply modern font */
}

#game-container {
    display: none;
    position: relative;
    width: 100%;
    height: 100vh;
}

canvas {
    display: block;
}

#loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-family: Arial, sans-serif;
    font-size: 20px;
    z-index: 20;
}

/* === Team Selection Screen - Modern Theme === */
#team-selection-screen {
    /* Keep existing position/layout properties */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
    /* Apply Modern Theme Background & Font */
    background-color: #08081B; /* Match player select background */
    color: #e0e0e0;
    font-family: 'Poppins', sans-serif; /* Use modern font */
}

#team-selection-screen h1 {
    /* Modern Title Style */
    color: #fff;
    font-size: 2.2em; /* Slightly larger than player select */
    margin-bottom: 30px;
    text-align: center;
    font-weight: 600;
    text-shadow: none; /* Remove retro shadow */
}

#team-selection-content {
    /* Modern Panel Style */
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    width: 90%;
    max-width: 1000px; /* Adjusted max width */
    background-color: #1a1b2e; /* Panel background */
    padding: 30px;
    border: 1px solid #2a2c41; /* Panel border */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); /* Subtle modern shadow */
    gap: 30px;
}

.team-selector {
    /* Keep flex layout */
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1; /* Take equal space */
}

.team-selector h2 {
    /* Modern Subtitle Style */
    margin-bottom: 20px;
    font-size: 1.4em;
    font-weight: 600;
    color: #a0a0c0; /* Lighter accent color */
    text-shadow: none;
}

.team-cards {
    /* Modern Grid for Cards */
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); /* Responsive grid */
    gap: 15px;
    width: 100%;
    max-height: 450px; /* Adjust height as needed */
    overflow-y: auto;
    padding: 10px;
    background-color: rgba(8, 8, 27, 0.5); /* Darker transparent background */
    border-radius: 6px;
    border: 1px solid #2a2c41; /* Subtle border */
}

/* Custom scrollbar for team cards */
.team-cards::-webkit-scrollbar {
    width: 6px;
}
.team-cards::-webkit-scrollbar-track {
    background: rgba(8, 8, 27, 0.5);
    border-radius: 3px;
}
.team-cards::-webkit-scrollbar-thumb {
    background-color: #2a2c41;
    border-radius: 3px;
}
.team-cards::-webkit-scrollbar-thumb:hover {
    background-color: #3c3e5e;
}

.team-card {
    /* Modern Card Style */
    padding: 15px;
    border: 1px solid #2a2c41;
    border-radius: 6px;
    background-color: #08081B; /* Dark background */
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
    color: #ccc;
    font-size: 0.9rem;
    position: relative; 
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.team-card.selected {
    /* Modern Selected State */
    border-color: #1FF8FA; /* Cyan border */
    background-color: #2a2c41; /* Highlight background */
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(31, 248, 250, 0.4); /* Cyan glow */
    color: #fff;
}

.team-card:hover {
    /* Modern Hover State */
    background-color: #2a2c41;
    border-color: #4a4c6b;
    transform: translateY(-1px);
}

.team-name {
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 5px;
    color: #fff; /* White name */
}

.team-short-name {
    font-size: 0.85em;
    color: #a0a0c0;
    margin-bottom: 10px;
}

.team-colors {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px; /* Increased spacing */
}

.color-swatch {
    width: 22px; /* Slightly larger */
    height: 22px;
    border: 1px solid #555;
    border-radius: 4px; /* Rounded corners */
}

.team-formation {
    font-size: 0.8em;
    color: #888;
    margin-top: 8px;
}

#start-match-button {
    /* Match player select start button style */
    margin-top: 30px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #1FF8FA, #026BDA); /* Cyan/Blue gradient */
    color: #fff;
    border: none;
    border-radius: 30px; /* Pill shape */
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: none;
    box-shadow: 0 4px 10px rgba(0, 217, 255, 0.2);
}

#start-match-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 217, 255, 0.3);
    background: linear-gradient(135deg, #3afffd, #1d85f5); /* Slightly lighter gradient */
}

#start-match-button:disabled {
    /* Modern Disabled State */
    background: linear-gradient(135deg, #555, #333); /* Grey gradient */
    color: #888;
    cursor: not-allowed;
    opacity: 0.6;
    box-shadow: none;
    transform: none;
}

/* --- Team Selection Screen Specific Mobile Styles --- */
@media (max-width: 768px) {
    #team-selection-screen {
        padding: 15px; 
        justify-content: flex-start; /* Align top */
         overflow-y: auto; 
    }

    #team-selection-screen h1 {
         font-size: 1.8em; 
         margin-bottom: 20px;
    }

    #team-selection-content {
        flex-direction: column; 
        width: 100%;
        max-width: 100%; 
        padding: 15px;
        gap: 20px; 
    }

    .team-selector {
        width: 100%; 
    }

    .team-selector h2 {
        font-size: 1.2em; 
    }

    .team-cards {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); /* Adjust for mobile */
        gap: 10px; 
        max-height: 300px; /* Adjust height */
         padding: 8px;
    }

    .team-card {
        padding: 10px; 
        font-size: 0.85rem;
    }
    .team-name { font-size: 1em; }
    .color-swatch { width: 18px; height: 18px; }

    #start-match-button {
        width: 80%; 
        max-width: 300px;
        padding: 14px;
        font-size: 1.1em;
        margin-top: 25px;
        margin-bottom: 20px;
        position: relative; /* Remove sticky for simplicity if scroll handled by screen */
        bottom: auto;
    }
}

 /* Further adjustments for very small screens */
 @media (max-width: 480px) {
      #team-selection-screen h1 { font-size: 1.6em; }
      .team-cards {
          grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); /* Smaller cards */
          gap: 8px;
      }
      .team-card { font-size: 0.8rem; }
      #start-match-button { font-size: 1em; padding: 12px; }
 }

/* === Player Selection Screen - Modern Theme === */
#player-selection-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    width: 100%;
    height: 100vh; 
    overflow-y: auto; /* Enable vertical scrolling if needed */
    background-color: #0F101C; /* Darker Navy/Purple Background */
    color: #e0e0e0;
    box-sizing: border-box;
}

#player-selection-screen h1 {
    color: #fff;
    font-size: 1.8em; /* Slightly smaller */
    margin-bottom: 15px; /* Reduced margin */
    text-align: center;
    font-weight: 600;
    text-shadow: none; /* Remove retro shadow */
    flex-shrink: 0; /* Prevent title from shrinking */
}

#player-selection-content {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(320px, 2fr) minmax(260px, 1.1fr); /* Adjusted column proportions */
    grid-template-rows: auto 1fr; /* Header Row, Main Content Row */
    grid-template-areas:
        "team-info        team-info       team-info"
        "player-list      pitch-view      details-reserves"; /* Combined details & reserves */
    gap: 15px;
    width: 100%;
    max-width: 1200px; /* Increased max width */
    padding: 15px;
    box-sizing: border-box;
    background-color: rgba(16, 17, 42, 0.6); /* #10112a Slightly transparent */
    border: 1px solid #2a2c41; /* Match panel border */
    border-radius: 10px; /* Slightly more rounded */
    flex-grow: 1; 
    margin-bottom: 15px;
    min-height: 580px; /* Increased min height */
    backdrop-filter: blur(3px);
}

/* Base Panel Style */
.panel {
    background-color: #1A1B2E; /* Existing panel variant */
    border: 1px solid #2a2c41;
    border-radius: 8px;
    padding: 15px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
    display: flex; 
    flex-direction: column;
    overflow: hidden; 
}

.team-info {
    grid-area: team-info;
    display: flex;
    /* justify-content: space-between; */ /* Let items space naturally */
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 10px; /* Reduced margin */
    background-color: transparent; /* Make header transparent */
    border: none;
    border-bottom: 1px solid #2a2c41; /* Add bottom border */
    border-radius: 0;
    gap: 20px; /* Add gap between elements */
}

#team-name {
    font-size: 1.3rem; /* Slightly larger */
    font-weight: 600;
    color: #fff;
    text-shadow: none;
}

.formation-selector label,
.setting-item label { /* Style both labels */
    color: #a0a0c0; /* Lighter grey/blue */
    font-size: 0.85rem;
    margin-right: 8px;
    font-weight: 500;
}

#formation-select,
#defensive-line-select { /* Style both selects */
    padding: 6px 10px;
    background-color: #0F101C; /* Match overall background */
    color: #fff;
    border: 1px solid #2a2c41;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    -webkit-appearance: none; /* Remove default dropdown arrow */
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23a0a0c0" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 30px; /* Make space for arrow */
    min-width: 120px; /* Ensure width */
}

/* Player List Styling */
.player-list-container {
    grid-area: player-list;
    /* Inherits .panel styles */
}

/* NEW Combined Column for Details & Reserves */
.details-reserves-column {
    grid-area: details-reserves;
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between details and reserves */
    overflow: hidden; /* Keep on parent */
}

.reserves-container {
   /* No longer needs grid-area */
    flex-grow: 1; /* Allow reserves to take remaining space */
    min-height: 100px; /* Reduced min-height slightly */
    /* Inherits .panel styles */
    display: flex; /* Use flex here too */
    flex-direction: column; /* Stack title and list */
    overflow: hidden; /* Hide overflow on container */
}

.squad-section-title,
.reserves-section-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #a0a0c0;
    margin: -15px -15px 10px -15px; /* Adjusted to fit panel padding */
    padding: 8px 15px;
    border-bottom: 1px solid #2a2c41;
    background-color: #10112a;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    text-align: left;
    text-shadow: none;
    flex-shrink: 0; /* Prevent title from shrinking */
}

/* Lists styling remains similar, slight background change */
.player-list,
.reserves-list {
    list-style: none;
    padding: 0 5px 0 0; /* Add padding for scrollbar */
    margin: 0;
    overflow-y: auto; /* Enable scroll */
    flex-grow: 1; /* Let the list itself grow */
}

/* List item styling */
.player-list-item {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, border-left-color 0.2s ease;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    font-size: 0.85rem;
    background-color: rgba(8, 8, 27, 0.5); /* Darker item background */
}

.player-list-item:hover {
    background-color: #2a2c41; /* Panel border color on hover */
    border-left-color: #4a4c6b;
}

.player-list-item.selected {
    background-color: rgba(31, 248, 250, 0.15); /* Cyan highlight */
    border-left-color: #1FF8FA;
    color: #fff;
}

/* Player Number/Name/Role Tag styling mostly unchanged */
.player-number {
    color: #a0a0c0;
    font-size: 0.8rem;
    width: 25px;
    text-align: right;
    margin-right: 10px;
    font-weight: 600;
}

.player-name {
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
    font-weight: 400;
}

.role-tag {
    font-size: 0.7rem;
    padding: 3px 6px;
    border-radius: 4px;
    margin-left: auto;
    color: #fff;
    text-shadow: none;
    min-width: 30px;
    text-align: center;
    flex-shrink: 0;
    font-weight: 600;
    border: 1px solid rgba(255,255,255,0.1);
}

/* --- Pitch View Styling --- */
.pitch-view {
    grid-area: pitch-view;
    align-self: stretch; 
    background-color: #144014; /* Darker green */
    border: 1px solid #333; /* Darker border */
    border-radius: 8px; /* Match panels */
    position: relative;
    margin: 0;
    padding: 15px 5px; /* Increased vertical padding */
    overflow: hidden; 
    display: flex; 
    justify-content: center;
    align-items: center; /* Keep centered */
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    min-height: 350px; 
}

.formation-display {
    width: 95%; /* Slightly larger */
    aspect-ratio: 68 / 105;
    max-height: 100%;
    position: relative;
    background-color: #228822; /* Standard grass green */
    /* REMOVED background-image properties for lines */
    border: 1px solid rgba(255,255,255,0.2); /* Lighter line for pitch border */
    border-radius: 4px;
}

/* --- NEW Player Marker Styling --- */
.player-marker {
    position: absolute;
    display: flex;
    flex-direction: column; /* Stack circle and text */
    align-items: center;
    cursor: pointer;
    transform: translate(-50%, -50%); 
    transform-origin: center; 
    z-index: 5; 
    transition: transform 0.2s ease, filter 0.2s ease;
    width: 40px; /* Base width for container */
    height: auto;
}

.marker-circle {
    width: 24px; /* Size of the circle */
    height: 24px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.7); /* White border */
    background-color: #ff0000; /* Default/fallback color - WILL BE OVERRIDDEN by JS */
    margin-bottom: 4px; /* Space between circle and text */
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: border-color 0.2s ease;
    position: relative; /* For positioning instruction icons */
}

/* Tactical instruction indicators */
.instruction-indicator {
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    top: -7px;
    right: -7px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    z-index: 6;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

/* Specific instruction indicator styles */
.instruction-stay-wide::after {
    content: "↔";
    color: #3498db; /* blue */
}

.instruction-cut-inside-left::after {
    content: "↘";
    color: #e74c3c; /* red */
}

.instruction-cut-inside-right::after {
    content: "↙";
    color: #e74c3c; /* red */
}

.instruction-get-in-behind::after {
    content: "⇡";
    color: #f39c12; /* orange */
}

.instruction-come-short::after {
    content: "⇣";
    color: #2ecc71; /* green */
}

/* Removing Stay Back indicators */
.instruction-stay-back {
    display: none;
}

.instruction-support-attack::after {
    content: "↑";
    color: #1abc9c; /* teal */
}

/* Animation for instruction indicators */
@keyframes pulse {
    0% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.9; }
}

.instruction-indicator {
    animation: pulse 1.5s infinite;
}

.marker-text-content {
    display: flex;
    flex-direction: column; /* Stack name and info */
    align-items: center;
    text-align: center;
}

.marker-player-name {
    font-size: 9px;
    font-weight: 600;
    color: #fff; 
    background-color: rgba(0, 0, 0, 0.6); /* Dark background for name */
    padding: 1px 4px;
    border-radius: 3px;
    white-space: nowrap;
    max-width: 55px; /* Increased from 45px */
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.marker-info {
    display: flex;
    align-items: center;
    gap: 3px; /* Reduced gap */
    font-size: 8px;
    color: #eee;
    background-color: rgba(0,0,0,0.4); /* Lighter background for info */
    padding: 0px 3px;
    border-radius: 3px;
}

.marker-role { 
    font-size: 7px; 
    font-weight: bold; 
    padding: 1px 3px; /* Padding for role tag */
    border-radius: 2px;
    color: #000; /* Black text for better contrast on colored bg */
}
.marker-rating { 
    font-size: 7px; 
    color: #fff; /* White rating */
    font-weight: bold;
} 

.player-marker:hover {
    transform: translate(-50%, -50%) scale(1.15); 
    z-index: 10;
    filter: brightness(1.15);
}

.player-marker.selected .marker-circle {
    border-color: #1FF8FA; /* Cyan border for selected */
    box-shadow: 0 0 8px rgba(31, 248, 250, 0.7); /* Cyan glow */
}

/* --- Player Details Panel - Refined --- */
.player-details {
   /* No longer needs grid-area */
    min-height: 180px; 
    flex-shrink: 0; /* Prevent shrinking */
    flex-grow: 0; /* Don't let details panel grow excessively */
    /* Inherits .panel styles */
}

#player-name { /* Title bar style */
    margin: -15px -15px 15px -15px; 
    padding: 10px 15px;
    border-bottom: 1px solid #2a2c41;
    background-color: #10112a;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-align: center;
}

/* Stats Grid Styling - Keep as is, it's modern */
.stats-modern-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 12px 15px; /* Row gap, Column gap */
    margin-bottom: 15px; 
    flex-grow: 1; 
    overflow-y: auto; /* Allow scrolling if needed */
    padding-right: 5px; /* Space for scrollbar */
}

.stat-modern-item { 
    background-color: rgba(26, 27, 46, 0.6); /* Slightly transparent item background */
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid #2a2c41;
}

.stat-modern-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 5px;
}

.stat-modern-label {
    font-size: 0.75rem;
    color: #a0a0c0; /* Lighter grey/blue */
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-modern-value {
    font-size: 0.9rem;
    color: #fff;
    font-weight: 600;
}

.stat-modern-bar-container {
    height: 6px; /* Slimmer bar */
    background-color: rgba(8, 8, 27, 0.8); /* Darker background */
    border-radius: 3px;
    overflow: hidden;
}

.stat-modern-bar-value {
    height: 100%;
    border-radius: 3px;
    width: 0%; /* Set by JS */
    transition: width 0.5s ease-out;
    /* Default color, will be overridden by attribute selector */
    background-color: #ff003d; /* Default Red */
}

/* Color bars based on data-value (ScoutingStats style) */
.stat-modern-bar-value[data-value^="0"],
.stat-modern-bar-value[data-value^="1"],
.stat-modern-bar-value[data-value^="2"],
.stat-modern-bar-value[data-value^="3"] {
    background: linear-gradient(90deg, #ff003d, #ff4d6b); /* Red gradient */
}
.stat-modern-bar-value[data-value^="4"],
.stat-modern-bar-value[data-value^="5"] {
    background: linear-gradient(90deg, #ff9100, #ffb040); /* Orange gradient */
}
.stat-modern-bar-value[data-value^="6"],
.stat-modern-bar-value[data-value^="7"] {
    background: linear-gradient(90deg, #ffd60a, #ffec5c); /* Yellow gradient */
}
.stat-modern-bar-value[data-value^="8"],
.stat-modern-bar-value[data-value^="9"],
.stat-modern-bar-value[data-value="100"] {
    background: linear-gradient(90deg, #00ce8a, #00f5a0); /* Green gradient */
}

/* Remove old stat selectors */
.stats-grid,
.stat-item,
.stat-label,
.stat-bar-container,
.stat-bar-value,
.stat-value-text {
    display: none; /* Hide old elements */
}

/* Tactical Instruction - Sleeker Styling */
.tactical-instruction-selector {
    margin-top: 15px; 
    padding-top: 15px;
    border-top: 1px solid #2a2c41; 
    display: flex;
    align-items: center;
    gap: 10px;
}
.tactical-instruction-selector label {
    color: #a0a0c0; 
    font-size: 0.85rem;
    font-weight: 500; /* Adjusted weight */
    flex-shrink: 0; /* Prevent label shrinking */
}

#tactical-instruction-select {
    /* NEW Sleek Styling */
    padding: 8px 12px;
    background-color: #1A1B2E; /* Match panel bg */
    color: #e0e0e0;
    border: 1px solid #3c3e5e; /* Slightly lighter border */
    border-radius: 5px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    flex-grow: 1; 
    /* Minimal appearance */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="%23676a89" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>'); /* Subtle arrow */
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 35px; /* Space for arrow */
    cursor: pointer;
    transition: border-color 0.2s ease;
}
#tactical-instruction-select:hover {
    border-color: #676a89;
}
#tactical-instruction-select:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #2a2c41;
}

/* Swap Button - Keep modern */
.player-swap-controls {
    margin-top: 15px; /* Consistent spacing */ 
    padding-top: 15px;
    border-top: 1px solid #2a2c41; 
    flex-shrink: 0; /* Prevent shrinking */
}
.swap-button {
    display: block; /* Make it block */
    width: 100%; /* Full width */
    padding: 10px;
    background: #2a2c41;
    color: #a0a0c0;
    border: 1px solid #3c3e5e;
    border-radius: 6px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.swap-button:hover:not(:disabled) { background: #3c3e5e; color: #fff; }
.swap-button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Start Game Button - Adjustments */
#start-game-button {
    margin-top: 20px; 
    margin-bottom: 10px; /* Reduced bottom margin */
    padding: 12px 35px; /* Adjusted padding */
    background: linear-gradient(135deg, #1FF8FA, #026BDA);
    color: #fff;
    border: none;
    border-radius: 30px; /* Pill shape */
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: none;
    align-self: center; 
    width: fit-content;
    box-shadow: 0 4px 10px rgba(0, 217, 255, 0.2);
    flex-shrink: 0; /* Prevent button from shrinking */
}

#start-game-button:hover { /* Keep hover */ }
#start-game-button:active { /* Keep active */ }

/* --- Role Tag Colors (Keep or adjust) --- */
.role-gk { background-color: #e67e22; } /* Orange */
.role-def { background-color: #3498db; } /* Blue */
.role-mid { background-color: #2ecc71; } /* Green */
.role-fwd { background-color: #e74c3c; } /* Red */
.role-default { background-color: #95a5a6; } /* Grey */


/* --- Responsive Overrides - Simplify --- */
@media (max-width: 1024px) {
   #player-selection-content {
        max-width: 95%;
        grid-template-columns: 1fr 1.8fr 1.2fr; /* Adjust proportions slightly */
   }
   .player-marker { width: 36px; } /* Slightly smaller markers */
   .marker-circle { width: 20px; height: 20px; } 
   .marker-player-name { font-size: 8px; } 
}

@media (max-width: 768px) {
    #player-selection-screen {
        overflow-y: auto; 
        padding: 10px;
    }
    #player-selection-content {
        display: flex; /* Stack on mobile */
        flex-direction: column;
        grid-template-columns: none; 
        grid-template-rows: none; 
        grid-template-areas: none; 
        max-width: 98%;
        padding: 10px;
        gap: 10px; 
        min-height: unset; 
        flex-grow: 0; 
    }
    
    /* Ensure all sections are visible and ordered */
    .team-info { order: 1; margin-bottom: 10px; } 
    .player-details { order: 2; min-height: unset; }
    .details-reserves-column { order: 3; gap: 10px; } /* Order combined column */
    .reserves-container { order: 4; min-height: unset; }
    .player-list-container { order: 5; min-height: unset; }
    .pitch-view { display: none; } /* Hide pitch on mobile */

    .player-list, .reserves-list {
        max-height: 180px; /* Adjust height */
        height: auto; 
    }

    #start-game-button {
        width: 90%;
        max-width: 300px;
        padding: 14px;
        font-size: 1.1em;
        margin-top: 15px;
        margin-bottom: 15px;
    }
}

/* ... (Keep existing team selection styles) ... */