:root {
    --primary-blue: #1a73e8;
    --secondary-blue: #4285f4;
    --dark-blue: #0d47a1;
    --light-blue: #e8f0fe;
    --accent-blue: #34a853;
    --warning: #fbbc05;
    --danger: #ea4335;
    --light: #f8f9fa;
    --dark: #202124;
    --gray: #5f6368;
    --white: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: var(--light);
    overflow-x: hidden;
}

/* ===== MOBILE-FIRST RESPONSIVE NAVIGATION ===== */
.navbar {
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(13, 71, 161, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.nav-logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-logo a::before {
    content: '⚽';
    font-size: 1.3em;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
    padding: 1rem 0;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.nav-menu a {
    color: var(--white);
    text-decoration: none;
    padding: 1rem 2rem;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--white);
    padding-left: 2.5rem;
}

.nav-menu a i {
    width: 20px;
    text-align: center;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    padding: 0.5rem;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--white);
    margin: 2px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.menu-toggle.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* ===== MAIN CONTENT & LAYOUT ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
}

main {
    min-height: calc(100vh - 200px);
    padding: 1rem 0;
}

/* ===== HERO SECTION ===== */
.hero {
    background: linear-gradient(135deg, var(--primary-blue), var(--dark-blue));
    color: var(--white);
    padding: 3rem 1rem;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="none"><path d="M0,0 L100,0 L100,100 Z" fill="rgba(255,255,255,0.1)"/></svg>');
    background-size: cover;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-content h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

/* ===== BUTTONS ===== */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), #2e7d32);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(52, 168, 83, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 168, 83, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--secondary-blue), var(--primary-blue));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(66, 133, 244, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(66, 133, 244, 0.4);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ===== FEATURES GRID ===== */
.features {
    margin: 3rem 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 1px solid #e8f0fe;
    position: relative;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    border-radius: 12px 12px 0 0;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(26, 115, 232, 0.15);
}

.feature-card i {
    font-size: 2.5rem;
    color: var(--primary-blue);
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--light-blue), #dbeafe);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin: 0 auto 1rem;
}

.feature-card h3 {
    color: var(--dark-blue);
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.feature-card p {
    color: var(--gray);
    line-height: 1.6;
}

/* ===== VOTING SECTIONS ===== */
.requirements {
    background: linear-gradient(135deg, var(--light-blue), #dbeafe);
    padding: 1.2rem;
    border-radius: 10px;
    border-left: 5px solid var(--primary-blue);
    margin-bottom: 2rem;
    font-size: 1rem;
    box-shadow: 0 3px 10px rgba(26, 115, 232, 0.1);
}

.voting-section {
    background: var(--white);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #e8f0fe;
}

.voting-section h2 {
    color: var(--dark-blue);
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
}

.voting-section h2 small {
    font-size: 0.8em;
    color: var(--gray);
    font-weight: normal;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.player-card {
    border: 2px solid #e8f0fe;
    border-radius: 12px;
    padding: 1.2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    background: var(--white);
    overflow: hidden;
}

.player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--primary-blue);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.player-card:hover {
    border-color: var(--primary-blue);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.15);
}

.player-card:hover::before {
    transform: scaleX(1);
}

.player-card.selected {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, #f0f9f0, #e8f5e8);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(52, 168, 83, 0.2);
}

.player-card.selected::before {
    background: var(--accent-blue);
    transform: scaleX(1);
}

.player-card input[type="radio"],
.player-card input[type="checkbox"] {
    position: absolute;
    top: 10px;
    left: 10px;
    transform: scale(1.2);
    cursor: pointer;
}

.player-card img {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.8rem;
    border: 2px solid #e8f0fe;
    transition: border-color 0.3s ease;
}

.player-card.selected img {
    border-color: var(--accent-blue);
}

.player-card h4 {
    margin: 0.3rem 0;
    color: var(--dark);
    font-size: 1rem;
    font-weight: 600;
}

.player-card p {
    color: var(--gray);
    margin: 0;
    font-size: 0.85rem;
}

.selection-count {
    font-weight: bold;
    margin-top: 1rem;
    padding: 0.8rem;
    background: var(--light-blue);
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
    font-size: 1em;
    transition: all 0.3s ease;
}

.total-selection {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin-top: 2rem;
    border: 2px solid #e8f0fe;
    position: sticky;
    bottom: 1rem;
    z-index: 100;
}

.total-selection h3 {
    margin-bottom: 1rem;
    color: var(--dark-blue);
    font-size: 1.2rem;
}

#total-count, #coach-total {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--primary-blue);
}

/* ===== FORM STYLES ===== */
.auth-form {
    max-width: 400px;
    margin: 2rem auto;
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #e8f0fe;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--dark-blue);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e8f0fe;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
}

/* ===== ALERTS & MESSAGES ===== */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert.success {
    background: #f0f9f0;
    color: #155724;
    border-left-color: var(--accent-blue);
}

