/* ========================================
   Player Manager - Modern CSS Design System
   Pure CSS - No JavaScript Dependencies
   ======================================== */

:root {
    /* Color Palette - Modern & Vibrant */
    --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-solid: #667eea;
    --primary-dark: #5a67d8;
    --secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --secondary-solid: #f093fb;
    --accent: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --accent-solid: #4facfe;

    /* Neutral Colors */
    --white: #ffffff;
    --gray-50: #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;

    /* Status Colors */
    --success: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    --success-solid: #10b981;
    --error: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    --error-solid: #ef4444;
    --warning: linear-gradient(135deg, #fff9c4 0%, #f0f4c3 100%);
    --warning-solid: #f59e0b;

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;

    /* Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-glow: 0 0 20px rgb(102 126 234 / 0.4);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.25);
    --glass-border: rgba(255, 255, 255, 0.18);
    --glass-blur: blur(20px);

    /* Animations */
    --transition-fast: 150ms ease-in-out;
    --transition-normal: 250ms ease-in-out;
    --transition-slow: 400ms ease-in-out;
}

/* ========================================
   Base Styles & Reset
   ======================================== */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
            radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.15) 0%, transparent 50%),
            radial-gradient(circle at 40% 40%, rgba(120, 200, 255, 0.15) 0%, transparent 50%);
    z-index: -1;
    animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ========================================
   Container & Layout
   ======================================== */

.container {
    max-width: 900px;
    margin: var(--space-8) auto;
    padding: var(--space-8);
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out;
}

.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
    animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

/* ========================================
   Typography
   ======================================== */

h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-6);
    position: relative;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent);
    border-radius: var(--radius-full);
}

h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: var(--space-6);
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-4);
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-3);
}

p {
    margin-bottom: var(--space-4);
    color: var(--gray-600);
}

/* ========================================
   Navigation
   ======================================== */

.navigation {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    margin-bottom: var(--space-8);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out 0.2s both;
}

/* ========================================
   Main Navigation Header
   ======================================== */

.page-container {
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.main-navigation {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: var(--space-4) 0;
    margin-bottom: 0;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.nav-container h1 {
    font-size: 1.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.nav-container h1::after {
    display: none;
}

.nav-links {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
    display: none;
}

.nav-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0.025em;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.nav-link::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;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(255, 255, 255, 0.4);
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link.active {
    background: var(--primary);
    border-color: var(--primary-solid);
    box-shadow: var(--shadow-glow);
}

.nav-link:active {
    transform: translateY(0);
}

/* Main Content Area */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-8) var(--space-6);
}

.content-header {
    text-align: center;
    margin-bottom: var(--space-8);
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.content-header h2 {
    color: var(--white);
    margin-bottom: var(--space-3);
    font-size: 2.25rem;
}

.content-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin: 0;
}

.action-section {
    display: flex;
    justify-content: center;
    margin-bottom: var(--space-8);
}

.generate-form {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
}

.loading-state {
    text-align: center;
    padding: var(--space-12);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    color: rgba(255, 255, 255, 0.8);
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        text-align: center;
        gap: var(--space-3);
    }

    .nav-links {
        justify-content: center;
        gap: var(--space-2);
    }

    .nav-link {
        padding: var(--space-2) var(--space-4);
        font-size: 0.9rem;
    }

    .main-content {
        padding: var(--space-6) var(--space-4);
    }

    .content-header h2 {
        font-size: 1.875rem;
    }
}

@media (max-width: 640px) {
    .nav-links {
        width: 100%;
        flex-direction: column;
        flex-wrap: nowrap;
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: 0;
        gap: var(--space-2);
    }

    .nav-link {
        flex: 1 1 auto;
        min-width: auto;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

.navigation::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.navigation:hover::before {
    left: 100%;
}

.navigation a {
    color: var(--white);
    text-decoration: none;
    font-weight: 600;
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.navigation a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.navigation a:active {
    transform: translateY(0);
}

/* ========================================
   Tables
   ======================================== */

.table-container {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-xl);
    margin: var(--space-6) 0;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    padding: var(--space-4);
    text-align: left;
    position: relative;
}

th:first-child {
    border-top-left-radius: var(--radius-lg);
}

th:last-child {
    border-top-right-radius: var(--radius-lg);
}

td {
    padding: var(--space-4);
    border-bottom: 1px solid var(--gray-200);
    transition: all var(--transition-fast);
}

tr:hover td {
    background: var(--gray-50);
    transform: scale(1.01);
}

tr:last-child td {
    border-bottom: none;
}

tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-lg);
}

tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-lg);
}

/* ========================================
   Forms
   ======================================== */

form {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin: var(--space-6) 0;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.6s ease-out 0.3s both;
}

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

label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: var(--space-2);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.helper-text {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: var(--space-3);
    font-style: italic;
}

input[type="text"],
textarea {
    width: 100%;
    padding: var(--space-4);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: var(--white);
    margin-bottom: var(--space-5);
    font-family: var(--font-family);
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 120px;
}

/* ========================================
   Buttons
   ======================================== */

button {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-md);
    font-family: var(--font-family);
}

button::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;
}

button:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

button:hover::before {
    left: 100%;
}

button:active {
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--error);
}

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

.btn-success {
    background: var(--success);
}

/* ========================================
   Cards & Components
   ======================================== */

.stats {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
    font-weight: 600;
    color: var(--gray-800);
    text-align: center;
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.6s ease-out 0.1s both;
}

.stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent);
}

.empty-state {
    text-align: center;
    padding: var(--space-16);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-2xl);
    margin: var(--space-8) 0;
    color: var(--gray-600);
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: var(--space-4);
}

/* ========================================
   Alerts & Messages
   ======================================== */

.error {
    background: rgba(239, 68, 68, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 4px solid var(--error-solid);
    color: #dc2626;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
    position: relative;
    animation: slideInDown 0.3s ease-out;
}

.success {
    background: rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-left: 4px solid var(--success-solid);
    color: #059669;
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    margin: var(--space-4) 0;
    position: relative;
    animation: slideInDown 0.3s ease-out;
}

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

/* ========================================
   Action Buttons
   ======================================== */

.action-buttons {
    display: flex;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-top: var(--space-6);
    animation: fadeIn 0.6s ease-out 0.5s both;
}

.action-buttons a {
    text-decoration: none;
    flex: 1;
    min-width: 200px;
}

.action-buttons button {
    width: 100%;
}

/* ========================================
   Quick Stats Section
   ======================================== */

.quick-stats {
    margin-top: var(--space-8);
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xl);
    animation: fadeIn 0.6s ease-out 0.6s both;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    text-align: center;
    transition: all var(--transition-normal);
}

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

.stat-card h4 {
    font-size: 2rem;
    font-weight: 800;
    background: var(--accent);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: var(--space-2);
}

.stat-card p {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin: 0;
    font-weight: 500;
}

/* ========================================
   Info Sections
   ======================================== */

.info-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.info-section h3 {
    color: var(--gray-800);
    margin-bottom: var(--space-4);
}

.example-section {
    margin: var(--space-6) 0;
    animation: fadeIn 0.6s ease-out 0.5s both;
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-3);
}

.example-tag {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary-solid);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

/* ========================================
   Instructions Section
   ======================================== */

.instructions-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

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

.instruction-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.instruction-card h4 {
    color: var(--gray-800);
    margin-bottom: var(--space-3);
    font-size: 1rem;
}

.instruction-card ul {
    list-style: none;
    padding: 0;
}

.instruction-card li {
    padding-left: var(--space-4);
    margin-bottom: var(--space-2);
    position: relative;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.instruction-card li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--primary-solid);
    font-weight: bold;
}

/* ========================================
   Example Demo Section
   ======================================== */

.example-demo {
    background: rgba(79, 172, 254, 0.05);
    border: 1px solid rgba(79, 172, 254, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    animation: fadeIn 0.6s ease-out 0.6s both;
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-4);
    align-items: center;
    margin-top: var(--space-4);
}

.demo-input, .demo-output {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: var(--space-4);
}

.demo-input h4, .demo-output h4 {
    font-size: 0.875rem;
    margin-bottom: var(--space-3);
    color: var(--gray-800);
}

.demo-input pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: var(--space-3);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    margin: 0;
    white-space: pre-wrap;
    font-family: var(--font-mono);
}

.demo-arrow {
    font-size: 1.5rem;
    text-align: center;
    color: var(--primary-solid);
}

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

.result-item {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-solid);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.result-note {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: var(--space-2);
    font-style: italic;
}

/* ========================================
   Utility Classes
   ======================================== */

.delete-form {
    display: inline;
}

/* Lists */
ul {
    list-style: none;
    padding-left: 0;
}

li {
    position: relative;
    padding-left: var(--space-6);
    margin-bottom: var(--space-2);
    color: var(--gray-600);
}

