/* 
 * FootballFrenzy Pro - Modern CSS Styles
 * Comprehensive styling for the 11v11 Football Simulator
 */

 :root {
    /* Primary colors */
    --primary-color: #38b6ff;
    --primary-dark: #1d4ed8;
    --primary-light: #7dd3fc;
    
    /* Secondary colors */
    --secondary-color: #10b981;
    --secondary-dark: #059669;
    --secondary-light: #4ade80;
    
    /* UI colors */
    --dark-color: #1e293b;
    --light-color: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    
    /* Team colors */
    --team1-color: #3b82f6;
    --team2-color: #ef4444;
    
    /* Focus/action colors */
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    /* Typography */
    --font-primary: 'Montserrat', sans-serif;
    --font-heading: 'Oswald', sans-serif;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Border radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
}

/* Basic Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

html, body {
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    font-size: 16px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--space-md);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-dark);
}

/* Layout Containers */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: var(--space-md);
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Header */
.main-header {
    background-color: var(--primary-color);
    color: white;
    padding: var(--space-md) var(--space-lg);
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo-container {
    display: flex;
    flex-direction: column;
}

.logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--secondary-light);
}

.tagline {
    font-size: 0.9rem;
    margin: 0;
}

.main-nav {
    display: flex;
    gap: var(--space-sm);
}

.nav-btn {
    background: none;
    border: none;
    color: white;
    font-weight: 600;
    padding: var(--space-sm) var(--space-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-btn::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 3px;
    background-color: white;
    transform: scaleX(0);
    transition: transform var(--transition-fast);
}

.nav-btn:hover::after,
.nav-btn.active::after {
    transform: scaleX(1);
}

/* Homepage Main Sections */
.section-home,
.section-settings,
.section-stats,
.section-help {
    display: none;
}

.section-home.active,
.section-settings.active,
.section-stats.active,
.section-help.active {
    display: block;
}

/* Hero Section */
.hero-section {
    height: 350px;
    background-color: var(--gray-800);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.hero-text {
    position: relative;
    z-index: 2;
    color: white;
    max-width: 500px;
    padding: var(--space-xl);
}

.hero-text h1 {
    font-size: 2.5rem;
    margin-bottom: var(--space-md);
}

.hero-text p {
    font-size: 1.1rem;
    opacity: 0.9;
}

.hero-image {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 60%;
    background-image: url('https://source.unsplash.com/random/1200x800/?football,soccer');
    background-size: cover;
    background-position: center;
}

.hero-image-overlay {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--gray-800) 0%, rgba(30, 41, 59, 0.7) 50%, rgba(30, 41, 59, 0.2) 100%);
}

/* Game Modes Section */
.game-modes {
    margin-bottom: var(--space-2xl);
}

.game-modes h2 {
    text-align: center;
    margin-bottom: var(--space-xl);
    position: relative;
}

.game-modes h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: var(--radius-full);
}

.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.mode-card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    cursor: pointer;
}

.mode-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.mode-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    background-color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
}

.mode-icon svg {
    width: 30px;
    height: 30px;
    color: white;
}

.mode-card h3 {
    font-size: 1.3rem;
    margin-bottom: var(--space-sm);
}

.mode-card p {
    color: var(--gray-500);
    margin-bottom: var(--space-lg);
    font-size: 0.9rem;
}

/* Advertiser Section */
.advertiser-section {
    background-color: var(--gray-100);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xl);
    margin-bottom: var(--space-2xl);
}

.advertiser-info {
    flex: 1;
    min-width: 300px;
}

.advertiser-preview {
    flex: 1;
    min-width: 300px;
    max-width: 500px;
}

.field-preview {
    background-color: var(--secondary-light);
    border-radius: var(--radius-md);
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.field-preview::after {
    content: '';
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.ad-spot {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.1);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-spot::before {
    content: 'Ad Space';
}

.ad-spot-top {
    top: 5%;
    left: 20%;
    width: 60%;
    height: 8%;
}

.ad-spot-right {
    top: 40%;
    right: 5%;
    width: 4%;
    height: 20%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

.ad-spot-bottom {
    bottom: 5%;
    left: 20%;
    width: 60%;
    height: 8%;
}

.ad-spot-left {
    top: 40%;
    left: 5%;
    width: 4%;
    height: 20%;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* Buttons */
.primary-btn,
.secondary-btn {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    text-align: center;
    display: inline-block;
}

.primary-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
}

.primary-btn:hover {
    background-color: var(--primary-dark);
}

.secondary-btn {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.secondary-btn:hover {
    background-color: var(--gray-100);
}

/* Settings Section */
.settings-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-xl);
}

.settings-group {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.settings-group h3 {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--gray-200);
}

.setting-item {
    margin-bottom: var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-item label {
    font-weight: 500;
    color: var(--gray-700);
}

.setting-control {
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
}

.setting-control select,
.setting-control input[type="range"] {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
}

.setting-control input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary-color);
}

.setting-value {
    margin-left: var(--space-sm);
    font-weight: 600;
    min-width: 40px;
    text-align: right;
}

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--gray-500);
    width: 100%;
    margin-top: var(--space-xs);
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    margin-top: var(--space-xl);
}

/* Stats Section */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stats-charts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.chart-container {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.chart-container h3 {
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
}

.chart-placeholder {
    width: 100%;
    height: 200px;
    background-color: var(--gray-100);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
}

.recent-matches {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
}

.recent-matches h3 {
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
}

.match-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.match-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--gray-200);
}

.match-date {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.match-result {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 500;
}

.match-result.win {
    color: var(--success);
}

.match-result.loss {
    color: var(--danger);
}

.match-result.draw {
    color: var(--warning);
}

.score {
    font-weight: 700;
    padding: 0 var(--space-sm);
}

.team-name {
    font-size: 0.9rem;
}

/* Help Section */
.help-container {
    display: flex;
    gap: var(--space-xl);
    margin-top: var(--space-lg);
}

.help-sidebar {
    width: 200px;
    flex-shrink: 0;
}

.help-nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    position: sticky;
    top: var(--space-xl);
}