.alert.error {
    background: #fdf2f2;
    color: #721c24;
    border-left-color: var(--danger);
}

.validation-message {
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.validation-message.valid {
    background: #f0f9f0;
    color: #155724;
    border: 2px solid var(--accent-blue);
}

.validation-message.invalid {
    background: #fdf2f2;
    color: #721c24;
    border: 2px solid var(--danger);
}

/* ===== SUBMIT BUTTON ===== */
#submit-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 600;
    font-size: 1.1em;
    padding: 14px 40px;
    border: none;
    border-radius: 8px;
    min-width: 180px;
}

#submit-btn:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.3);
}

#submit-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.4);
}

#submit-btn.valid:not(:disabled) {
    background: linear-gradient(135deg, var(--accent-blue), #2e7d32);
}

#submit-btn.valid:not(:disabled):hover {
    box-shadow: 0 8px 25px rgba(52, 168, 83, 0.4);
}

#submit-btn:disabled {
    background: #bdc3c7 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
    transform: none !important;
    box-shadow: none !important;
}

/* ===== TABLES ===== */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    margin: 1rem 0;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e8f0fe;
}

.leaderboard-table th {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: var(--white);
    font-weight: 600;
}

.leaderboard-table tr:hover {
    background: var(--light-blue);
}

/* ===== CURRENT VOTING INFO ===== */
.current-voting {
    background: var(--white);
    padding: 2rem 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    border: 1px solid #e8f0fe;
    margin: 2rem 0;
}

.voting-info {
    margin-top: 1rem;
}

.voting-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    color: var(--dark-blue);
}

/* ===== FOOTER ===== */
footer {
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
    color: var(--white);
    padding: 2rem 1rem;
    margin-top: 4rem;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
    opacity: 0.9;
}

footer a {
    color: var(--white);
    text-decoration: none;
    margin: 0 0.5rem;
    transition: opacity 0.3s ease;
}