li::before {
    content: '✨';
    position: absolute;
    left: 0;
    top: 0;
}

/* Code blocks */
pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    font-family: var(--font-mono);
    font-size: 0.875rem;
    overflow-x: auto;
    margin: var(--space-4) 0;
    box-shadow: var(--shadow-lg);
}

/* ========================================
   Footer
   ======================================== */

footer {
    margin-top: var(--space-16);
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    padding: var(--space-6);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    animation: fadeIn 0.6s ease-out 0.7s both;
}

/* ========================================
   Focus Styles for Accessibility
   ======================================== */

button:focus,
input:focus,
textarea:focus,
a:focus {
    outline: 2px solid var(--primary-solid);
    outline-offset: 2px;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .container {
        margin: var(--space-4);
        padding: var(--space-6);
        border-radius: var(--radius-xl);
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .navigation {
        flex-direction: column;
        gap: var(--space-2);
    }

    .navigation a {
        text-align: center;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: var(--space-2);
    }

    .empty-state {
        padding: var(--space-8);
    }

    .demo-container {
        grid-template-columns: 1fr;
        gap: var(--space-6);
    }

    .demo-arrow {
        transform: rotate(90deg);
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons a {
        min-width: auto;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    /* === Ajustements d'agrandissement terrain & chips joueurs === */
    .badminton-court-large {
        max-width: 280px; /* élargi (avant ~220px) */
        height: 120px;    /* proportionnelle */
    }
    .player-chip-large {
        width: 100px;      /* plus large */
        max-width: 100px;
        font-size: 0.7rem;
    }
}

@media (max-width: 640px) {
    .container {
        margin: var(--space-3);
    }

    .main-content {
        padding: var(--space-5) var(--space-3);
    }

    .content-header {
        padding: var(--space-4);
    }

    .generate-form,
    form {
        padding: var(--space-5) var(--space-4);
    }

    .stats {
        padding: var(--space-3);
    }
}

@media (max-width: 480px) {
    body {
        font-size: 14px;
    }

    .container {
        margin: var(--space-2);
        padding: var(--space-4);
    }

    h1 {
        font-size: 1.75rem;
    }

    button {
        width: 100%;
        margin-bottom: var(--space-2);
    }

    /* Mobile table transformation */
    table, thead, tbody, th, td, tr {
        display: block;
    }

    thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    tr {
        background: var(--white);
        border-radius: var(--radius-lg);
        margin-bottom: var(--space-4);
        padding: var(--space-4);
        box-shadow: var(--shadow-md);
    }

    td {
        border: none;
        position: relative;
        padding-left: 50%;
        text-align: right;
    }

    td:before {
        content: attr(data-label) ": ";
        position: absolute;
        left: var(--space-4);
        width: 45%;
        text-align: left;
        font-weight: 600;
        color: var(--gray-700);
    }

    /* Ajustements d'agrandissement terrain & chips joueurs */
    .badminton-court-large {
        max-width: 220px; /* élargi (avant ~220px) */
        height: 100px;    /* proportionnelle */
    }
    .player-chip-large {
        width: 90px;      /* plus large */
        max-width: 90px;
        font-size: 0.65rem;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    body {
        background: white;
        color: black;
    }

    .container {
        box-shadow: none;
        background: white;
        border: 1px solid #ccc;
    }

    .navigation,
    button,
    .delete-form,
    .quick-stats,
    .action-buttons,
    .example-demo,
    .instructions-section {
        display: none;
    }

    /* Remove animations for print */
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ========================================
   Reduced Motion Support
   ======================================== */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* ========================================
   Extensions CSS pour les Scores
   ======================================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4);
    animation: fadeIn 0.3s ease-out;
}

.modal-overlay .container {
    max-width: 500px;
    margin: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideInUp 0.3s ease-out;
}

/* Modal large pour batch form */
.modal-overlay .container[style*="max-width: 900px"] {
    max-width: 900px !important;
    width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
}

/* Modal Header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.modal-header h2 {
    margin: 0;
    color: var(--gray-800);
}

/* Modal Close Button */
.btn-close {
    border-radius: 50% !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 1rem !important;
    min-width: 32px;
    flex-shrink: 0;
}

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

/* Badges de terrain et type de match */
.terrain-badge {
    background: var(--primary-solid);
    color: white;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
}

.match-type-badge {
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.8rem;
}

.match-type-badge.double {
    background: var(--success-solid);
    color: white;
}

.match-type-badge.simple {
    background: var(--accent-solid);
    color: white;
}

/* Affichage des équipes et joueurs */
.teams-display {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.team {
    font-size: 0.9rem;
}

.players-display {
    font-weight: 500;
    color: var(--gray-700);
}

/* Affichage des scores */
.score-display {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.1rem;
    text-align: center;
    min-width: 60px;
}

.score-display.completed {
    background: var(--success-solid);
    color: var,--white;
    box-shadow: var(--shadow-md);
}

.score-display.pending {
    background: var(--gray-200);
    color: var(--gray-600);
    font-style: italic;
}

/* Affichage des vainqueurs */
.winner-display {
    color: var(--success-solid);
    font-weight: 600;
}

.no-winner {
    color: var(--gray-400);
    font-style: italic;
}

/* Actions des matches */
.match-actions {
    display: flex;
    gap: var(--space-2);
}

.btn-edit-score {
    background: var(--accent);
    color: white;
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.btn-edit-score:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Lignes de tableau selon statut */
.match-completed {
    background: rgba(16, 185, 129, 0.05);
}

.match-pending {
    background: rgba(156, 163, 175, 0.05);
}

/* Barre de progression */
.progress-section {
    margin: var(--space-6) 0;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    margin-top: var(--space-3);
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-solid), var(--accent-solid));
    border-radius: var(--radius-full);
    transition: width var(--transition-slow);
}

.progress-text {
    font-weight: 600;
    color: var(--gray-700);
    min-width: 150px;
}

/* Mini barre de progression pour tableau */
.mini-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-1);
}

.mini-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-percentage {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 600;
}

/* Section de résumé des scores */
.scores-summary-section {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-6);
    margin: var(--space-6) 0;
}