.help-nav-btn {
    text-align: left;
    padding: var(--space-sm);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 500;
}

.help-nav-btn:hover {
    background-color: var(--gray-100);
}

.help-nav-btn.active {
    background-color: var(--primary-color);
    color: white;
}

.help-content {
    flex: 1;
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    box-shadow: var(--shadow-sm);
}

.help-section {
    display: none;
}

.help-section.active {
    display: block;
}

.help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.help-item {
    background-color: var(--gray-100);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.key-combo {
    display: flex;
    gap: var(--space-xs);
}

.key {
    background-color: var(--gray-200);
    color: var(--gray-800);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 24px;
    text-align: center;
    box-shadow: 0 2px 0 var(--gray-300);
}

.key-description {
    font-size: 0.9rem;
    color: var(--gray-700);
    text-align: center;
}

.tactic-box {
    background-color: var(--gray-100);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.tactic-box h4 {
    margin-bottom: var(--space-sm);
    color: var(--primary-dark);
}

.tactic-box p {
    font-size: 0.9rem;
    margin-bottom: 0;
}

/* Game Container */
.game-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--gray-900);
    padding: var(--space-md);
}

.field-container {
    margin: 0 auto;
    background-color: var(--secondary-color);
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 1200px;
    aspect-ratio: 16 / 9;
    background-image: linear-gradient(var(--secondary-light), var(--secondary-color));
}

/* Field markings */
.field-marking {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-sm);
    pointer-events: none;
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20%;
    height: 30%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    pointer-events: none;
}

.center-line {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.penalty-area {
    position: absolute;
    width: 20%;
    height: 40%;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.penalty-area-left {
    left: 5%;
}

.penalty-area-right {
    right: 5%;
}

.goal {
    position: absolute;
    width: 2%;
    height: 20%;
    background-color: var(--light-color);
    border: 2px solid var(--dark-color);
    z-index: 4;
    pointer-events: none;
}

.goal-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.goal-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.pitch-texture {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(0deg, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
    pointer-events: none;
}

.pitch-grain {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0.05;
    pointer-events: none;
    z-index: 2;
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAAUVBMVEWFhYWDg4N3d3dtbW17e3t1dXWBgYGHh4d5eXlzc3OLi4ubm5uVlZWPj4+NjY19fX2JiYl/f39ra2uRkZGZmZlpaWmXl5dvb29xcXGTk5NnZ2c8TV1mAAAAG3RSTlNAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAvEOwtAAAFVklEQVR4XpWWB67c2BUFb3g557T/hRo9/WUMZHlgr4Bg8Z4qQgQJlHI4A8SzFVrapvmTF9O7dmYRFZ60YiBhJRCgh1FYhiLAmdvX0CzTOpNE77ME0Zty/nWWzchDtiqrmQDeuv3powQ5ta2eN0FY0InkqDD73lT9c9lEzwUNqgFHs9VQce3TVClFCQrSTfOiYkVJQBmpbq2L6iZavPnAPcoU0dSw0SUTqz/GtrGuXfbyyBniKykOWQWGqwwMA7QiYAxi+IlPdqo+hYHnUt5ZPfnsHJyNiDtnpJyayNBkF6cWoYGAMY92U2hXHF/C1M8uP/ZtYdiuj26UdAdQQSXQErwSOMzt/XWRWAz5GuSBIkwG1H3FabJ2OsUOUhGC6tK4EMtJO0ttC6IBD3kM0ve0tJwMdSfjZo+EEISaeTr9P3wYrGjXqyC1krcKdhMpxEnt5JetoulscpyzhXN5FRpuPHvbeQaKxFAEB6EN+cYN6xD7RYGpXpNndMmZgM5Dcs3YSNFDHUo2LGfZuukSWyUYirJAdYbF3MfqEKmjM+I2EfhA94iG3L7uKrR+GdWD73ydlIB+6hgref1QTlmgmbM3/LeX5GI1Ux1RWpgxpLuZ2+I+IjzZ8wqE4nilvQdkUdfhzI5QDWy+kw5Wgg2pGpeEVeCCA7b85BO3F9DzxB3cdqvBzWcmzbyMiqhzuYqtHRVG2y4x+KOlnyqla8AoWWpuBoYRxzXrfKuILl6SfiWCbjxoZJUaCBj1CjH7GIaDbc9kqBY3W/Rgjda1iqQcOJu2WW+76pZC9QG7M00dffe9hNnseupFL53r8F7YHSwJWUKP2q+k7RdsxyOB11n0xtOvnW4irMMFNV4H0uqwS5ExsmP9AxbDTc9JwgneAT5vTiUSm1E7BSflSt3bfa1tv8Di3R8n3Af7MNWzs49hmauE2wP+ttrq+AsWpFG2awvsuOqbipWHgtuvuaAE+A1Z/7gC9hesnr+7wqCwG8c5yAg3AL1fm8T9AZtp/bbJGwl1pNrE7RuOX7PeMRUERVaPpEs+yqeoSmuOlokqw49pgomjLeh7icHNlG19yjs6XXOMedYm5xH2YxpV2tc0Ro2jJfxC50ApuxGob7lMsxfTbeUv07TyYxpeLucEH1gNd4IKH2LAg5TdVhlCafZvpskfncCfx8pOhJzd76bJWeYFnFciwcYfubRc12Ip/ppIhA1/mSZ/RxjFDrJC5xifFjJpY2Xl5zXdguFqYyTR1zSp1Y9p+tktDYYSNflcxI0iyO4TPBdlRcpeqjK/piF5bklq77VSEaA+z8qmJTFzIWiitbnzR794USKBUaT0NTEsVjZqLaFVqJoPN9ODG70IPbfBHKK+/q/AWR0tJzYHRULOa4MP+W/HfGadZUbfw177G7j/OGbIs8TahLyynl4X4RinF793Oz+BU0saXtUHrVBFT/DnA3ctNPoGbs4hRIjTok8i+algT1lTHi4SxFvONKNrgQFAq2/gFnWMXgwffgYMJpiKYkmW3tTg3ZQ9Jq+f8XN+A5eeUKHWvJWJ2sgJ1Sop+wwhqFVijqWaJhwtD8MNlSBeWNNWTa5Z5kPZw5+LbVT99wqTdx29lMUH4OIG/D86ruKEauBjvH5xy6um/Sfj7ei6UUVk4AIl3MyD4MSSTOFgSwsH/QJWaQ5as7ZcmgBZkzjjU1UrQ74ci1gWBCSGHtuV1H2mhSnO3Wp/3fEV5a+4wz//6qy8JxjZsmxxy5+4w9CDNJY09T072iKG0EnOS0arEYgXqYnXcYHwjTtUNAcMelOd4xpkoqiTYICWFq0JSiPfPDQdnt+4/wuqcXY47QILbgAAAABJRU5ErkJggg==');
}

/* New UI Components */

/* Minimap */
.minimap {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 150px;
    height: 100px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-md);
    z-index: 50;
    padding: 5px;
}

.minimap-field {
    width: 100%;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
}

/* Match clock */
.match-clock {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: var(--radius-md);
    padding: 5px 10px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.match-half {
    font-size: 0.7rem;
    font-weight: 500;
    opacity: 0.7;
}

.match-time {
    font-weight: 700;
    font-size: 1.1rem;
}

/* Commentary box */
.commentary-box {
    position: absolute;
    bottom: 10px;
    left: 10px;
    width: 300px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: var(--radius-md);
    padding: 10px;
    z-index: 50;
    font-size: 0.9rem;
}

.commentary-content {
    max-height: 80px;
    overflow-y: auto;
}

/* Active player info */
.active-player-info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: var(--radius-md);
    padding: 5px 10px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 200px;
}

.active-player-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 3px;
}

.active-player-stamina {
    width: 100%;
}

.stamina-bar {
    height: 5px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stamina-fill {
    height: 100%;
    background-color: var(--success);
    width: 100%;
    transition: width 0.3s ease;
}

/* Weather overlays */
.weather-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
    display: none;
}

#rainOverlay {
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+P+/HgAEDQIEXKy1EwAAAABJRU5ErkJggg==');
    opacity: 0.3;
}