footer a:hover {
    opacity: 0.8;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet Styles */
@media (min-width: 768px) {
    .container {
        padding: 2rem;
    }
    
    .hero {
        padding: 4rem 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.8rem;
    }
    
    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 1.5rem;
    }
    
    .player-card {
        padding: 1.5rem;
    }
    
    .player-card img {
        width: 80px;
        height: 80px;
    }
    
    .voting-section {
        padding: 2rem;
    }
    
    .nav-menu {
        position: static;
        flex-direction: row;
        transform: none;
        opacity: 1;
        visibility: visible;
        background: none;
        box-shadow: none;
        padding: 0;
        width: auto;
    }
    
    .nav-menu a {
        padding: 0.5rem 1rem;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    
    .nav-menu a:hover {
        background: none;
        border-left: none;
        border-bottom-color: var(--white);
        padding-left: 1rem;
    }
    
    .menu-toggle {
        display: none;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .container {
        padding: 2rem;
    }
    
    .hero-content h1 {
        font-size: 3.2rem;
    }
    
    .feature-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .players-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
    
    .nav-container {
        padding: 0 2rem;
    }
    
    .nav-menu a {
        padding: 0.5rem 1.5rem;
    }
}

/* Large Desktop Styles */
@media (min-width: 1200px) {
    .container {
        padding: 3rem;
    }
    
    .hero {
        padding: 5rem 3rem;
    }
}

/* Small Mobile Adjustments */
@media (max-width: 360px) {
    .container {
        padding: 0.5rem;
    }
    
    .hero {
        padding: 2rem 1rem;
        border-radius: 10px;
    }
    
    .hero-content h1 {
        font-size: 1.8rem;
    }
    
    .players-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    
    .player-card {
        padding: 1rem;
    }
    
    .player-card img {
        width: 60px;
        height: 60px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* High-resolution displays */
@media (min-resolution: 192dpi) {
    .feature-card,
    .voting-section,
    .player-card {
        border-width: 1.5px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    footer,
    .btn {
        display: none;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
}

/* Football Pitch Styles */
.pitch-formation {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 2rem 0;
    overflow: hidden;
}

.formation-header {
    text-align: center;
    margin-bottom: 2rem;
}

.formation-header h3 {
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.formation-header p {
    color: var(--gray);
    font-size: 1.1rem;
}

.football-pitch-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

/* Technical Area - Manager */
.technical-area {
    position: absolute;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 20;
    min-width: 200px;
    text-align: center;
}

.technical-area::before {
    content: 'Technical Area';
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    background: #34495e;
    color: white;
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
}

.football-pitch {
    position: relative;
    width: 100%;
    height: 800px; /* Portrait height */
    background: linear-gradient(135deg, #27ae60, #219653);
    border: 3px solid #fff;
    border-radius: 10px;
    margin: 0 auto 100px; /* Space for technical area */
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

/* Pitch Markings for Portrait */
.pitch-center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 2px solid #fff;
    border-radius: 50%;
    opacity: 0.3;
}

.pitch-center-line {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 2px;
    background: #fff;
    opacity: 0.3;
}

.pitch-penalty-area {
    position: absolute;
    width: 300px;
    height: 120px;
    border: 2px solid #fff;
    opacity: 0.3;
    left: 50%;
    transform: translateX(-50%);
}

.pitch-penalty-top {
    top: 0;
    border-bottom: none;
}

.pitch-penalty-bottom {
    bottom: 0;
    border-top: none;
}

.pitch-goal-area {
    position: absolute;
    width: 180px;
    height: 60px;
    border: 2px solid #fff;
    opacity: 0.3;
    left: 50%;
    transform: translateX(-50%);
}

.pitch-goal-top {
    top: 0;
    border-bottom: none;
}

.pitch-goal-bottom {
    bottom: 0;
    border-top: none;
}

.pitch-goal {
    position: absolute;
    width: 120px;
    height: 4px;
    background: #fff;
    opacity: 0.5;
    left: 50%;
    transform: translateX(-50%);
}

.pitch-goal-top {
    top: 0;
}

.pitch-goal-bottom {
    bottom: 0;
}

/* Player Styles */
.pitch-player {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: 10;
}

.pitch-player:hover {
    transform: translate(-50%, -50%) scale(1.1);
    z-index: 20;
}

.player-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 3px solid #fff;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
    margin-bottom: 8px;
}

.player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.player-info {
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 20px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.player-info strong {
    display: block;
    font-size: 0.8rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 2px;
}

.player-info small {
    font-size: 0.7rem;
    color: #7f8c8d;
    font-weight: 600;
    display: block;
}

/* Position-specific colors and styles */
.pitch-player.coach .player-avatar {
    border-color: #f39c12;
}

.pitch-player.coach .player-info {
    background: linear-gradient(135deg, #f39c12, #e67e22);
    color: white;
}

.pitch-player.coach .player-info strong,
.pitch-player.coach .player-info small {
    color: white;
}

.pitch-player.goalkeeper .player-avatar {
    border-color: #3498db;
}

.pitch-player.goalkeeper .player-info {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.pitch-player.goalkeeper .player-info strong,
.pitch-player.goalkeeper .player-info small {
    color: white;
}

.pitch-player.defender .player-avatar {
    border-color: #27ae60;
}

.pitch-player.defender .player-info {
    background: linear-gradient(135deg, #27ae60, #219653);
    color: white;
}

.pitch-player.defender .player-info strong,
.pitch-player.defender .player-info small {
    color: white;
}

.pitch-player.midfielder .player-avatar {
    border-color: #9b59b6;
}

.pitch-player.midfielder .player-info {
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    color: white;
}

.pitch-player.midfielder .player-info strong,
.pitch-player.midfielder .player-info small {
    color: white;
}

.pitch-player.forward .player-avatar {
    border-color: #e74c3c;
}

.pitch-player.forward .player-info {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.pitch-player.forward .player-info strong,
.pitch-player.forward .player-info small {
    color: white;
}

/* Position containers for portrait pitch */
.pitch-goalkeeper {
    position: absolute;
    top: 90%;
    left: 50%;
}

.pitch-defenders {
    position: absolute;
    top: 80%;
    left: 0;
    right: 0;
}

.pitch-midfielders {
    position: absolute;
    top: 55%;
    left: 0;
    right: 0;
}

.pitch-forwards {
    position: absolute;
    top: 30%;
    left: 0;
    right: 0;
}

.formation-label {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    color: #2c3e50;
    font-size: 1.2rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.direction-arrow {
    position: absolute;
    top: 15px;
    right: 20px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Formation Legend */
.formation-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--gray);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.legend-color.goalkeeper { background: #3498db; }
.legend-color.defender { background: #27ae60; }
.legend-color.midfielder { background: #9b59b6; }
.legend-color.forward { background: #e74c3c; }
.legend-color.coach { background: #f39c12; }

@media (max-width: 768px) {
    .football-pitch {
        height: 600px;
    }
    
    .player-avatar {
        width: 40px;
        height: 40px;
    }
    
    .player-info {
        padding: 6px 8px;
        min-width: 60px;
    }
    
    .player-info strong {
        font-size: 0.7rem;
    }
    
    .player-info small {
        font-size: 0.6rem;
    }
    
    .technical-area {
        bottom: -100px;
        min-width: 180px;
    }
    
    .formation-legend {
        gap: 1rem;
    }
    
    .legend-item {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .football-pitch {
        height: 500px;
    }
    
    .pitch-player {
        transform: translate(-50%, -50%) scale(0.9);
    }
    
    .technical-area {
        transform: translateX(-50%) scale(0.9);
    }
}

/* Enhanced form validation styles */
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: #e74c3c !important;
    background: #fdf2f2;
}

.field-error {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 0.25rem;
    display: block;
}

/* Enhanced voting validation */
.selection-count.warning {
    color: #f39c12;
    font-weight: bold;
}

.selection-count.error {
    color: #e74c3c;
    font-weight: bold;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