/* Formulaire d'édition de score */
.score-form-section {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-xl);
    padding: var(--space-8);
    margin: var(--space-6) 0;
}

.score-rules-info {
    background: rgba(75, 85, 99, 0.1);
    border: 1px solid rgba(75, 85, 99, 0.2);
    border-radius: var(--radius-md);
    padding: var(--space-4);
    margin-bottom: var(--space-6);
}

.score-input-section {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: var(--space-6);
    align-items: center;
    margin: var(--space-6) 0;
}

.team-score-group,
.player-score-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.team-score-group label,
.player-score-group label {
    font-weight: 600;
    color: var(--gray-700);
}

.team-score-group select,
.player-score-group select {
    padding: var(--space-3);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    background: white;
    transition: all var(--transition-normal);
}

.team-score-group select:focus,
.player-score-group select:focus {
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.vs-separator {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-solid);
    text-align: center;
}

/* Exemples de scores */
.score-examples {
    margin-top: var(--space-6);
}

.score-examples h4 {
    margin-bottom: var(--space-3);
}

.examples {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.example-tag.valid {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-solid);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.example-tag.invalid {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-solid);
    border: 1px solid rgba(239, 68, 68, 0.3);
}


/* Garder seulement : */
.btn-save-score {
    background: var(--success);
    color: white;
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1.1rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
}

.btn-save-score:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.btn-view-scores {
    background: var(--accent);
    color: white;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    border: none;
    cursor: pointer;
}

/* Statistiques spéciales pour scores */
.stat-card.score-3-1 {
    border-left: 4px solid #f59e0b;
}

.stat-card.score-3-2 {
    border-left: 4px solid #10b981;
}

.stat-card.most-common {
    border-left: 4px solid var(--primary-solid);
}