#snowOverlay {
    background-image: radial-gradient(circle, white 1px, transparent 1px);
    background-size: 15px 15px;
    animation: snowfall 10s linear infinite;
    opacity: 0.7;
}

#fogOverlay {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(3px);
}

@keyframes snowfall {
    0% { background-position: 0 0; }
    100% { background-position: 15px 100px; }
}

/* Substitution button */
.game-action-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: rgba(0, 0, 0, 0.6);
    border: none;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 50;
    transition: all var(--transition-fast);
}

.game-action-btn:hover {
    background-color: var(--primary-color);
}

.game-action-btn svg {
    width: 20px;
    height: 20px;
}

/* Match controls */
.match-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background-color: var(--gray-800);
    margin-top: var(--space-md);
    border-radius: var(--radius-lg);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.control-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-btn:hover {
    background-color: var(--primary-dark);
}

.scoreboard {
    display: flex;
    align-items: center;
    background-color: var(--gray-700);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 1.2rem;
}

.team-score {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.team-indicator {
    width: 12px;
    height: 12px;
    border-radius: var(--radius-full);
}

.team1-indicator {
    background-color: var(--team1-color);
}

.team2-indicator {
    background-color: var(--team2-color);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: var(--space-md) var(--space-lg);
    background-color: var(--primary-color);
    color: white;
    border-top-left-radius: var(--radius-lg);
    border-top-right-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close-btn {
    font-size: 1.5rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    line-height: 1;
}

.modal-body {
    padding: var(--space-lg);
    flex: 1;
    overflow-y: auto;
}

.modal-footer {
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--gray-200);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
}

/* Setup tabs */
.setup-tabs {
    display: flex;
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--gray-200);
}

.setup-tab {
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-500);
}

.setup-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.setup-content {
    display: none;
}

.setup-content.active {
    display: block;
}

/* Form elements */
.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-sm);
    font-weight: 500;
    color: var(--gray-700);
}

.input-field,
.select-field {
    width: 100%;
    padding: var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
}

.input-field:focus,
.select-field:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(56, 182, 255, 0.2);
}

.color-picker {
    width: 100%;
    height: 40px;
    padding: 0;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md);
}

.range-control {
    width: 100%;
}

.range-control input[type="range"] {
    width: 100%;
    margin-bottom: var(--space-xs);
}

/* Team selection */
.team-selection {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
}

.team-option {
    flex: 1;
    padding: var(--space-md);
    text-align: center;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-weight: 600;
    border: 2px solid transparent;
}

.team-option.selected {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.team-blue {
    background-color: var(--team1-color);
    color: white;
}

.team-red {
    background-color: var(--team2-color);
    color: white;
}

/* Appearance options */
.appearance-options {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.appearance-section {
    min-width: 150px;
}

.appearance-section h4 {
    margin-bottom: var(--space-sm);
    font-size: 0.9rem;
    color: var(--gray-600);
}

.appearance-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-sm);
}

.appearance-option {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-md);
    cursor: pointer;
    border: 2px solid transparent;
    transition: all var(--transition-fast);
}

.appearance-option.selected {
    border-color: var(--primary-color);
    transform: scale(1.1);
}