.stat-card.completed {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Graphique de répartition */
.chart-container {
    margin: var(--space-4) 0;
}

.score-bar {
    display: flex;
    height: 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.score-3-1-bar {
    background: #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    transition: width var(--transition-slow);
}

.score-3-2-bar {
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    transition: width var(--transition-slow);
}

/* Responsive pour les scores */
@media (max-width: 768px) {
    .score-input-section {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .vs-separator {
        transform: rotate(90deg);
        margin: var(--space-2) 0;
    }

    .teams-display {
        font-size: 0.8rem;
    }

    .progress-bar-container {
        flex-direction: column;
        gap: var(--space-2);
    }

    .progress-text {
        min-width: auto;
        text-align: center;
    }
}

/* === Ajustements d'agrandissement terrain & chips joueurs === */
.badminton-court-large {
    max-width: 340px; /* élargi (avant ~220px) */
    height: 150px;    /* proportionnelle */
    padding: 10px;
}
.player-chip-large {
    width: 120px;      /* plus large */
    max-width: 120px;
    font-size: 0.75rem;
    white-space: normal;      /* autorise retour à la ligne */
    line-height: 1.1;
    overflow: visible;        /* ne coupe plus */
    text-overflow: unset;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;         /* un peu plus de padding */
}
/* Carte terrain plus aérée */
.terrain-card {
    padding: var(--space-4);
}
/* Ajustements responsive pour les nouvelles dimensions */
@media (max-width: 768px) {
  .badminton-court-large { max-width: 280px; height: 120px; }
  .player-chip-large { width: 100px; max-width: 100px; font-size: 0.7rem; }
}
@media (max-width: 480px) {
  .badminton-court-large { max-width: 220px; height: 100px; }
  .player-chip-large { width: 90px; max-width: 90px; font-size: 0.65rem; }
}

/* CSS CHIPS SIMPLIFIÉ - À ajouter à la fin de style.css
   ======================================== */

/* Container des chips */
.score-chips {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

/* Masquer les inputs radio */
.score-chips input[type="radio"] {
    display: none;
}

/* Style des chips */
.score-chips .chip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid #cbd5e1;
    background: white;
    color: #475569;
    font-weight: bold;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin: 0;
    padding: 0;
}

/* Hover */
.score-chips .chip:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Sélectionné */
.score-chips input[type="radio"]:checked + .chip {
    border-color: #667eea;
    background: #667eea;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.3);
}

/* Focus pour accessibilité */
.score-chips input[type="radio"]:focus + .chip {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Groupes de score */
.team-score-group,
.player-score-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Labels principaux */
.team-score-group > label:first-child,
.player-score-group > label:first-child {
    font-weight: 600;
    color: #374151;
    text-align: center;
    margin-bottom: 10px;
}

/* Responsive mobile */
@media (max-width: 480px) {
    .score-chips {
        gap: 10px;
    }

    .score-chips .chip {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
}

.error {
    background: rgba(239, 68, 68, 0.1) !important;
    border: 1px solid rgba(239, 68, 68, 0.3) !important;
    border-left: 4px solid #ef4444 !important;
    color: #dc2626 !important;
    padding: 15px !important;
    border-radius: 8px !important;
    margin: 15px 0 !important;
    white-space: pre-line; /* Pour afficher les \n comme des retours à la ligne */
    font-weight: 600;
}
/* TERRAIN DE BADMINTON RÉALISTE (proportions 13,40m x 6,10m) */
.badminton-court-large {
    position: relative;
    background: #2E7D32; /* Vert terrain */
    border: 3px solid #1565C0; /* Bordure bleue */
    border-radius: var(--radius-sm);
    margin: var(--space-3) 0;
    height: 100px; /* Proportion correcte */
    width: 100%;
    max-width: 220px; /* Proportion 13,40/6,10 ≈ 2.2:1 */
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    padding: 8px;
    box-shadow: var(--shadow-lg);
    margin: var(--space-3) auto; /* Centré */
}

/* Lignes du terrain (comme le schéma) */
.badminton-court-large::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    bottom: 8px;
    border: 2px solid #1565C0;
    pointer-events: none;
}

/* Lignes de service */
.badminton-court-large::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 8px;
    right: 8px;
    bottom: 20%;
    border-left: 2px solid #1565C0;
    border-right: 2px solid #1565C0;
    border-top: 2px solid #1565C0;
    border-bottom: 2px solid #1565C0;
    pointer-events: none;
}

/* Filet central (ligne pointillée comme sur le schéma) */
.court-net-large {
    position: absolute;
    left: 50%;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: repeating-linear-gradient(
            to bottom,
            #1565C0,
            #1565C0 4px,
            transparent 4px,
            transparent 8px
    );
    transform: translateX(-50%);
    z-index: 2;
}

/* Poteaux du filet */
.court-net-large::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: #1565C0;
    border-radius: 50%;
}

.court-net-large::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: -4px;
    width: 10px;
    height: 10px;
    background: #1565C0;
    border-radius: 50%;
}

/* Côtés du terrain (zones de jeu) */
.badminton-court-large .court-side-left,
.badminton-court-large .court-side-right {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    z-index: 3;
    position: relative;
}

/* Chips de joueurs adaptées au terrain réaliste */
.player-chip-large {
    background: rgba(255, 255, 255, 0.95);
    color: #1565C0;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
    width: 90%;
    max-width: 80px;
    border: 1px solid #1565C0;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-fast);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-chip-large:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
    background: #1565C0;
    color: white;
}

/* Footer avec infos en CHIPS (petit) */
.terrain-footer-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: center;
    padding: var(--space-2);
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: var(--space-2);
}

/* Chips d'information (petites) */
.info-chip {
    background: rgba(255, 255, 255, 0.8);
    color: var(--gray-700);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

/* Chips spécifiques */
.terrain-chip {
    background: var(--primary-solid);
    color: white;
}

.type-chip {
    background: var(--success-solid);
    color: white;
}

.score-chip.completed {
    background: var(--success-solid);
    color: var,--white;
}

.score-chip.pending {
    background: var(--gray-400);
    color: var,--white;
}

.action-chip {
    background: var(--accent-solid);
    color: white;
}

.action-chip:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* Responsive pour terrain réaliste */
@media (max-width: 768px) {
    .badminton-court-large {
        height: 80px;
        max-width: 176px; /* Garde les proportions */
        padding: 6px;
    }

    .player-chip-large {
        font-size: 0.65rem;
        padding: 1px 4px;
        max-width: 70px;
    }

    .terrain-footer-chips {
        gap: var(--space-1);
    }

    .info-chip {
        font-size: 0.65rem;
        padding: 2px var(--space-1);
    }
}

@media (max-width: 480px) {
    .badminton-court-large {
        height: 60px;
        max-width: 132px; /* Garde les proportions */
        padding: 4px;
    }

    .player-chip-large {
        font-size: 0.6rem;
        padding: 1px 3px;
        max-width: 60px;
    }

    .terrain-footer-chips {
        flex-direction: column;
        align-items: center;
    }

    .info-chip {
        font-size: 0.6rem;
    }
}

/* Indication visuelle pour double vs simple */
.terrain-card[data-type="double"] .badminton-court-large {
    background: #2E7D32; /* Vert pour double - terrain plus large */
}

.terrain-card[data-type="simple"] .badminton-court-large {
    background: #1565C0; /* Bleu pour simple - terrain plus étroit */
}

/* Lignes de délimitation spécifiques */
.terrain-card[data-type="double"] .badminton-court-large::before {
    border-color: #4CAF50; /* Vert clair pour double */
}

.terrain-card[data-type="simple"] .badminton-court-large::before {
    border-color: #2196F3; /* Bleu clair pour simple */
}

/* ========================================
   Rounds Management Specific Styles
   ======================================== */

.mini-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-bottom: var(--space-1);
}

.mini-progress-fill {
    height: 100%;
    background: var(--success);
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
}

.progress-percentage {
    font-size: 0.75rem;
    color: var(--gray-600);
    font-weight: 600;
}

.match-actions {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-edit-score,
.btn-view-scores {
    background: var(--accent);
    color: var(--white);
    border: none;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    text-decoration: none;
    display: inline-block;
}

.btn-edit-score:hover,
.btn-view-scores:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Score chips */
.score-chip {
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: none;
    display: inline-block;
}

.score-chip.completed {
    background: var(--success-solid);
    color: var,--white;
}

.score-chip.pending {
    background: var(--warning-solid);
    color: var,--white;
}

/* Responsive improvements for rounds tables */
@media (max-width: 768px) {
    .match-actions {
        flex-direction: column;
        gap: var(--space-1);
    }

    .btn-edit-score,
    .btn-view-scores {
        width: 100%;
        text-align: center;
        font-size: 0.8rem;
        padding: var(--space-1) var(--space-2);
    }

    .mini-progress-bar {
        height: 6px;
    }

    .progress-percentage {
        font-size: 0.7rem;
    }
}

.round-row {
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.round-row:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.round-row td {
    vertical-align: middle;
}

.round-id strong {
    font-size: 1rem;
    display: block;
    color: var(--gray-800);
}

.round-id span {
    font-size: 0.8rem;
    color: var(--gray-500);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--gray-100);
    color: var(--gray-600);
}

.status-badge.status-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-solid);
}

.status-badge.status-completed {
    background: rgba(102, 126, 234, 0.15);
    color: var(--primary-solid);
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning-solid);
}

.actions {
    justify-content: flex-end;
    align-items: center;
}

.actions .btn-sm {
    font-size: 0.8rem;
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    min-width: 90px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--gray-800);
}

.actions .btn-sm.btn-danger {
    background: var(--error);
    color: var(--white);
}

.actions .btn-sm.btn-primary {
    background: var(--primary);
    color: var(--white);
}