/* Formation preview */
.formation-preview {
    height: 200px;
    background-color: var(--secondary-light);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Setup navigation */
.setup-navigation {
    display: flex;
    align-items: center;
    margin-right: auto;
}

.setup-indicators {
    display: flex;
    gap: var(--space-sm);
    margin: 0 var(--space-md);
}

.setup-indicator {
    width: 10px;
    height: 10px;
    border-radius: var(--radius-full);
    background-color: var(--gray-300);
}

.setup-indicator.active {
    background-color: var(--primary-color);
}

/* Friend match modal */
.friend-match-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.friend-option {
    text-align: center;
}

.match-link-container {
    text-align: center;
}

.match-link {
    display: flex;
    margin: var(--space-md) 0;
}

.match-link input {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.9rem;
}

.match-link button {
    padding: var(--space-sm) var(--space-md);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
}

.or-divider {
    position: relative;
    text-align: center;
    margin: var(--space-md) 0;
}

.or-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--gray-300);
    z-index: 1;
}

.or-divider span {
    position: relative;
    background-color: white;
    padding: 0 var(--space-sm);
    color: var(--gray-500);
    font-size: 0.9rem;
    z-index: 2;
}

.join-match-form {
    display: flex;
    margin-top: var(--space-md);
}

.join-match-form input {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    font-size: 0.9rem;
}

.join-match-form button {
    padding: var(--space-sm) var(--space-md);
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    cursor: pointer;
}

.loader {
    width: 30px;
    height: 30px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: var(--space-md) auto;
}

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