@media (max-width: 768px) {
    .round-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-2);
        padding: var(--space-3);
        background: var(--white);
        border-radius: var(--radius-lg);
        margin-bottom: var(--space-3);
        box-shadow: var(--shadow-sm);
    }

    .round-row td {
        border: none;
        padding: 0;
        text-align: left;
    }

    .round-row .status,
    .round-row .actions {
        grid-column: span 2;
    }

    .round-row .actions {
        justify-content: stretch;
        gap: var(--space-2);
    }

    .round-row .btn-sm {
        width: 100%;
    }
}

/* Container pour organiser les terrains */
.terrains-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
}

.terrain-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--space-3);
    transition: all var(--transition-normal);
}

.terrain-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.terrain-card.active {
    border-color: var(--success-solid);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3);
}

@media (max-width: 768px) {
    .terrains-container {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: var(--space-3);
    }
}

@media (max-width: 480px) {
    .terrains-container {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }
}

/* Animation des chips de joueurs au survol */
.terrain-card:hover .player-chip-large {
    animation: pulse 0.5s ease-in-out;
}

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

/* CSS pour drag & drop */
.draggable[draggable="true"] {
    cursor: grab;
    transition: opacity 0.2s;
 }

.draggable[draggable="true"]:hover {
    transform: scale(1.05);
}

.drop-zone {
    transition: background-color 0.2s;
}

.drop-zone:hover {
    background: rgba(76, 175, 80, 0.1);
}

.draggable[draggable="false"] {
    cursor: not-allowed;
    opacity: 0.6;
}

/* === STYLES POUR LES CARTES DRAGGABLES === */

/* Container principal pour la sélection */
.players-selection-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 1024px) {
    .players-selection-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Zones de drag and drop */
.players-zone {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px;
    min-height: 400px;
    transition: all 0.3s ease;
}

@media (max-width: 640px) {
    .players-zone {
        min-height: 280px;
        padding: var(--space-3);
    }

    .players-cards-container {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        max-height: 240px;
    }
}

.players-zone:hover {
    border-color: rgba(64, 224, 208, 0.5);
    background: rgba(64, 224, 208, 0.05);
}

.players-zone h3 {
    margin: 0 0 20px 0;
    font-size: 1.2em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.players-zone .count {
    background: var(--primary-solid);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
}

/* Container des cartes */
.players-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    grid-auto-rows: minmax(52px, auto);
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 5px;
    align-content: flex-start;
}

/* Scrollbar custom */
.players-cards-container::-webkit-scrollbar {
    width: 8px;
}

.players-cards-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.players-cards-container::-webkit-scrollbar-thumb {
    background: var(--primary-solid);
    border-radius: 4px;
}

.players-cards-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Cartes joueurs */
.player-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.player-card::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;
}

.player-card:hover::before {
    left: 100%;
}

.player-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-solid);
}

.player-card:active {
    transform: scale(0.98);
}

/* Cartes disponibles */
.available-card {
    border-left: 4px solid var(--secondary-solid);
}

.available-card:hover {
    border-left-color: var(--primary-solid);
    background: rgba(64, 224, 208, 0.1);
}

/* Cartes présentes */
.present-card {
    border-left: 4px solid var(--success-solid);
    background: rgba(76, 175, 80, 0.1);
}

.present-card:hover {
    border-left-color: var(--success-solid);
    background: rgba(76, 175, 80, 0.2);
}

/* Informations du joueur */
.player-info {
    flex: 1;
}

.player-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.player-id {
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.player-date {
    font-size: 0.8em;
    color: var(--text-muted);
}

/* Action de la carte */
.card-action {
    margin-left: 15px;
}

.action-icon {
    font-size: 1.2em;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.player-card:hover .action-icon {
    opacity: 1;
    transform: scale(1.2);
}

/* Zone vide */
.empty-zone {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-style: italic;
}

.empty-zone p {
    margin: 5px 0;
    line-height: 1.5;
}

/* Section des actions */
.actions-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.stats-info {
    color: var(--text-primary);
    font-size: 1.1em;
    font-weight: 500;
}

.action-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Loading state styling */
.loading-state {
    text-align: center;
    padding: var(--space-8) var(--space-4);
    color: var(--gray-500);
}

.loading-state p {
    margin: var(--space-2) 0;
}

.loading-state p:first-child {
    font-weight: 600;
    color: var(--primary-solid);
}

/* ========================================
   Layouts pour les Scores
   ======================================== */

.terrain-with-side-scores {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.score-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.score-column-left { order: 0; }
.badminton-court-large { order: 1; }
.score-column-right { order: 2; }
.external-score.score-chip {
  background: #4facfe;
  color: #fff;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.external-score.score-chip:hover { transform: scale(1.1); box-shadow: var(--shadow-md); }
.external-score.selected { background:#ff9800 !important; color:#fff; box-shadow:0 0 0 2px rgba(255,152,0,.35); }
.external-score.clicked { background:#ffcc80 !important; color:#664200; box-shadow:0 0 0 1px rgba(255,152,0,.25); }
.external-score.final { background:#2e7d32; }
.external-score.final.selected { background:#1b5e20; }
.external-score:not(.final):active { background:#ffd54f; transform:scale(1.12); }
.external-score.selected:not(.final):active { background:#ffb300; }
/* Animation flash optionnelle */
.external-score.flash { animation: flash-score .35s ease; }
@keyframes flash-score { 0%{box-shadow:0 0 0 0 rgba(255,152,0,.8);} 70%{box-shadow:0 0 0 8px rgba(255,152,0,0);} 100%{box-shadow:0 0 0 0 rgba(255,152,0,0);} }

/* Styles permanents pour winner/loser des scores */
.external-score.winner { background:#2e7d32 !important; color:#fff; box-shadow:0 0 0 2px rgba(46,125,50,.45); }
.external-score.loser { background:#9e9e9e !important; color:#fff; opacity:.85; }
/* Maintenir l'orange même après completion si selected */
.external-score.selected.winner { background:#2e7d32 !important; border:3px solid #ff9800; }
.external-score.selected.loser { background:#9e9e9e !important; border:3px solid #ff9800; }

/* === Overrides explicites pour états des score chips (toggle + finalisation) === */
.terrain-card .score-chip.external-score {
  background:#4facfe;
  color:#fff;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.terrain-card .score-chip.external-score.selected {
  background:#ff9800 !important;
  color:#fff;
  box-shadow:0 0 0 2px rgba(255,152,0,.35);
}
.terrain-card .score-chip.external-score.clicked {
  background:#ffcc80 !important;
  color:#664200;
  box-shadow:0 0 0 1px rgba(255,152,0,.25);
}
.terrain-card .score-chip.external-score.winner {
  background:#2e7d32 !important;
  color:#fff;
  box-shadow:0 0 0 2px rgba(46,125,50,.45);
}
.terrain-card .score-chip.external-score.loser {
  background:#9e9e9e !important;
  color:#fff;
  box-shadow:0 0 0 1px rgba(0,0,0,.15) inset;
  opacity:.9;
}
/* État actif (mousedown) seulement pour non finalisés */
.terrain-card .score-chip.external-score:not(.winner):not(.loser):active {
  transform:scale(1.08);
  background:#ffd54f;
}

@media (max-width: 640px) {
  .terrain-with-side-scores {
      flex-direction: column;
      align-items: stretch;
      gap: var(--space-3);
  }

  .score-column {
      flex-direction: row;
      justify-content: center;
      flex-wrap: wrap;
      gap: var(--space-2);
      width: 100%;
  }

  .score-column-left, 
  .score-column-right, 
  .badminton-court-large {
      order: unset;
  }

  .score-column .score-chip {
      flex: 1;
      min-width: 48px;
      max-width: 72px;
  }

  .external-score.score-chip {
      width: clamp(44px, 12vw, 54px);
      height: clamp(44px, 12vw, 54px);
      font-size: 0.9rem;
  }
}

/* === Overrides pour les cartes de joueur en attente === */

/* Carte de joueur en attente */
.terrain-card.standby-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-md);
    padding: var(--space-4);
    border-radius: var(--radius-xl);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-3);
    min-height: 150px; /* Ajuster si nécessaire */
}

.standby-content {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-grow: 1;
}

.player-chip-large.standby-player {
    background: var(--gray-700); /* Couleur neutre plus foncée pour l'attente */
    color: var(--white);
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px; /* Ajuster si nécessaire */
    border: 1px solid var(--gray-600);
}

.terrain-card.standby-card .terrain-footer-chips {
    margin-top: var(--space-3);
}

.terrain-card.standby-card .info-chip.terrain-chip {
    background: var(--gray-600); /* Correspond à la couleur du chip du joueur en attente */
    color: var(--white);
    border: 1px solid var(--gray-500);
}