/* Loading screen */
.loading {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.loading-content {
    text-align: center;
    color: white;
    max-width: 400px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto var(--space-md);
}

.loading-tips {
    background-color: rgba(255, 255, 255, 0.1);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    margin-top: var(--space-lg);
}

.loading-tips h3 {
    color: var(--primary-light);
    margin-bottom: var(--space-sm);
    font-size: 1rem;
}

.loading-tips p {
    margin-bottom: 0;
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Game over screen */
.game-over {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.game-over-content {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    text-align: center;
}

.game-over h2 {
    margin-bottom: var(--space-lg);
    color: var(--primary-color);
}

.game-result {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.team-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.team-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    color: white;
}

.team-badge.team1 {
    background-color: var(--team1-color);
}

.team-badge.team2 {
    background-color: var(--team2-color);
}

.team-result .team-score {
    font-size: 2.5rem;
    font-weight: 700;
}

.result-divider {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 var(--space-sm);
}

.result-message {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    color: var(--gray-700);
}

.match-stats {
    background-color: var(--gray-100);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    text-align: left;
}

.match-stats h3 {
    margin-bottom: var(--space-md);
    font-size: 1.2rem;
    text-align: center;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-weight: 500;
    color: var(--gray-700);
    flex: 1;
}

.stat-bars {
    display: flex;
    flex: 2;
    gap: var(--space-xs);
}

.stat-bar {
    height: 20px;
    flex: 1;
    position: relative;
    background-color: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.stat-bar.team1 {
    order: 1;
}

.stat-bar.team2 {
    order: 2;
}

.stat-fill {
    height: 100%;
    position: absolute;
    border-radius: var(--radius-full);
}

.stat-bar.team1 .stat-fill {
    background-color: var(--team1-color);
    left: 0;
}

.stat-bar.team2 .stat-fill {
    background-color: var(--team2-color);
    right: 0;
}

.stat-value {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    padding: 0 var(--space-sm);
}

.stat-bar.team1 .stat-value {
    right: var(--space-xs);
}

.stat-bar.team2 .stat-value {
    left: var(--space-xs);
}

.stat-values {
    display: flex;
    flex: 2;
}

.stat-value-team1, .stat-value-team2 {
    flex: 1;
    text-align: center;
    font-weight: 600;
}

.stat-value-team1 {
    color: var(--team1-color);
}

.stat-value-team2 {
    color: var(--team2-color);
}

.game-over-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

/* Halftime screen */
.halftime-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.halftime-content {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.halftime-score {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-md);
    margin: var(--space-lg) 0;
}

.halftime-tabs {
    display: flex;
    margin: var(--space-md) 0;
    border-bottom: 1px solid var(--gray-200);
}

.halftime-tab {
    padding: var(--space-sm) var(--space-md);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 600;
    color: var(--gray-500);
}

.halftime-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.halftime-tab-content {
    display: none;
    min-height: 200px;
    margin-bottom: var(--space-lg);
}

.halftime-tab-content.active {
    display: block;
}

/* Substitution screen */
.substitution-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.substitution-content {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Player model styles */
.player {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    z-index: 10;
    transition: transform 0.1s ease;
    will-change: transform;
}

.player-team1 {
    background-color: var(--team1-color);
}

.player-team2 {
    background-color: var(--team2-color);
}

.player-model {
    position: absolute;
    width: 30px;
    height: 40px;
    z-index: 9;
    transform-origin: center bottom;
}

.player-body {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-head {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FFD7A8;
    position: relative;
    z-index: 11;
    overflow: hidden;
}

.player-torso {
    width: 18px;
    height: 16px;
    border-radius: 4px;
    margin-top: -2px;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-team1 .player-torso {
    background: var(--team1-color);
}

.player-team2 .player-torso {
    background: var(--team2-color);
}

.player-name {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 5px;
    border-radius: 10px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 12;
}

.player-number {
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 8px;
    font-weight: bold;
    z-index: 12;
}

.ball {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-image: radial-gradient(circle at 30% 30%, white 2px, #fff 3px, #000 3px, #000 5px, white 5px);
    background-size: 10px 10px;
    background-position: center;
    will-change: transform;
}

.ball-shadow {
    position: absolute;
    width: 12px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: 14;
}

/* Responsive styles */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: var(--space-md);
    }
    
    .logo-container {
        align-items: center;
    }
    
    .hero-text h1 {
        font-size: 2rem;
    }
    
    .hero-text p {
        font-size: 1rem;
    }
    
    .hero-image {
        width: 100%;
        opacity: 0.3;
    }
    
    .hero-image-overlay {
        background: rgba(30, 41, 59, 0.7);
    }
    
    .help-container {
        flex-direction: column;
    }
    
    .help-sidebar {
        width: 100%;
        margin-bottom: var(--space-md);
    }
    
    .help-nav {
        flex-direction: row;
        flex-wrap: wrap;
        gap: var(--space-xs);
    }
    
    .friend-match-options {
        gap: var(--space-lg);
    }
    
    .game-result {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .team-result {
        flex-direction: row;
        gap: var(--space-md);
    }
    
    .result-divider {
        display: none;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-xs);
    }
    
    .setting-control {
        max-width: 100%;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes slideInUp {
    from { 
        transform: translateY(20px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-up {
    animation: slideInUp 0.5s ease forwards;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 1.5s infinite;
}

/* Player movements and animations */
@keyframes slideTackle {
    0% { transform: rotate(0deg) translateX(0); }
    50% { transform: rotate(45deg) translateX(20px); }
    100% { transform: rotate(0deg) translateX(0); }
}

.slide-tackle {
    animation: slideTackle 0.5s ease-out;
}

@keyframes celebrate {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-10deg); }
    50% { transform: translateY(-5px) rotate(10deg); }
    75% { transform: translateY(-10px) rotate(-5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.celebration {
    animation: celebrate 1s ease-in-out;
}

/* Ad system styles */
.ad-slot {
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 3px;
    font-family: Arial, sans-serif;
    font-size: 10px;
    pointer-events: auto;
    cursor: pointer;
    transition: transform 0.2s ease;
    color: #333;
}

.ad-content {
    padding: 5px;
    text-align: center;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ad-slot img {
    max-width: 100%;
    max-height: 80%;
    object-fit: contain;
}

.ad-slot:hover {
    transform: scale(1.02);
}

.ad-admin-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    z-index: 500;
}

.game-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .game-options {
        grid-template-columns: repeat(2, 1fr);
    }
}

.option-card {
    background-color: white;
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

.option-card:hover {
    transform: translateY(-5px);
}

.option-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.option-icon {
    background-color: var(--accent-color);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: white;
}

.btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.field-container {
    margin-top: 2rem;
    background-color: #4ade80;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    display: none;
    touch-action: none;
    aspect-ratio: 16 / 9;
    max-height: 70vh;
    background-image: linear-gradient(#4ade80, #22c55e);
}

.field-marking {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90%;
    height: 90%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 5px;
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20%;
    height: 30%;
    border: 2px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
}

.center-line {
    position: absolute;
    top: 0;
    left: 50%;
    height: 100%;
    width: 2px;
    background-color: rgba(255, 255, 255, 0.7);
}

.penalty-area {
    position: absolute;
    width: 20%;
    height: 40%;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid rgba(255, 255, 255, 0.7);
}

.penalty-area-left {
    left: 5%;
}

.penalty-area-right {
    right: 5%;
}

.goal {
    position: absolute;
    width: 2%;
    height: 20%;
    background-color: #f8fafc;
    border: 2px solid #1e293b;
    z-index: 4;
}

.goal-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.goal-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.pitch-texture {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(0deg, rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
    pointer-events: none;
}

.player {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    z-index: 10;
    transition: transform 0.1s ease;
    will-change: transform;
}

.player-team1 {
    background-color: var(--team1-color);
}

.player-team2 {
    background-color: var(--team2-color);
}

.player-model {
    position: absolute;
    width: 30px;
    height: 40px;
    z-index: 9;
    transform-origin: center bottom;
}

.player-body {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.player-head {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #FFD7A8;
    position: relative;
    z-index: 11;
}

.player-torso {
    width: 16px;
    height: 14px;
    border-radius: 4px;
    margin-top: -2px;
}

.player-team1 .player-torso {
    background: var(--team1-color);
}

.player-team2 .player-torso {
    background: var(--team2-color);
}

.player-legs {
    display: flex;
    justify-content: space-between;
    width: 16px;
}

.player-leg {
    width: 4px;
    height: 12px;
    background: #333;
    border-radius: 2px;
}

.player-shadow {
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: 8;
}

.player-name {
    position: absolute;
    bottom: -18px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 2px 5px;
    border-radius: 10px;
    font-size: 10px;
    white-space: nowrap;
    z-index: 12;
}

.player-number {
    position: absolute;
    top: 1px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 8px;
    font-weight: bold;
    z-index: 12;
}

.ball {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-image: radial-gradient(circle at 30% 30%, white 2px, #fff 3px, #000 3px, #000 5px, white 5px);
    background-size: 10px 10px;
    background-position: center;
    will-change: transform;
}

.ball-shadow {
    position: absolute;
    width: 12px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: 14;
}

.match-controls {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    display: none;
}

.scoreboard {
    background-color: var(--dark-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 10px;
}

.team-score {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.team1-indicator {
    background-color: var(--team1-color);
}

.team2-indicator {
    background-color: var(--team2-color);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.close-btn {
    float: right;
    font-size: 1.5rem;
    cursor: pointer;
}

.player-setup {
    margin-top: 1rem;
}

.player-setup h3 {
    margin-bottom: 0.5rem;
}

.player-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

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

.control-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
    display: none;
}

.control-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
}

.joystick-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    width: 120px;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    display: none;
    z-index: 50;
}

.joystick {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    border-radius: 50%;
}

.action-buttons {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    display: none;
    z-index: 50;
}

.action-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.menu-btn {
    position: fixed;
    top: 10px;
    right: 10px;
    background-color: var(--dark-color);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 5px;
    cursor: pointer;
    z-index: 50;
    display: none;
}

.game-over {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    color: white;
    text-align: center;
}

.game-over-content {
    padding: 2rem;
}

.game-over h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.game-stats {
    margin: 1rem 0 2rem;
    font-size: 1.25rem;
}

.possession-indicator {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid yellow;
    z-index: 8;
    pointer-events: none;
}

.match-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 1rem 2rem;
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 100;
    display: none;
}

.pitch-grain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Continue from previous CSS */
.pitch-grain {
    opacity: 0.05;
    pointer-events: none;
    z-index: 2;
}

.sweat-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    z-index: 13;
    pointer-events: none;
}

.player-stats-card {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 5px;
    padding: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
    display: none;
    width: 180px;
}

.stat-bar {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.stat-label {
    width: 70px;
    font-size: 12px;
}

.stat-value-bar {
    flex-grow: 1;
    height: 8px;
    background-color: #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
}

.stat-value-fill {
    height: 100%;
    background-color: var(--primary-color);
}

.player-avatar {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    z-index: 14;
}

.team-selection {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.team-option {
    flex: 1;
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.team-option.selected {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.team-blue {
    background-color: var(--team1-color);
    color: white;
}

.team-red {
    background-color: var(--team2-color);
    color: white;
}

.player-customization {
    margin-top: 20px;
}

.player-features {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.feature-option {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
}

.feature-option.selected {
    border-color: var(--primary-color);
}

.hair-style {
    background-color: #333;
}

.skin-tone {
    background-color: #FFD7A8;
}

/* Add ball spin visual effect */
.ball-spin {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(45deg, transparent 45%, rgba(0, 0, 0, 0.2) 45%, 
        rgba(0, 0, 0, 0.2) 55%, transparent 55%);
    border-radius: 50%;
    opacity: 0.5;
    z-index: 16;
    transform: rotate(0deg);
}

/* Add rain effect (can be toggled on/off) */
.rain-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0.7;
    z-index: 20;
    display: none;
}

.rain-drop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.7));
    border-radius: 50%;
}

/* Mud splashes for rainy conditions */
.mud-splash {
    position: absolute;
    background-color: rgba(139, 69, 19, 0.7);
    border-radius: 50%;
    z-index: 7;
    transform-origin: center;
}

/* Visual indicator for ball spin direction */
.spin-indicator {
    position: absolute;
    width: 2px;
    height: 8px;
    background-color: rgba(255, 255, 255, 0.7);
    transform-origin: bottom;
    z-index: 16;
    display: none;
}

/* Wind indicator */
.wind-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 15;
}

.wind-arrow {
    margin-left: 5px;
    transform: rotate(0deg);
    transition: transform 0.5s ease;
}

/* Improved goal net effect */
.goal-net {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(0deg, transparent 90%, rgba(255, 255, 255, 0.5) 90%),
        linear-gradient(90deg, transparent 90%, rgba(255, 255, 255, 0.5) 90%);
    background-size: 10px 10px;
    opacity: 0.7;
}

/* Shot power indicator */
.power-meter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 15px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    z-index: 30;
    display: none;
}

.power-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, #4ade80, #f59e0b, #ef4444);
    transition: width 0.1s linear;
}

/* Player fatigue indicator */
.stamina-indicator {
    position: absolute;
    width: 20px;
    height: 3px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    overflow: hidden;
    bottom: -22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12;
}

.stamina-fill {
    height: 100%;
    background-color: #10b981;
}

/* Ball trajectory line for aiming */
.trajectory-line {
    position: absolute;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.5);
    transform-origin: left center;
    z-index: 5;
    pointer-events: none;
    display: none;
}

/* Enhanced ball shadow for 3D effect */
.ball-shadow-enhanced {
    filter: blur(2px);
}

/* Weather effects */
.weather-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 25;
    display: none;
}

.foggy {
    background-color: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(5px);
}

.snowy {
    background-image: radial-gradient(circle, white 1px, transparent 1px);
    background-size: 15px 15px;
    animation: snowfall 10s linear infinite;
}

@keyframes snowfall {
    0% { background-position: 0 0; }
    100% { background-position: 15px 100px; }
}

/* Player slide tackle animation */
.slide-tackle {
    animation: slideTackle 0.5s ease-out;
}

@keyframes slideTackle {
    0% { transform: rotate(0deg) translateX(0); }
    50% { transform: rotate(45deg) translateX(20px); }
    100% { transform: rotate(0deg) translateX(0); }
}

/* Celebration animation */
.celebration {
    animation: celebrate 1s ease-in-out;
}

@keyframes celebrate {
    0% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(15deg); }
    75% { transform: translateY(-10px) rotate(-15deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

/* Responsive design adjustments */
@media (max-width: 768px) {
    .field-container {
        max-height: 60vh;
    }
    
    .player-name {
        display: none;
    }
    
    .joystick-container {
        width: 100px;
        height: 100px;
    }
    
    .joystick {
        width: 40px;
        height: 40px;
    }
    
    .action-btn {
        width: 50px;
        height: 50px;
        font-size: 12px;
    }
}

/* Enhanced player model styling for realistic appearance */
.player-model {
    position: absolute;
    width: 30px;
    height: 40px;
    z-index: 9;
    transform-origin: center bottom;
    transition: transform 0.1s ease;
}

/* Improved body structure */
.player-body {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Enhanced head styling */
.player-head {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #FFD7A8;
    position: relative;
    z-index: 11;
    overflow: hidden;
}

/* Face details */
.player-face {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.player-eyes {
    display: flex;
    width: 8px;
    justify-content: space-between;
    margin-top: 4px;
}

.player-eye {
    width: 2px;
    height: 2px;
    background-color: #000;
    border-radius: 50%;
}

.player-eye-left {
    margin-right: 2px;
}

.player-eye-right {
    margin-left: 2px;
}

.player-mouth {
    width: 4px;
    height: 1px;
    background-color: #000;
    margin-top: 3px;
    border-radius: 2px;
}

/* Hair styles */
.player-hair {
    position: absolute;
    top: -3px;
    left: 0;
    width: 100%;
    height: 7px;
    border-radius: 5px 5px 0 0;
}

/* Improved torso */
.player-torso {
    width: 18px;
    height: 16px;
    border-radius: 4px;
    margin-top: -2px;
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-team1 .player-torso {
    background: var(--team1-color);
}

.player-team2 .player-torso {
    background: var(--team2-color);
}

/* Jersey number */
.jersey-number {
    color: white;
    font-size: 8px;
    font-weight: bold;
}

/* Arms */
.player-arms {
    position: absolute;
    top: 14px;
    width: 24px;
    display: flex;
    justify-content: space-between;
}

.player-arm {
    width: 4px;
    height: 12px;
    border-radius: 2px;
}

.player-arm-left {
    transform: rotate(-15deg);
}

.player-arm-right {
    transform: rotate(15deg);
}

/* Enhanced legs */
.player-legs {
    display: flex;
    justify-content: space-between;
    width: 18px;
    margin-top: -2px;
}

.player-leg {
    width: 5px;
    height: 14px;
    background: #222;
    border-radius: 2px;
    position: relative;
}

/* Feet */
.player-foot {
    position: absolute;
    bottom: -2px;
    width: 7px;
    height: 3px;
    background-color: #111;
    border-radius: 3px;
}

.player-foot-left {
    left: -1px;
    transform: rotate(-10deg);
}

.player-foot-right {
    left: -1px;
    transform: rotate(10deg);
}

/* Improved player shadow */
.player-shadow {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: 8;
    filter: blur(1px);
}

/* Simple controls for pass/shot buttons */
#simpleControls {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 10px;
    border-radius: 10px;
}

#simpleControls button {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

#simpleControls button:hover {
    transform: scale(1.05);
}

#simpleControls button:active {
    transform: scale(0.95);
}

/* Animation for celebrating players */
@keyframes celebrate {
    0% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(-10deg); }
    50% { transform: translateY(-5px) rotate(10deg); }
    75% { transform: translateY(-10px) rotate(-5deg); }
    100% { transform: translateY(0) rotate(0deg); }
}

.celebration {
    animation: celebrate 1s ease-in-out;
}

/* Animation for throw-ins */
@keyframes throwIn {
    0% { transform: rotate(0deg) translateX(0); }
    50% { transform: rotate(-45deg) translateX(-5px); }
    100% { transform: rotate(0deg) translateX(0); }
}

.throw-in-animation {
    animation: throwIn 0.8s ease-out;
}

/* Out-of-bounds indicator */
.out-indicator {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 40;
    display: none;
}

.out-indicator-line {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 40;
}

.out-indicator-left {
    left: 2%;
    top: 0;
    width: 2px;
    height: 100%;
}

.out-indicator-right {
    right: 2%;
    top: 0;
    width: 2px;
    height: 100%;
}

.out-indicator-top {
    top: 2%;
    left: 0;
    height: 2px;
    width: 100%;
}

.out-indicator-bottom {
    bottom: 2%;
    left: 0;
    height: 2px;
    width: 100%;
}

.out-indicator-active {
    display: block;
    animation: flashOutLine 0.5s ease-in-out;
}

@keyframes flashOutLine {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* More realistic ball */
.ball {
    position: absolute;
    width: 15px;
    height: 15px;
    background-color: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    background-image: 
        radial-gradient(circle at 30% 30%, white 1px, transparent 3px),
        radial-gradient(circle at 70% 30%, white 1px, transparent 3px),
        radial-gradient(circle at 30% 70%, white 1px, transparent 3px),
        radial-gradient(circle at 70% 70%, white 1px, transparent 3px),
        radial-gradient(circle at 50% 50%, white 9px, black 9px, black 10px, white 10px);
    background-size: 100% 100%;
    background-position: center;
    will-change: transform;
}

.ball-shadow {
    position: absolute;
    width: 12px;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    z-index: 14;
    filter: blur(1px);
}

/* FIFA-style controls container */
#fifaControls {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 35vh;
    z-index: 50;
    pointer-events: none; /* Let clicks pass through to the container */
}

/* Movement joystick (left side) */
.fifa-joystick {
    position: absolute;
    bottom: 20px;
    left: 20px;
    width: 120px;
    height: 120px;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    pointer-events: auto; /* Capture events on the joystick */
}

.fifa-joystick-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 50px;
    height: 50px;
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Action buttons (right side) */
.fifa-action-buttons {
    position: absolute;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    pointer-events: auto; /* Capture events on the buttons */
}

.fifa-action-button {
    position: absolute;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease-in-out, box-shadow 0.1s ease-in-out;
}

.fifa-action-button:active,
.fifa-button-active {
    transform: scale(1.2) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Button tooltips */
.fifa-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
    margin-bottom: 5px;
}

.fifa-action-button:active .fifa-tooltip {
    opacity: 1;
}

/* Hide keyboard/desktop controls on mobile */
@media (max-width: 768px) {
    #controlButtons {
        display: none !important;
    }
}

/* Instructions overlay */
.controls-instructions {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    max-width: 80%;
    z-index: 1000;
    text-align: center;
}

.controls-instructions h3 {
    margin-bottom: 10px;
}

.controls-instructions p {
    margin-bottom: 5px;
}

.controls-instructions button {
    margin-top: 15px;
    padding: 8px 16px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 5px;
    color: white;
    cursor: pointer;
}

/* Specific button animations */
@keyframes buttonPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.fifa-button-pulse {
    animation: buttonPulse 0.5s ease-in-out;
}

/* Game Options Menu - Enhanced */
.game-options {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.95);
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    padding: var(--space-xl);
    text-align: center;
}

.game-options h2 {
    font-size: 2.5rem;
    margin-bottom: var(--space-2xl);
    color: var(--primary-light);
    text-shadow: 0 0 10px rgba(125, 211, 252, 0.5);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-xl);
    max-width: 800px;
    width: 100%;
}

@media (max-width: 768px) {
    .options-grid {
        grid-template-columns: 1fr;
    }
}

.option-card {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all var(--transition-normal);
    cursor: pointer;
    border: 2px solid transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.option-card:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--primary-light);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.option-card h3 {
    font-size: 1.5rem;
    margin-bottom: var(--space-md);
    color: white;
}

.option-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: var(--space-sm) var(--space-xl);
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-top: var(--space-md);
}

.option-btn:hover {
    background-color: var(--primary-dark);
    transform: scale(1.05);
}

/* Match Notification */
.match-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background-color: rgba(15, 23, 42, 0.9);
    color: white;
    padding: var(--space-lg) var(--space-2xl);
    border-radius: var(--radius-lg);
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    z-index: 150;
    min-width: 250px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    animation: notification-pop 2s ease-in-out forwards;
    border: 2px solid var(--primary-light);
}

@keyframes notification-pop {
    0% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
    20% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 1;
    }
    80% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(0);
        opacity: 0;
    }
}

/* Control Buttons */
.control-buttons {
    position: fixed;
    bottom: 100px;
    right: 30px;
    display: grid;
    grid-template-areas:
        ". up ."
        "left . right"
        ". down .";
    grid-gap: 5px;
    z-index: 50;
}

.direction-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(59, 130, 246, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.direction-btn:active {
    transform: scale(0.9);
    background-color: rgba(29, 78, 216, 0.9);
}

.up-btn {
    grid-area: up;
}

.down-btn {
    grid-area: down;
}

.left-btn {
    grid-area: left;
}

.right-btn {
    grid-area: right;
}

/* Joystick Control */
.joystick-container {
    position: fixed;
    bottom: 80px;
    left: 50px;
    width: 150px;
    height: 150px;
    background-color: rgba(15, 23, 42, 0.5);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 50;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: none;
}

.joystick {
    width: 60px;
    height: 60px;
    background-color: rgba(59, 130, 246, 0.9);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.8);
}

.joystick:active {
    cursor: grabbing;
    background-color: rgba(29, 78, 216, 0.9);
}

/* Action Buttons */
.action-buttons {
    position: fixed;
    bottom: 120px;
    right: 150px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 50;
}

.action-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.action-btn:active {
    transform: scale(0.9);
    background-color: rgba(5, 150, 105, 0.9);
}

.mobile-btn {
    display: none;
}

/* Media Queries for Mobile */
@media (max-width: 768px) {
    .control-buttons {
        bottom: 30px;
        right: 10px;
    }
    
    .joystick-container {
        bottom: 30px;
        left: 10px;
        width: 120px;
        height: 120px;
    }
    
    .action-buttons {
        bottom: 50px;
        right: auto;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
        gap: 40px;
    }
    
    .action-btn {
        width: 70px;
        height: 70px;
    }
    
    .mobile-btn {
        display: flex;
    }
    
    .action-btn:not(.mobile-btn) {
        display: none;
    }
}

/* Setup Modal */
.setup-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.85);
    z-index: 90;
    display: none;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
}

.setup-modal.active {
    display: flex;
}

.modal-content {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.setup-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

@media (max-width: 600px) {
    .setup-form {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--gray-700);
}

.team-options {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-xs);
}

.team-option {
    flex: 1;
    padding: var(--space-sm);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.team-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

.team-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.team1-color {
    background-color: var(--team1-color);
}

.team2-color {
    background-color: var(--team2-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    z-index: 200;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 8px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s linear infinite;
    margin-bottom: var(--space-lg);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Game Over Screen */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.9);
    z-index: 150;
    display: none;
    justify-content: center;
    align-items: center;
    padding: var(--space-md);
}

.game-over-screen.active {
    display: flex;
}

.game-over-content {
    background-color: white;
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    max-width: 700px;
    width: 100%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.game-over-stats {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
}

@media (max-width: 600px) {
    .game-over-stats {
        grid-template-columns: 1fr;
    }
}

.final-score {
    background-color: var(--gray-100);
    padding: var(--space-md);
    border-radius: var(--radius-md);
    text-align: center;
}

.final-score p {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
}

.match-stats {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    border-bottom: 1px solid var(--gray-200);
}

.stat-label {
    font-weight: 600;
    color: var(--gray-700);
}

.stat-value {
    font-weight: 700;
    color: var(--gray-900);
}

.game-over-actions {
    display: flex;
    justify-content: center;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* Player Stats Card */
.player-stats-card {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: rgba(15, 23, 42, 0.8);
    color: white;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    min-width: 200px;
    z-index: 40;
    display: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    border-left: 4px solid var(--primary-color);
}

.player-stats-card.active {
    display: block;
}

/* Essential Game Elements (Hidden by Default) */
.game-options {
    display: none;
}

.match-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(15, 23, 42, 0.9);
    color: white;
    padding: 10px 30px;
    border-radius: 8px;
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    z-index: 150;
    display: none;
}

.control-buttons {
    position: fixed;
    bottom: 100px;
    right: 30px;
    display: none;
    z-index: 50;
}

.joystick-container {
    position: fixed;
    bottom: 80px;
    left: 50px;
    z-index: 50;
    display: none;
}

.action-buttons {
    position: fixed;
    bottom: 120px;
    right: 150px;
    display: none;
    z-index: 50;
}