/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== PWA MOBILE OPTIMIZATION ===== */
/* Design System - CSS Custom Properties */
:root {
    /* iOS Safe Area Support */
    --safe-area-inset-top: env(safe-area-inset-top);
    --safe-area-inset-right: env(safe-area-inset-right);
    --safe-area-inset-bottom: env(safe-area-inset-bottom);
    --safe-area-inset-left: env(safe-area-inset-left);

    /* Award-Winning Color Palette - Steve Jobs Inspired */
    --deep-space: #0D1117;
    --space-gray: #1C1C1E;
    --space-gray-2: #2C2C2E;
    --space-gray-3: #3A3A3C;
    --space-gray-4: #48484A;
    --space-gray-5: #636366;
    --space-gray-6: #8E8E93;

    /* Apple Electric Blue */
    --electric-blue: #007AFF;
    --electric-blue-dark: #0056CC;
    --electric-blue-alpha-20: rgba(0, 122, 255, 0.2);
    --electric-blue-alpha-30: rgba(0, 122, 255, 0.3);

    /* Warm Gold Accents */
    --warm-gold: #FFD60A;
    --warm-gold-alpha-20: rgba(255, 214, 10, 0.2);
    --warm-gold-alpha-30: rgba(255, 214, 10, 0.3);

    /* Premium White */
    --premium-white: #FFFFFF;
    --soft-white: #F2F2F7;

    /* Gradients */
    --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 25%, #0f3460 50%, #007AFF 100%);
    --gradient-button: linear-gradient(135deg, #007AFF 0%, #409CFF 100%);
    --gradient-gold: linear-gradient(135deg, #FFD60A 0%, #F2C94C 100%);

    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --glass-backdrop: blur(20px);

    /* Neumorphic Shadows - Apple Style */
    --neumorphic-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 2px 8px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);

    --neumorphic-hover-shadow:
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 8px 24px rgba(0, 122, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);

    /* Animation System */
    --timing-snappy: 0.2s;
    --timing-normal: 0.3s;
    --timing-deliberate: 0.5s;
    --easing-standard: cubic-bezier(0.4, 0, 0.2, 1);
    --easing-decelerate: cubic-bezier(0, 0, 0.2, 1);
    --easing-accelerate: cubic-bezier(0.4, 0, 1, 1);
    --easing-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);

    --accent-50: #fdf4ff;
    --accent-100: #fae8ff;
    --accent-200: #f5d0fe;
    --accent-300: #f0abfc;
    --accent-400: #e879f9;
    --accent-500: #d946ef;
    --accent-600: #c026d3;
    --accent-700: #a21caf;
    --accent-800: #86198f;
    --accent-900: #701a75;

    --neutral-0: #ffffff;
    --neutral-25: #fefefe;
    --neutral-50: #fafafa;
    --neutral-100: #f5f5f5;
    --neutral-200: #e5e5e5;
    --neutral-300: #d4d4d4;
    --neutral-400: #a3a3a3;
    --neutral-500: #737373;
    --neutral-600: #525252;
    --neutral-700: #404040;
    --neutral-800: #262626;
    --neutral-900: #171717;
    --neutral-950: #0a0a0a;

    --success-50: #ecfdf5;
    --success-100: #d1fae5;
    --success-500: #10b981;
    --success-600: #059669;
    --success-700: #047857;

    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-500: #f59e0b;
    --warning-600: #d97706;

    --error-50: #fef2f2;
    --error-100: #fee2e2;
    --error-500: #ef4444;
    --error-600: #dc2626;

    /* Semantic Color Mappings */
    --color-bg-primary: var(--neutral-0);
    --color-bg-secondary: var(--neutral-50);
    --color-bg-tertiary: var(--neutral-100);
    --color-bg-elevated: var(--neutral-25);

    --color-text-primary: var(--neutral-900);
    --color-text-secondary: var(--neutral-600);
    --color-text-tertiary: var(--neutral-500);
    --color-text-inverse: var(--neutral-0);

    --color-border-primary: var(--neutral-200);
    --color-border-secondary: var(--neutral-300);
    --color-border-focus: var(--primary-500);

    /* Typography System */
    --font-family-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    --font-family-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Font Sizes - Fluid Typography */
    --font-size-xs: clamp(0.7rem, 0.66vw + 0.56rem, 0.75rem);
    --font-size-sm: clamp(0.8rem, 0.8vw + 0.64rem, 0.875rem);
    --font-size-base: clamp(0.9rem, 1vw + 0.7rem, 1rem);
    --font-size-lg: clamp(1rem, 1.2vw + 0.8rem, 1.125rem);
    --font-size-xl: clamp(1.1rem, 1.5vw + 0.85rem, 1.25rem);
    --font-size-2xl: clamp(1.3rem, 2vw + 1rem, 1.5rem);
    --font-size-3xl: clamp(1.6rem, 2.5vw + 1.2rem, 1.875rem);
    --font-size-4xl: clamp(2rem, 3vw + 1.5rem, 2.25rem);
    --font-size-5xl: clamp(2.5rem, 4vw + 1.8rem, 3rem);
    --font-size-6xl: clamp(3rem, 5vw + 2.2rem, 3.75rem);

    /* Font Weights */
    --font-weight-thin: 100;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
    --font-weight-black: 900;

    /* Line Heights */
    --line-height-none: 1;
    --line-height-tight: 1.25;
    --line-height-snug: 1.375;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.625;
    --line-height-loose: 2;

    /* Letter Spacing */
    --letter-spacing-tighter: -0.05em;
    --letter-spacing-tight: -0.025em;
    --letter-spacing-normal: 0em;
    --letter-spacing-wide: 0.025em;
    --letter-spacing-wider: 0.05em;
    --letter-spacing-widest: 0.1em;

    /* 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;

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

    /* Enhanced Shadow System */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-base: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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 rgba(0, 0, 0, 0.25);
    --shadow-inner: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.25);
    --shadow-colored: 0 10px 25px -5px rgba(102, 126, 234, 0.25), 0 8px 10px -6px rgba(102, 126, 234, 0.1);

    /* Enhanced Transitions & Animations */
    --transition-fast: 150ms ease-out;
    --transition-base: 250ms ease-out;
    --transition-slow: 350ms ease-out;
    --ease-spring: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --ease-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
    --transition-all: all var(--transition-base) var(--ease-spring);
}

/* Prevent content from appearing behind iOS status bar/notch */
body {
    padding-top: var(--safe-area-inset-top);
    padding-left: var(--safe-area-inset-left);
    padding-right: var(--safe-area-inset-right);
    padding-bottom: var(--safe-area-inset-bottom);
}

/* Ensure proper mobile viewport handling */
html {
    height: 100%;
    height: 100vh;
    height: 100dvh;
}

body {
    min-height: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    font-family: var(--font-family-primary);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    letter-spacing: var(--letter-spacing-normal);
    color: var(--color-text-primary);
    background: linear-gradient(135deg, #ffffff 0%, #f0f9ff 20%, #38bdf8 80%, #0284c7 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1, "liga" 1, "calt" 1;
}

/* ===== DESIGN SYSTEM COMPONENTS ===== */

/* Typography Scale - Enhanced Hierarchy */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-primary);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    margin: 0;
    color: var(--color-text-primary);
    text-wrap: balance; /* Better text wrapping for headings */
}

/* Display Headings - For hero sections and major titles */
.display-1 {
    font-size: var(--font-size-6xl);
    font-weight: var(--font-weight-black);
    line-height: var(--line-height-none);
    letter-spacing: var(--letter-spacing-tighter);
}

.display-2 {
    font-size: var(--font-size-5xl);
    font-weight: var(--font-weight-extrabold);
    line-height: var(--line-height-none);
    letter-spacing: var(--letter-spacing-tighter);
}

.display-3 {
    font-size: var(--font-size-4xl);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
}

/* Standard Headings */
h1 {
    font-size: var(--font-size-3xl);
    font-weight: var(--font-weight-bold);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-6);
}

h2 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    letter-spacing: var(--letter-spacing-tight);
    margin-bottom: var(--space-5);
}

h3 {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-4);
}

h4 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-3);
}

h5 {
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    margin-bottom: var(--space-2);
}

h6 {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    color: var(--secondary-600);
    margin-bottom: var(--space-2);
}

/* Text Styles */
p {
    margin: 0 0 var(--space-4) 0;
    line-height: var(--line-height-relaxed);
}

.lead {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-relaxed);
    color: var(--secondary-700);
}

.subtitle {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-normal);
    color: var(--secondary-600);
    line-height: var(--line-height-normal);
}

.caption {
    font-size: var(--font-size-sm);
    color: var(--secondary-500);
    line-height: var(--line-height-normal);
}

.overline {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-widest);
    color: var(--secondary-500);
}

/* Semantic Text Styles */
.text-muted { color: var(--secondary-500); }
.text-emphasized { font-weight: var(--font-weight-semibold); }
.text-subtle { color: var(--secondary-400); }

/* Code and Monospace */
code, pre {
    font-family: var(--font-family-mono);
    font-size: 0.875em;
}

code {
    background: var(--secondary-100);
    color: var(--secondary-800);
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    font-weight: var(--font-weight-medium);
}

pre {
    background: var(--secondary-900);
    color: var(--secondary-100);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    overflow-x: auto;
    line-height: var(--line-height-relaxed);
}

/* Lists */
ul, ol {
    margin: 0 0 var(--space-4) 0;
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-1);
    line-height: var(--line-height-relaxed);
}

/* Links */
a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
    text-decoration: underline;
}

a:focus {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-family-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    line-height: 1;
    border: 1px solid transparent;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Button Variants */
.btn-primary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--premium-white);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(12px);
}

.btn-primary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-success {
    background-color: var(--success-600);
    color: white;
    border-color: var(--success-600);
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    background-color: var(--success-700);
    border-color: var(--success-700);
}

.btn-danger {
    background-color: var(--error-600);
    color: white;
    border-color: var(--error-600);
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background-color: var(--error-700);
    border-color: var(--error-700);
}

.btn-ghost {
    background-color: transparent;
    color: var(--secondary-600);
    border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
    background-color: var(--secondary-100);
    color: var(--secondary-700);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: var(--font-size-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--font-size-base);
}

.btn-xl {
    padding: var(--space-5) var(--space-8);
    font-size: var(--font-size-lg);
}

/* Button Icons */
.btn-icon-only {
    padding: var(--space-3);
    aspect-ratio: 1;
}

.btn-icon-only.btn-sm {
    padding: var(--space-2);
}

.btn-icon-only.btn-lg {
    padding: var(--space-4);
}

/* Ripple Effect */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
    pointer-events: none;
}

.btn.ripple::after {
    width: 300px;
    height: 300px;
}

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

.form-group label {
    display: block;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--secondary-700);
    margin-bottom: var(--space-2);
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--secondary-900);
    background: white;
    border: 1px solid var(--secondary-300);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
    outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-input:disabled, .form-select:disabled, .form-textarea:disabled {
    background-color: var(--secondary-50);
    color: var(--secondary-500);
    cursor: not-allowed;
}

.form-helper-text {
    font-size: var(--font-size-sm);
    color: var(--secondary-500);
    margin-top: var(--space-1);
}

.form-error {
    color: var(--error-600);
    font-size: var(--font-size-sm);
    margin-top: var(--space-1);
}

.form-input.error {
    border-color: var(--error-500);
}

.form-input.error:focus {
    border-color: var(--error-500);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Card System - Apple-Inspired Dark Design */
.card {
    background: var(--space-gray);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    box-shadow: var(--neumorphic-shadow);
    backdrop-filter: var(--glass-backdrop);
    overflow: hidden;
    transition: all var(--transition-smooth);
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--electric-blue-alpha-30), transparent);
    opacity: 0;
    transition: all var(--transition-smooth);
}

.card:hover {
    box-shadow: var(--neumorphic-shadow), 0 0 20px var(--electric-blue-alpha-20);
    border-color: var(--electric-blue-alpha-30);
    transform: translateY(-4px);
}

.card:hover::before {
    opacity: 1;
}

.card-header {
    padding: var(--space-6) var(--space-6) var(--space-4);
    border-bottom: 1px solid var(--color-border-primary);
    background: var(--color-bg-tertiary);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-4) var(--space-6);
    border-top: 1px solid var(--color-border-primary);
    background: var(--color-bg-tertiary);
}

/* Badge System */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    border-radius: var(--radius-full);
    white-space: nowrap;
}

.badge-primary {
    background-color: var(--primary-100);
    color: var(--primary-700);
}

.badge-secondary {
    background-color: var(--secondary-100);
    color: var(--secondary-700);
}

.badge-success {
    background-color: var(--success-50);
    color: var(--success-700);
}

.badge-warning {
    background-color: var(--warning-50);
    color: var(--warning-600);
}

.badge-error {
    background-color: var(--error-50);
    color: var(--error-700);
}

/* Typography Utility Classes */

/* Font Sizes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }
.text-6xl { font-size: var(--font-size-6xl); }

/* Font Weights */
.font-thin { font-weight: var(--font-weight-thin); }
.font-light { font-weight: var(--font-weight-light); }
.font-normal { font-weight: var(--font-weight-normal); }
.font-medium { font-weight: var(--font-weight-medium); }
.font-semibold { font-weight: var(--font-weight-semibold); }
.font-bold { font-weight: var(--font-weight-bold); }
.font-extrabold { font-weight: var(--font-weight-extrabold); }
.font-black { font-weight: var(--font-weight-black); }

/* Line Heights */
.leading-none { line-height: var(--line-height-none); }
.leading-tight { line-height: var(--line-height-tight); }
.leading-snug { line-height: var(--line-height-snug); }
.leading-normal { line-height: var(--line-height-normal); }
.leading-relaxed { line-height: var(--line-height-relaxed); }
.leading-loose { line-height: var(--line-height-loose); }

/* Letter Spacing */
.tracking-tighter { letter-spacing: var(--letter-spacing-tighter); }
.tracking-tight { letter-spacing: var(--letter-spacing-tight); }
.tracking-normal { letter-spacing: var(--letter-spacing-normal); }
.tracking-wide { letter-spacing: var(--letter-spacing-wide); }
.tracking-wider { letter-spacing: var(--letter-spacing-wider); }
.tracking-widest { letter-spacing: var(--letter-spacing-widest); }

/* Text Transforms */
.uppercase { text-transform: uppercase; }
.lowercase { text-transform: lowercase; }
.capitalize { text-transform: capitalize; }
.normal-case { text-transform: none; }

/* Text Alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-justify { text-align: justify; }

/* Smart Text Truncation */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.truncate-4 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Text Wrapping */
.text-wrap { text-wrap: wrap; }
.text-nowrap { text-wrap: nowrap; }
.text-balance { text-wrap: balance; }
.text-pretty { text-wrap: pretty; }

/* Word Breaking */
.break-normal { word-break: normal; overflow-wrap: normal; }
.break-words { overflow-wrap: break-word; }
.break-all { word-break: break-all; }

/* Font Variants */
.font-mono { font-family: var(--font-family-mono); }
.font-sans { font-family: var(--font-family-primary); }

/* Text Decoration */
.underline { text-decoration: underline; }
.line-through { text-decoration: line-through; }
.no-underline { text-decoration: none; }

/* Gradient Text */
.text-gradient {
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: var(--font-weight-bold);
}

.text-gradient-brand {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-700) 50%, var(--accent-600) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: var(--font-weight-bold);
}

/* Reading Experience Enhancements */
.prose {
    max-width: 65ch;
    font-size: var(--font-size-base);
    line-height: var(--line-height-relaxed);
    color: var(--secondary-700);
}

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
    color: var(--secondary-900);
    font-weight: var(--font-weight-bold);
}

.prose h1 { margin-top: 0; margin-bottom: var(--space-8); }
.prose h2 { margin-top: var(--space-10); margin-bottom: var(--space-6); }
.prose h3 { margin-top: var(--space-8); margin-bottom: var(--space-4); }
.prose h4 { margin-top: var(--space-6); margin-bottom: var(--space-3); }

.prose p { margin-bottom: var(--space-6); }
.prose ul, .prose ol { margin-bottom: var(--space-6); }
.prose li { margin-bottom: var(--space-2); }

/* Focus Styles for Better Accessibility */
.focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* Selection Styling */
::selection {
    background-color: var(--primary-100);
    color: var(--primary-900);
}

::-moz-selection {
    background-color: var(--primary-100);
    color: var(--primary-900);
}

.text-primary { color: var(--color-text-primary); }
.text-secondary { color: var(--color-text-secondary); }
.text-tertiary { color: var(--color-text-tertiary); }
.text-inverse { color: var(--color-text-inverse); }

.text-brand { color: var(--primary-600); }
.text-accent { color: var(--accent-600); }
.text-success { color: var(--success-600); }
.text-warning { color: var(--warning-600); }
.text-error { color: var(--error-600); }

.bg-primary { background-color: var(--color-bg-primary); }
.bg-secondary { background-color: var(--color-bg-secondary); }
.bg-tertiary { background-color: var(--color-bg-tertiary); }
.bg-elevated { background-color: var(--color-bg-elevated); }

.bg-brand { background-color: var(--primary-600); }
.bg-accent { background-color: var(--accent-600); }
.bg-success { background-color: var(--success-600); }
.bg-warning { background-color: var(--warning-600); }
.bg-error { background-color: var(--error-600); }

.rounded-sm { border-radius: var(--radius-sm); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-full { border-radius: var(--radius-full); }

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

/* ===== DEVICE EXPERIENCE PROTECTION ===== */
/* Desktop-only features - hidden on mobile to prevent conflicts */
@media (max-width: 1024px) {
    .desktop-only {
        display: none !important;
    }
}

/* Mobile-only features - hidden on desktop to prevent conflicts */
@media (min-width: 1025px) {
    .mobile-only {
        display: none !important;
    }
}

/* Ensure desktop functionality is preserved with fallbacks */
@media (min-width: 1025px) {
    .desktop-preserve {
        /* Maintains original desktop behavior regardless of mobile changes */
    }
}

/* ===== NATIVE MOBILE INTERACTIONS ===== */
/* Pull-to-refresh indicator */
.pull-to-refresh-indicator {
    position: absolute;
    top: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1000;
}

.pull-to-refresh-indicator.active {
    opacity: 1;
}

/* Pull-to-refresh removed per user request */

/* Header Actions Container */
.header-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
}

/* PWA Install Button */
.install-app-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.install-app-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.install-app-btn:active {
    transform: translateY(0);
}

.install-icon {
    font-size: 16px;
}

.install-text {
    font-size: 12px;
}

/* Mobile responsiveness for install button */
@media (max-width: 480px) {
    .install-text {
        display: none;
    }

    .install-app-btn {
        padding: 8px;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
}
    top: 20px;
}

.pull-to-refresh-indicator .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #4f46e5;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Swipe gesture feedback */
.swipe-feedback {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.swipe-feedback.left {
    left: 20px;
}

.swipe-feedback.right {
    right: 20px;
}

.swipe-feedback.show {
    opacity: 1;
}

/* Touch ripple effect for buttons */
.btn {
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.btn.ripple::after {
    width: 300px;
    height: 300px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: var(--space-16);
    right: var(--space-5);
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary-600) 0%, var(--accent-600) 100%);
    color: var(--color-text-inverse);
    border: none;
    box-shadow: 0 8px 25px rgba(14, 165, 233, 0.25), 0 3px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.05) translateY(-2px);
    background: linear-gradient(135deg, var(--primary-700) 0%, var(--accent-700) 100%);
    box-shadow: 0 12px 40px rgba(14, 165, 233, 0.35), 0 6px 15px rgba(0, 0, 0, 0.15);
}

.fab:active {
    transform: scale(0.95) translateY(-1px);
}

/* Native scroll indicators for overflowing content */
.scroll-indicator {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 50px;
    background: rgba(79, 70, 229, 0.2);
    border-radius: 1px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.scroll-indicator.visible {
    opacity: 1;
}

/* Smooth scrolling for all containers */
.tab-content,
.teams-grid,
.players-list,
.substitutions-list {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Context menu for long press gestures */
.context-menu {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    border-radius: 12px;
    padding: 8px 0;
    min-width: 160px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: scale(0.9);
    animation: contextMenuAppear 0.2s ease forwards;
}

@keyframes contextMenuAppear {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.context-menu-item {
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.context-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.context-menu-item:first-child {
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.context-menu-item:last-child {
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

/* Enhanced mobile animations */
@media (max-width: 1024px) {
    .btn,
    .nav-item,
    .team-card,
    .player-item {
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .btn:active,
    .nav-item:active,
    .team-card:active,
    .player-item:active {
        transform: scale(0.98);
    }

    /* Optimize animations for mobile performance */
    * {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    /* Smooth page transitions */
    .tab-content {
        transform: translateZ(0);
        will-change: transform, opacity;
    }

    .tab-content.entering {
        animation: slideInRight 0.3s ease;
    }

    .tab-content.leaving {
        animation: slideOutLeft 0.3s ease;
    }

    @keyframes slideInRight {
        from {
            transform: translateX(100%);
            opacity: 0;
        }
        to {
            transform: translateX(0);
            opacity: 1;
        }
    }

    @keyframes slideOutLeft {
        from {
            transform: translateX(0);
            opacity: 1;
        }
        to {
            transform: translateX(-100%);
            opacity: 0;
        }
    }

    /* Loading state animations */
    .loading {
        opacity: 0.6;
        pointer-events: none;
        transform: scale(0.98);
        filter: brightness(0.9);
    }

    /* Success animations */
    .success-pulse {
        animation: successPulse 0.6s ease;
    }

    @keyframes successPulse {
        0%, 100% {
            transform: scale(1);
        }
        50% {
            transform: scale(1.05);
            box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
        }
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gradient-hero);
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    color: var(--premium-white);
    /* Safe area support for notched devices */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
    /* Prevent zoom on double tap */
    touch-action: manipulation;
    /* Optimize text rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== SPLASH SCREEN ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    color: white;
    animation: splashFadeIn 1s ease;
}

.splash-logo {
    position: relative;
    display: inline-block;
    margin-bottom: 24px;
}

.splash-icon {
    font-size: 80px;
    display: block;
    animation: bounceIn 1.2s ease;
    position: relative;
    z-index: 2;
}

.splash-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: pulse 2s infinite;
    z-index: 1;
}

.splash-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 8px 0;
    letter-spacing: -0.5px;
    animation: slideUpIn 1s ease 0.3s both;
}

.splash-subtitle {
    font-size: 16px;
    margin: 0 0 32px 0;
    opacity: 0.9;
    font-weight: 400;
    animation: slideUpIn 1s ease 0.5s both;
}

.splash-loading {
    animation: slideUpIn 1s ease 0.7s both;
}

.loading-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out both;
}

.loading-dots .dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dots .dot:nth-child(2) { animation-delay: -0.16s; }
.loading-dots .dot:nth-child(3) { animation-delay: 0s; }

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

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
}

@keyframes dotPulse {
    0%, 80%, 100% {
        transform: scale(0);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===== PWA INSTALL PROMPTS ===== */
.install-prompt {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-prompt.show {
    transform: translateY(0);
    opacity: 1;
}

.install-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 16px;
}

.install-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.install-text {
    flex: 1;
}

.install-text h3 {
    margin: 0 0 4px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
}

.install-text p {
    margin: 0;
    font-size: 14px;
    color: #6b7280;
}

.install-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.install-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 8px;
}

/* Install success toast */
.install-success-toast {
    position: fixed;
    top: 20px;
    left: 20px;
    right: 20px;
    background: #059669;
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3);
    z-index: 10000;
    transform: translateY(-100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.install-success-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-text p {
    margin: 0;
    font-size: 14px;
    opacity: 0.9;
}

/* Mobile optimizations for install prompts */
@media (max-width: 1024px) {
    .install-prompt {
        bottom: calc(80px + env(safe-area-inset-bottom));
        left: 16px;
        right: 16px;
    }

    .install-content {
        padding: 12px;
        gap: 12px;
    }

    .install-text h3 {
        font-size: 15px;
    }

    .install-text p {
        font-size: 13px;
    }

    .install-actions .btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .install-success-toast {
        top: calc(20px + env(safe-area-inset-top));
        left: 16px;
        right: 16px;
    }
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 1;
    min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

/* Enhanced safe area support */
@supports (height: 100dvh) {
    .app-container {
        height: 100dvh;
        min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
}

/* Status bar overlay for standalone mode */
@media (display-mode: standalone) {
    body {
        /* Remove safe area padding in standalone mode - handled per element */
        padding: 0;
    }

    .app-container {
        /* Full height in standalone mode */
        height: 100vh;
        height: 100dvh;
        min-height: 100vh;
        min-height: 100dvh;
    }

    /* Status bar area styling */
    .app-header {
        padding-top: max(env(safe-area-inset-top), 20px);
        background: white;
    }

    /* Bottom navigation safe area */
    .native-nav {
        padding-bottom: max(env(safe-area-inset-bottom), 8px);
    }

    /* FAB positioning in standalone mode */
    .fab {
        bottom: calc(80px + max(env(safe-area-inset-bottom), 0px));
    }
}


/* Legacy button styles removed - using new design system above */

/* Content Area */
.content-area {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: calc(100vh - 56px); /* Subtract only streamlined nav height (header now hidden) */
}

.tab-content {
    display: none;
    height: 100%;
    overflow-y: auto;
    padding: 96px 0 100px 0; /* Top padding for floating header */
    box-sizing: border-box;
    background: transparent;
}

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

.tab-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-2);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
}

.section-header:hover {
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.section-header h2 {
    color: #333;
    font-size: var(--font-size-2xl);
    font-weight: 600;
    letter-spacing: -0.02em;
    margin: 0;
    text-wrap: balance;
}

/* Overlay Sections */
.overlay-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #f8fafc;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px 20px 100px 20px;
}

/* Cards */
.card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h2 {
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

/* Teams List */
.teams-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(560px, 1fr));
    gap: var(--space-4);
}

.team-card {
    background: var(--space-gray);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: var(--space-4);
    cursor: pointer;
    transition: all var(--transition-smooth);
    box-shadow: var(--neumorphic-shadow);
    backdrop-filter: var(--glass-backdrop);
    position: relative;
}

.team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--electric-blue-alpha-30), transparent);
    opacity: 0;
    transition: all var(--transition-smooth);
}

.team-card:hover {
    border-color: var(--electric-blue-alpha-30);
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--neumorphic-shadow), 0 0 24px var(--electric-blue-alpha-20);
}

.team-card:hover::before {
    opacity: 1;
}

/* Apple-inspired selected team indicator */
.team-card.selected {
    border: 2px solid var(--electric-blue);
    background: var(--space-gray-2);
    box-shadow: var(--neumorphic-shadow),
                0 0 32px var(--electric-blue-alpha-30),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    transform: translateY(-4px);
}

.team-card.selected::before {
    opacity: 1;
    background: linear-gradient(90deg, transparent, var(--electric-blue), transparent);
}

/* Apple-inspired selected badge */
@media (min-width: 1025px) {
    .team-card.selected::after {
        content: '✓ SELECTED';
        position: absolute;
        top: var(--space-4);
        right: var(--space-4);
        background: var(--electric-blue);
        color: var(--premium-white);
        padding: var(--space-2) var(--space-3);
        border-radius: var(--radius-full);
        font-size: var(--font-size-xs);
        font-weight: var(--font-weight-semibold);
        letter-spacing: var(--letter-spacing-wide);
        box-shadow: 0 4px 12px var(--electric-blue-alpha-30),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(8px);
        z-index: 10;
        animation: selectedPulse 2s ease-in-out infinite;
    }

    .team-card.selected:hover {
        transform: translateY(-4px);
        box-shadow: var(--neumorphic-shadow),
                    0 0 40px var(--electric-blue-alpha-30);
    }
}

@keyframes selectedPulse {
    0%, 100% { box-shadow: 0 4px 12px var(--electric-blue-alpha-30), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
    50% { box-shadow: 0 4px 20px var(--electric-blue-alpha-30), inset 0 1px 0 rgba(255, 255, 255, 0.2); }
}

.team-card h3 {
    color: var(--premium-white);
    margin-bottom: var(--space-2);
    font-size: var(--font-size-xl);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.team-card p {
    color: var(--space-gray-6);
    font-size: var(--font-size-sm);
    margin-bottom: var(--space-4);
    letter-spacing: -0.01em;
}

.team-card .team-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
}

.team-card .team-actions .btn {
    padding: 6px 12px;
    font-size: 0.875rem;
}



.team-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.team-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
}

.team-title {
    flex: 1;
}

.team-title h3 {
    margin-bottom: 4px;
}

.team-info {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
}

/* Logo Upload Styles */
.logo-upload-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.logo-upload-btn {
    align-self: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-preview {
    position: relative;
    display: inline-block;
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
}

.logo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-logo-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(220, 38, 38, 0.9);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.remove-logo-btn:hover {
    background: rgba(220, 38, 38, 1);
}

/* Team Header Section */
.team-header-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.team-identity {
    display: flex;
    align-items: center;
    gap: 16px;
}

.team-header-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.team-header-info h2 {
    margin: 0 0 4px 0;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 700;
}

.team-header-info p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
}

.team-header-divider {
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #ec4899);
    border-radius: 1px;
    margin-top: 16px;
}

/* Unified Compact Header */
.unified-header {
    background: var(--space-gray);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 12px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--neumorphic-shadow);
    min-height: 48px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.header-center {
    display: flex;
    justify-content: center;
    flex: 1;
}

.header-right {
    display: flex;
    justify-content: flex-end;
    flex: 1;
    gap: 8px;
}

/* .view-title removed - no longer needed as view context comes from bottom nav */

.compact-team-logo {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.compact-game-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.team-name {
    font-weight: 700;
    color: var(--premium-white);
    font-size: 1.1rem;
    line-height: 1.2;
}

.game-details {
    font-size: 0.85rem;
    color: var(--space-gray-6);
    line-height: 1.2;
}

.compact-period-selector {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 8px 12px;
    flex-wrap: wrap;
}

.periods-label {
    display: none;
}

.periods-buttons {
    display: none;
}

/* Desktop: show individual period buttons */
.compact-period-selector {
    display: flex !important;
}

/* Desktop period button styling */
.compact-period-selector .period-btn {
    display: flex;
    min-width: 40px;
    width: auto;
    height: 40px;
    padding: 0 12px;
    font-size: 0.875rem;
    border-radius: 10px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-smooth);
    border: 1px solid var(--glass-border);
    background: var(--space-gray-2);
    color: var(--premium-white);
    cursor: pointer;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
}

.compact-period-selector .period-btn:hover {
    background: var(--space-gray-3);
    border-color: var(--electric-blue-alpha-30);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--electric-blue-alpha-20);
}

.compact-period-selector .period-btn.active {
    background: linear-gradient(135deg, var(--electric-blue) 0%, var(--electric-blue-dark) 100%);
    color: var(--premium-white);
    border-color: var(--electric-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--electric-blue-alpha-30),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Dynamic sizing based on number of periods */
.compact-period-selector[data-period-count="1"] .period-btn,
.compact-period-selector[data-period-count="2"] .period-btn,
.compact-period-selector[data-period-count="3"] .period-btn,
.compact-period-selector[data-period-count="4"] .period-btn {
    min-width: 50px;
    padding: 0 16px;
    font-size: 0.9rem;
}

.compact-period-selector[data-period-count="5"] .period-btn,
.compact-period-selector[data-period-count="6"] .period-btn {
    min-width: 45px;
    padding: 0 14px;
    font-size: 0.85rem;
}

.compact-period-selector[data-period-count="7"] .period-btn,
.compact-period-selector[data-period-count="8"] .period-btn {
    min-width: 40px;
    padding: 0 12px;
    font-size: 0.8rem;
}

.compact-period-selector[data-period-count="9"] .period-btn,
.compact-period-selector[data-period-count="10"] .period-btn {
    min-width: 36px;
    padding: 0 10px;
    font-size: 0.75rem;
}

.compact-period-selector[data-period-count^="1"] .period-btn {
    min-width: 32px;
    padding: 0 8px;
    font-size: 0.7rem;
}

/* Show navigation elements on mobile only */
.period-nav-btn,
.current-period-display {
    display: none;
}

/* Mobile: show carousel navigation */
@media (max-width: 1024px) {
    .period-nav-btn {
        display: flex;
        background: rgba(99, 102, 241, 0.8);
        border: none;
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .period-nav-btn:hover {
        background: rgba(99, 102, 241, 1);
        transform: scale(1.05);
    }

    .period-nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: none;
    }

    .current-period-display {
        display: block;
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: white;
        padding: 6px 12px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 0.85rem;
        text-align: center;
        min-width: 80px;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    }
}

.btn.compact {
    padding: 8px 16px;
    font-size: 0.875rem;
    min-height: auto;
}

.unified-header-divider {
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed, #ec4899);
    border-radius: 1px;
    margin-bottom: 8px;
}

.empty-state {
    text-align: center;
    color: #94a3b8;
    font-style: italic;
    padding: 40px;
}

/* Game Section */
.game-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.game-info h2 {
    color: #2d3748;
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.game-info p {
    color: #64748b;
}

.game-actions {
    display: flex;
    gap: 12px;
}

/* Period Selector */
.period-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 8px;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.period-btn {
    flex: 1;
    min-width: 80px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.875rem;
}

.period-btn.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.period-btn:hover:not(.active) {
    background: #f1f5f9;
}

.period-main {
    font-weight: 600;
}

.period-timing {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

.period-btn.active .period-timing {
    opacity: 0.9;
}

/* Field and Players Layout */
.field-and-players {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    background: var(--space-gray);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--neumorphic-shadow);
    backdrop-filter: var(--glass-backdrop);
    height: calc(100vh - 160px); /* Account for compact unified header and margins */
    overflow: hidden;
}

/* Soccer Field */
.soccer-field {
    background: 
        /* Mowing stripes - alternating light and dark grass */
        repeating-linear-gradient(
            0deg,
            rgba(45, 122, 61, 0.8) 0px,
            rgba(45, 122, 61, 0.8) 50px,
            rgba(30, 95, 42, 0.9) 50px,
            rgba(30, 95, 42, 0.9) 100px
        ),
        /* Grass texture overlay */
        radial-gradient(ellipse at top, rgba(45, 90, 61, 0.3) 0%, rgba(30, 63, 42, 0.4) 50%, rgba(22, 51, 42, 0.5) 100%),
        /* Fine grass blade details */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(45, 90, 61, 0.05) 1px,
            rgba(45, 90, 61, 0.05) 2px
        ),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(30, 63, 42, 0.05) 1px,
            rgba(30, 63, 42, 0.05) 2px
        ),
        /* Base grass color */
        linear-gradient(135deg, #2d7a3d 0%, #1e5f2a 50%, #16472a 100%);
    background-size: 100% 100%, 100% 100%, 3px 3px, 4px 4px, 100% 100%;
    border-radius: 6px;
    padding: 10px;
    height: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    position: relative;
    border: 4px solid rgba(255, 255, 255, 0.9);
    box-shadow: 
        inset 0 0 50px rgba(0, 0, 0, 0.2),
        0 8px 32px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Center line */
.soccer-field::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 15px;
    bottom: 15px;
    width: 3px;
    background: rgba(255, 255, 255, 0.95);
    transform: translateX(-50%);
    z-index: 1;
    box-shadow: 
        0 0 3px rgba(255, 255, 255, 0.3),
        inset 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Center circle */
.soccer-field::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    box-shadow: 
        0 0 5px rgba(255, 255, 255, 0.3),
        inset 0 0 2px rgba(0, 0, 0, 0.2);
}

/* Right penalty area (for forwards) */
.soccer-field .penalty-area-top {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 140px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-right: none;
    z-index: 1;
    pointer-events: none;
    box-shadow: 
        0 0 3px rgba(255, 255, 255, 0.3),
        inset 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Right goal area */
.soccer-field .goal-area-top {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-right: none;
    z-index: 1;
    pointer-events: none;
    box-shadow: 
        0 0 3px rgba(255, 255, 255, 0.3),
        inset 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Left penalty area (for GK) */
.soccer-field .penalty-area-bottom {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 140px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-left: none;
    z-index: 1;
    pointer-events: none;
    box-shadow: 
        0 0 3px rgba(255, 255, 255, 0.3),
        inset 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Left goal area */
.soccer-field .goal-area-bottom {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 25px;
    height: 80px;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-left: none;
    z-index: 1;
    pointer-events: none;
    box-shadow: 
        0 0 3px rgba(255, 255, 255, 0.3),
        inset 0 0 1px rgba(0, 0, 0, 0.2);
}

/* Corner arcs */
.soccer-field .corner-arc {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.9);
    z-index: 1;
    pointer-events: none;
    box-shadow: 
        0 0 3px rgba(255, 255, 255, 0.3),
        inset 0 0 1px rgba(0, 0, 0, 0.2);
}

.soccer-field .corner-arc.top-left {
    top: 12px;
    left: 12px;
    border-right: none;
    border-bottom: none;
    border-radius: 0 0 20px 0;
}

.soccer-field .corner-arc.top-right {
    top: 12px;
    right: 12px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 0 0 20px;
}

.soccer-field .corner-arc.bottom-left {
    bottom: 12px;
    left: 12px;
    border-right: none;
    border-top: none;
    border-radius: 0 20px 0 0;
}

.soccer-field .corner-arc.bottom-right {
    bottom: 12px;
    right: 12px;
    border-left: none;
    border-top: none;
    border-radius: 20px 0 0 0;
}

.field-section {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    min-width: 80px;
    height: 100%;
    position: relative;
    z-index: 10;
}

/* Adjust positioning for better field alignment */
.soccer-field .field-section.defense {
    transform: translateX(-10%) !important;
}

.soccer-field .field-section.midfield {
    transform: translateX(-15%) !important;
}

.soccer-field .field-section.forward {
    transform: translateX(-20%) !important;
}

/* Keep goalkeeper in original position */
.soccer-field .field-section.goalkeeper {
    transform: translateX(0%) !important;
}

/* Bench positions along the sideline */
.field-bench-area {
    position: absolute;
    top: 20px;
    right: -80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
}

.bench-position {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: rgba(251, 191, 36, 0.1);
    border: 2px dashed #fbbf24;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #f59e0b;
    font-weight: 600;
    transition: all 0.2s ease;
    cursor: pointer;
}

.bench-position:hover {
    background: rgba(251, 191, 36, 0.2);
    transform: scale(1.05);
}

.bench-position.occupied {
    background: #fbbf24;
    color: #92400e;
    border-style: solid;
}

.bench-position:empty::after {
    content: "B";
    opacity: 0.6;
}

.position {
    width: 63px;
    height: 63px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #2d3748;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    font-size: 0.875rem;
    position: relative;
    z-index: 10; /* Ensure positions appear above field markings */
}

.position:hover {
    background: white;
    transform: scale(1.1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.position.occupied {
    font-size: 0.75rem; /* Default size, overridden by JS */
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px;
    font-weight: 600;
}

/* Inverted colors for occupied positions */
.position.occupied.position-forward {
    background: white;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.position.occupied.position-midfield {
    background: white;
    color: #059669;
    border: 2px solid #059669;
}

.position.occupied.position-defense {
    background: white;
    color: #d97706;
    border: 2px solid #d97706;
}

.position.occupied.position-goalkeeper {
    background: white;
    color: #dc2626;
    border: 2px solid #dc2626;
}

.position.drop-target {
    border-color: #10b981;
    background: #d1fae5;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Players Panel */
.players-panel {
    background: var(--space-gray-2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 20px;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 20px; /* Increased gap for better separation */
    flex: 0 0 320px;
    backdrop-filter: blur(8px);
}

/* Available Players Section - Balanced space allocation */
.available-players-section {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    max-height: 60vh; /* Limit height to prevent overlap */
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    border: 1px dashed var(--electric-blue-alpha-30);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.available-players-section h3 {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.players-list.available {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
}

/* Clean Apple-style available player cards with optimal readability */
.players-list.available .player-item {
    background: var(--space-gray-2);
    border: 1px solid var(--space-gray-4);
    color: var(--premium-white);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                0 1px 0px rgba(255, 255, 255, 0.1) inset;
    backdrop-filter: none;
}

.players-list.available .player-item:hover {
    background: var(--space-gray-3);
    border-color: var(--electric-blue);
    box-shadow: 0 4px 16px var(--electric-blue-alpha-20),
                0 1px 0px rgba(255, 255, 255, 0.15) inset;
    transform: translateY(-1px);
}

/* Enhanced text readability for available player cards */
.players-list.available .player-item .player-name {
    color: var(--premium-white);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.players-list.available .player-item .position-badge {
    background: var(--electric-blue);
    color: var(--premium-white);
    border: none;
    font-weight: 600;
    text-shadow: none;
}
.players-list.available .player-item .position-badge.preferred {
    background: var(--warm-gold);
    color: var(--deep-space);
}

/* Jersey Section - Compact for single player */
.jersey-section {
    flex: 0 0 auto;
    min-height: 80px;
    max-height: 120px;
}

.jersey-section h3 {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.jersey-slot {
    min-height: 60px;
    max-height: 60px;
    padding: 12px;
    border-radius: 8px;
    border: 2px dashed #8b5cf6;
    background: rgba(139, 92, 246, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #8b5cf6;
    font-weight: 500;
    transition: all 0.2s ease;
}

.jersey-slot:empty::after {
    content: "Drop player to prep jersey";
    opacity: 0.7;
}

/* Modern responsive jersey slot - dynamic sizing to prevent overlaps */
.jersey-slot .player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    min-width: 0; /* Allow shrinking */
}
.jersey-slot .player-item .player-name {
    flex: 1;
    min-width: 0; /* Allow shrinking */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: clamp(0.7rem, 2vw, 0.85rem); /* Responsive font size */
}
.jersey-slot .player-item .sitting-count {
    flex-shrink: 0;
    font-size: clamp(0.6rem, 1.5vw, 0.7rem); /* Dynamic font size */
    padding: 1px 4px; /* Smaller padding */
    min-width: fit-content;
    white-space: nowrap;
}

/* Bench Section - Consistent sizing with jersey prep */
.bench-section {
    flex: 0 0 auto;
    min-height: 120px;
    max-height: 220px;
}

.bench-section h3 {
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.players-list.bench {
    min-height: 100px;
    max-height: 200px; /* Limit height to prevent overflow */
    overflow-y: auto; /* Enable scrolling when needed */
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Dynamic responsive bench player items */
.players-list.bench .player-item {
    padding: clamp(6px, 1vw, 10px) clamp(8px, 1.5vw, 12px);
    font-size: clamp(0.75rem, 2vw, 0.9rem);
    min-height: clamp(32px, 6vw, 48px);
    gap: 6px;
    min-width: 0;
}
.players-list.bench .player-item .player-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.players-list.bench .player-item .sitting-count {
    flex-shrink: 0;
    font-size: clamp(0.6rem, 1.5vw, 0.75rem);
    padding: clamp(1px, 0.5vw, 3px) clamp(3px, 1vw, 8px);
    min-width: fit-content;
    white-space: nowrap;
}

/* Enhanced Player Items */
.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: white;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    cursor: move;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.player-item:hover {
    border-color: var(--primary-500);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    background: #f8fafc;
}

.player-name {
    font-weight: 500;
    color: #2d3748;
    flex: 1;
}

.sitting-count {
    font-size: 0.75rem;
    color: var(--premium-white);
    background: var(--electric-blue);
    padding: 3px 8px;
    border-radius: 6px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.players-panel h3 {
    color: var(--premium-white);
    margin-bottom: 8px;
    font-size: 1rem;
    flex-shrink: 0;
    font-weight: 600;
}

.players-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    flex: 1;
    padding: 12px;
    border-radius: 8px;
    border: 2px dashed #cbd5e1;
    transition: all 0.2s ease;
    overflow-y: auto;
    min-height: 0;
}

.players-list.bench {
    background: #fef3c7;
    border-color: #fbbf24;
    border-width: 2px;
    border-style: dashed;
}

/* Players list scrollbar styling */
.players-list::-webkit-scrollbar {
    width: 6px;
}

.players-list::-webkit-scrollbar-track {
    background: transparent;
}

.players-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.players-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.players-list.drop-over {
    border-color: #10b981;
    background: #d1fae5;
}

.player-item {
    background: var(--space-gray);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 12px;
    cursor: grab;
    transition: all 0.2s ease;
    color: var(--premium-white);
    font-weight: 500;
}

.player-item:hover {
    border-color: #4f46e5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.player-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
    cursor: grabbing;
}

/* Table View */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: auto;
    max-height: calc(100vh - 140px);
}

.lineup-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.lineup-table th,
.lineup-table td {
    padding: 2px 4px;
    text-align: center;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
    line-height: 1.1;
}

.lineup-table th {
    background: #f8fafc;
    font-weight: 600;
    color: #374151;
    position: sticky;
    top: 0;
}

.lineup-table td {
    color: #4b5563;
}

.lineup-table tr:hover {
    background: #f9fafb;
}

.bench-indicator {
    background: #fbbf24;
    color: #92400e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.lineup-table td:first-child {
    font-weight: 600;
    background: #f8fafc;
    text-align: left;
    padding: 2px 6px;
}

.lineup-table tr:last-child td {
    background: #f1f5f9;
    font-size: 0.875rem;
    color: #64748b;
    font-style: italic;
}

/* Player Statistics Column */
.stats-column {
    min-width: 150px;
    vertical-align: top;
    background: #fafbfc !important;
    border-left: 2px solid #e2e8f0;
}

.player-stats {
    font-size: 0.85rem;
    line-height: 1.3;
}

.player-stats .stat-line {
    margin: 2px 0;
    white-space: nowrap;
}

.player-stats .stat-line strong {
    color: #1f2937;
    font-weight: 600;
}

.player-stats .positions {
    color: #6b7280;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 140px;
}

.stats-column th {
    background: #f8fafc !important;
    border-left: 2px solid #e2e8f0;
    font-weight: 600;
    color: #374151;
}

/* Substitution Indicators */
.substitution {
    color: #059669;
    font-size: 0.75rem;
    font-weight: 500;
    font-style: italic;
    display: block;
    margin-top: 2px;
    line-height: 1.2;
}

.lineup-table td {
    position: relative;
    vertical-align: middle;
}

/* Authentication Page - Mobile First */
.auth-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    overflow: hidden;
    /* Ensure it covers everything and blocks interaction */
    -webkit-overflow-scrolling: touch;
    /* Prevent any pointer events from reaching content below */
    pointer-events: auto;
    /* Ensure it's always on top */
    isolation: isolate;
}

.auth-container {
    width: 100%;
    max-width: 380px;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 32px 24px 24px;
    margin: 16px;
    text-align: center;
    /* Ensure auth container stays above everything */
    position: relative;
    z-index: 1000000;
}

/* Simplified Auth Header - Mobile */
.auth-header {
    margin-bottom: 24px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    letter-spacing: -0.5px;
}

/* Auth Toggle Tabs */
.auth-toggle {
    display: flex;
    background: #f5f5f5;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.auth-tab-btn.active {
    background: white;
    color: var(--primary-500);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Auth Forms */
.auth-forms-container {
    position: relative;
    min-height: 160px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Google Button */
.auth-google-btn {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    background: white;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #333;
}

.auth-google-btn:hover {
    border-color: var(--primary-500);
    transform: translateY(-1px);
}

.google-icon {
    width: 20px;
    height: 20px;
    background: linear-gradient(45deg, #4285f4, #34a853, #fbbc05, #ea4335);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

/* Auth Divider */
.auth-divider {
    margin: 16px 0;
    position: relative;
    text-align: center;
    color: #999;
    font-size: 13px;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e5e5;
}

.auth-divider span {
    background: white;
    padding: 0 16px;
    position: relative;
}

/* Email Form */
.auth-email-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-email-form input {
    width: 100%;
    padding: 14px;
    border: 2px solid #e5e5e5;
    border-radius: 12px;
    font-size: 15px;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.auth-email-form input:focus {
    outline: none;
    border-color: var(--primary-500);
}

.auth-email-form input::placeholder {
    color: #999;
}

/* Submit Button */
.auth-submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 6px;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

/* Loading and Error States */
.auth-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--primary-500);
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-500);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.auth-error {
    text-align: center;
    padding: 20px;
    background: #fef2f2;
    border-radius: 12px;
    margin-top: 20px;
    border: 1px solid #fecaca;
}

.error-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.error-message {
    color: #dc2626;
    margin: 8px 0 16px;
    font-size: 14px;
}

.error-close-btn {
    padding: 8px 16px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: modalFadeIn 0.4s ease;
    pointer-events: all;
}

@keyframes modalFadeIn {
    from { 
        opacity: 0; 
        backdrop-filter: blur(0px);
    }
    to { 
        opacity: 1; 
        backdrop-filter: blur(12px);
    }
}

.modal-content {
    background: var(--space-gray);
    border-radius: 20px;
    padding: 0;
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--neumorphic-shadow),
                0 0 32px var(--electric-blue-alpha-20);
    border: 1px solid var(--glass-border);
    backdrop-filter: var(--glass-backdrop);
}

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.95);
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 16px;
    background: linear-gradient(135deg, var(--electric-blue) 0%, var(--electric-blue-dark) 100%);
    border-bottom: none;
    position: relative;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.modal-header h3 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-header h3::before {
    content: '🎮';
    font-size: 1.75rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.25rem;
    color: white;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.modal form {
    padding: 24px;
    background: var(--space-gray-2);
    border-radius: 0 0 20px 20px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--premium-white);
    font-size: 0.95rem;
    letter-spacing: -0.01em;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fafbfc;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* Input with icons */
.form-group.has-icon {
    position: relative;
}

.form-group.has-icon input {
    padding-left: 44px;
}

.form-group.has-icon::before {
    content: attr(data-icon);
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.1rem;
    color: #9ca3af;
    pointer-events: none;
    z-index: 1;
    margin-top: 10px; /* Account for label */
}

/* Select dropdown styling */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 14px;
    padding-right: 46px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1), inset 0 1px 2px rgba(0, 0, 0, 0.04);
    background: white;
    transform: translateY(-1px);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

/* Absent Players Section */
.absent-players-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
    background: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.absent-player-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e5e7eb;
    transition: all 0.15s ease;
    min-height: 32px;
}

.absent-player-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.absent-player-item input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.absent-player-item label {
    margin: 0;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 400;
    color: #374151;
    line-height: 1.2;
    flex: 1;
}

.form-helper-text {
    font-size: 0.85rem;
    color: #64748b;
    margin: 0 0 12px 0;
    font-style: italic;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.form-actions .btn {
    padding: 10px 24px;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 100px;
    white-space: nowrap;
}

.form-actions .btn.secondary {
    background: #f8fafc;
    border: 2px solid #e5e7eb;
    color: #6b7280;
}

.form-actions .btn.secondary:hover {
    background: #f1f5f9;
    border-color: #d1d5db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-actions .btn.primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    border: 2px solid transparent;
    color: white;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.3);
}

.form-actions .btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.form-actions .btn.primary:active {
    transform: translateY(0);
}

/* ===== AUTHENTICATION STYLES ===== */
/* Desktop: Make auth modal wider and more page-like */
@media (min-width: 1025px) {
    .auth-modal {
        max-width: 900px;
        width: 90%;
        max-height: 85vh;
        overflow-y: auto;
        background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
        border-radius: 20px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        display: flex;
        flex-direction: column;
    }

    .auth-forms-container {
        display: flex;
        min-height: 400px;
    }

    .auth-form {
        flex: 1;
        padding: 32px;
        display: block !important; /* Show both forms on desktop */
        border-right: 1px solid #e2e8f0;
    }

    .auth-form:last-child {
        border-right: none;
    }

    .auth-form.active {
        background: rgba(79, 70, 229, 0.05);
        border-radius: 0 0 0 20px;
    }

    .auth-form:last-child.active {
        border-radius: 0 0 20px 0;
    }

    /* Desktop Auth Page - Beautiful Split Screen Design */
    .auth-page {
        display: flex !important;
        height: 100vh !important;
        padding: 0 !important;
        background: var(--neutral-100) !important;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .auth-container {
        max-width: none !important;
        width: 100% !important;
        height: 100vh !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        background: transparent !important;
        display: flex !important;
        overflow: hidden !important;
        margin: 0 !important;
    }

    /* Left Panel - Branding */
    .auth-header {
        flex: 0 0 45% !important;
        background: rgba(255, 255, 255, 0.1) !important;
        backdrop-filter: blur(20px) !important;
        border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
        color: white !important;
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        position: relative !important;
        overflow: hidden !important;
        border-radius: 0 !important;
    }

    .auth-header::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 50%);
        animation: float 6s ease-in-out infinite;
    }

    @keyframes float {
        0%, 100% { transform: translate(0, 0) rotate(0deg); }
        50% { transform: translate(-20px, -20px) rotate(180deg); }
    }

    .auth-title {
        font-size: 4rem !important;
        font-weight: 900 !important;
        margin-bottom: 24px !important;
        text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3) !important;
        letter-spacing: -1px !important;
        position: relative !important;
        z-index: 2 !important;
        color: white !important;
        margin: 0 !important;
    }

    .auth-header::after {
        content: 'Professional Soccer Team Management';
        font-size: 1.2rem;
        font-weight: 400;
        opacity: 0.9;
        margin-top: 16px;
        position: relative;
        z-index: 2;
    }

    /* Right Panel - Forms */
    .auth-toggle {
        position: absolute !important;
        top: 40px !important;
        right: 40px !important;
        background: white !important;
        border-radius: 50px !important;
        padding: 4px !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
        z-index: 10 !important;
        display: flex !important;
    }

    .auth-tab-btn {
        padding: 12px 24px;
        font-size: 0.95rem;
        font-weight: 600;
        border: none;
        background: transparent;
        color: #64748b;
        border-radius: 46px;
        transition: all 0.3s ease;
        cursor: pointer;
        min-width: 100px;
    }

    .auth-tab-btn.active {
        background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
        color: white;
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
        transform: translateY(-1px);
    }

    .auth-forms-container {
        flex: 1 !important;
        background: white !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        position: relative !important;
    }

    .auth-form {
        width: 100% !important;
        max-width: 400px !important;
        padding: 60px 40px !important;
        display: none !important;
        flex-direction: column !important;
        position: absolute !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        opacity: 0 !important;
        animation: slideIn 0.5s ease forwards !important;
    }

    .auth-form.active {
        display: flex !important;
        opacity: 1 !important;
    }

    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translate(-50%, -40%);
        }
        to {
            opacity: 1;
            transform: translate(-50%, -50%);
        }
    }

    .auth-form h2 {
        font-size: 2rem;
        font-weight: 700;
        color: #1e293b;
        margin-bottom: 8px;
        text-align: center;
    }

    .auth-form p {
        color: #64748b;
        text-align: center;
        margin-bottom: 32px;
        font-size: 1rem;
    }

    .auth-email-form {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .auth-email-form input {
        padding: 18px 20px;
        font-size: 1rem;
        border-radius: 12px;
        border: 2px solid #e2e8f0;
        transition: all 0.3s ease;
        background: #fafbfc;
        outline: none;
    }

    .auth-email-form input::placeholder {
        color: #94a3b8;
    }

    .auth-email-form input:focus {
        border-color: var(--primary-500);
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
        background: white;
        transform: translateY(-1px);
    }

    .auth-submit-btn {
        padding: 18px 32px;
        font-size: 1.1rem;
        font-weight: 600;
        border-radius: 12px;
        margin-top: 8px;
        transition: all 0.3s ease;
        background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
        border: none;
        color: white;
        cursor: pointer;
        outline: none;
    }

    .auth-submit-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
    }

    .auth-submit-btn:active {
        transform: translateY(0);
    }
}

/* Mobile: Optimized auth experience */
@media (max-width: 1024px) {
    .auth-page {
        /* Ensure proper mobile coverage */
        padding-top: var(--safe-area-inset-top);
        padding-bottom: var(--safe-area-inset-bottom);
        padding-left: var(--safe-area-inset-left);
        padding-right: var(--safe-area-inset-right);
    }

    .auth-container {
        margin: 16px;
        padding: 32px 24px 24px;
        max-width: calc(100% - 32px);
        /* Account for safe areas */
        max-height: calc(100vh - var(--safe-area-inset-top) - var(--safe-area-inset-bottom) - 32px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .auth-forms-container {
        display: block;
    }

    .auth-form {
        display: none;
        border-right: none;
    }

    .auth-form.active {
        display: block;
        background: transparent;
        border-radius: 0;
    }

    .auth-title {
        font-size: 28px !important;
        margin-bottom: 16px !important;
    }

    .auth-toggle {
        margin-bottom: 24px !important;
    }
}


/* Apple-Inspired Floating Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--space-gray);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: var(--neumorphic-shadow),
                0 0 20px var(--electric-blue-alpha-20);
    color: var(--premium-white);
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    min-height: 56px;
    width: calc(100vw - 40px);
    max-width: 1200px;
    padding: 0 20px;
}

.app-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
}

.app-icon {
    font-size: var(--font-size-2xl);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.app-title h1 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin: 0;
    letter-spacing: -0.02em;
    color: var(--premium-white);
    text-wrap: balance;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.page-title {
    color: var(--premium-white);
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0;
    text-align: center;
    opacity: 0.9;
    letter-spacing: -0.01em;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
}

.header-center .compact-period-selector {
    pointer-events: auto;
}

.header-center .compact-period-selector .period-btn {
    pointer-events: auto;
}

/* User Icon Button Styles (updated for header) */
.user-icon-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.user-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.user-icon-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-icon-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-icon-initials {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    font-weight: 600;
    font-size: 16px;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Create Team Card Styles */
.create-team-card {
    background: linear-gradient(145deg, var(--space-gray) 0%, var(--space-gray-2) 100%);
    border-radius: 20px;
    padding: var(--space-8);
    text-align: center;
    color: var(--premium-white);
    box-shadow: var(--neumorphic-shadow),
                0 0 32px var(--warm-gold-alpha-20),
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: 1px solid var(--warm-gold-alpha-30);
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--glass-backdrop);
}

.create-team-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--warm-gold-alpha-30), transparent);
    transition: left 0.6s ease;
}

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

.create-team-card:hover {
    transform: translateY(-8px) scale(1.03);
    box-shadow: var(--neumorphic-shadow),
                0 0 48px var(--warm-gold-alpha-30),
                0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--warm-gold);
}

.create-team-content {
    position: relative;
    z-index: 1;
}

.create-team-icon {
    font-size: 3.5rem;
    margin-bottom: var(--space-5);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    opacity: 0.9;
}

.create-team-card h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 var(--space-3) 0;
    color: var(--premium-white);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.create-team-card p {
    font-size: 1.125rem;
    margin: 0 0 var(--space-8) 0;
    color: var(--space-gray-6);
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.create-team-btn {
    background: linear-gradient(135deg, var(--warm-gold) 0%, var(--electric-blue) 100%);
    border: none;
    color: white;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    letter-spacing: -0.01em;
}

.create-team-btn:hover {
    background: linear-gradient(135deg, #0056d6 0%, #004494 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0, 122, 255, 0.4);
}

.btn-arrow {
    font-size: 1.2rem;
    transition: transform 0.2s ease;
}

.create-team-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* User Menu Styles */
.user-menu {
    position: fixed;
    top: 65px;
    right: 16px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
    border: 1px solid #e2e8f0;
    min-width: 160px;
    z-index: 1001;
    overflow: hidden;
}

.user-info {
    padding: 8px 12px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-initials {
    font-weight: 600;
    color: #6366f1;
    font-size: 1.2rem;
}

.user-details {
    flex: 1;
}

.user-name {
    display: block;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0;
    font-size: 0.8rem;
    line-height: 1.1;
}

.user-email {
    display: block;
    font-size: 0.7rem;
    color: #64748b;
    line-height: 1.1;
}

.user-actions {
    padding: 4px;
}

.user-action {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 2px;
    padding: 6px 8px;
    text-align: left;
    font-size: 0.75rem;
    border-radius: 4px;
    background: transparent;
    border: none;
    transition: background-color 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.user-action:hover {
    background: #f8fafc;
}

.user-action:last-child {
    margin-bottom: 0;
}

/* Mobile Auth Styles */
@media (max-width: 1024px) {
    .auth-modal {
        width: 95%;
        max-width: none;
        margin: 0;
    }

    .auth-page {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile */
        padding: 0;
    }

    .auth-container {
        margin: 0;
        border-radius: 0;
        height: 100vh;
        height: 100dvh;
        max-width: none;
        display: flex;
        flex-direction: column;
        padding: 20px;
        justify-content: center;
        overflow: hidden;
    }

    .auth-forms-container {
        min-height: auto;
        flex: 0 0 auto;
    }

    .modal {
        min-height: 100vh;
        min-height: 100dvh; /* Dynamic viewport height for mobile */
        padding: 20px;
        align-items: center;
        justify-content: center;
    }

    .auth-header {
        padding: 24px 20px;
    }

    .auth-form {
        padding: 24px 20px;
    }

    .app-header {
        padding: 10px 16px;
        min-height: 56px;
    }

    .app-title {
        gap: 8px;
    }

    .app-icon {
        font-size: 1.5rem;
    }

    .app-title h1 {
        font-size: 1.2rem;
        font-weight: 700;
    }

    .user-icon-btn {
        width: 36px;
        height: 36px;
    }

    .user-menu {
        top: 60px;
        right: 12px;
        left: 12px;
        min-width: auto;
        max-width: none;
    }
}

.players-selection {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--space-gray-2);
}

.player-option {
    padding: 12px 16px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--space-gray);
    color: var(--premium-white);
    cursor: pointer;
    transition: all 0.2s ease;
}

.player-option:hover {
    border-color: var(--electric-blue-alpha-30);
    background: var(--space-gray-3);
    box-shadow: 0 2px 8px var(--electric-blue-alpha-20);
}

.position-option {
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.position-option:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.position-option.current-assignment {
    border-color: #10b981;
    background: #ecfdf5;
    font-weight: 600;
}

.position-option.current-assignment:hover {
    border-color: #059669;
    background: #d1fae5;
}

.position-option.preferred-position {
    border-color: #3b82f6;
    background: #eff6ff;
}

.position-option.preferred-position:hover {
    border-color: #2563eb;
    background: #dbeafe;
}

.position-option.non-preferred-position {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}

.position-option.non-preferred-position:hover {
    border-color: #d97706;
    background: #fef3c7;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .app-container {
        padding: 12px;
    }
    
    /* Optimize mobile Team Management header */
    .section-header {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        padding: 16px;
        margin-bottom: 16px;
        background: linear-gradient(135deg, #1d1d1f 0%, #2d2d30 100%) !important;
        backdrop-filter: blur(20px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 8px 16px rgba(0, 0, 0, 0.2);
    }
    
    .section-header h2 {
        text-align: center;
        font-size: 1.3rem;
        color: #f5f5f7 !important;
    }
    
    .section-header .btn {
        width: 100%;
        padding: 18px 24px;
        font-size: 1.05rem;
        border-radius: 16px;
        font-weight: 600;
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
        border: none;
        color: white;
        box-shadow: 
            0 8px 24px rgba(139, 92, 246, 0.25),
            0 4px 12px rgba(102, 126, 234, 0.15),
            inset 0 1px 0 rgba(255, 255, 255, 0.2);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        overflow: hidden;
        letter-spacing: 0.02em;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
    }
    
    .section-header .btn .btn-icon {
        font-size: 1.2rem;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    }
    
    .section-header .btn .btn-text {
        font-weight: 600;
    }
    
    .section-header .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.6s ease;
    }
    
    .section-header .btn:hover::before {
        left: 100%;
    }
    
    .section-header .btn:active {
        transform: translateY(1px) scale(0.99);
        box-shadow: 
            0 4px 16px rgba(139, 92, 246, 0.3),
            0 2px 8px rgba(102, 126, 234, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.1);
    }
    
    /* Mobile-specific selected team adjustments */
    .team-card.selected {
        transform: scale(1.02) !important;
    }
    
    .team-card.selected::after {
        content: '✓ SELECTED';
        position: absolute;
        top: 12px;
        right: 12px;
        background: var(--electric-blue);
        color: var(--premium-white);
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 0.7rem;
        font-weight: 700;
        letter-spacing: 0.05em;
        box-shadow: 0 4px 12px var(--electric-blue-alpha-30),
                    inset 0 1px 0 rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(8px);
        z-index: 10;
        animation: selectedPulse 2s ease-in-out infinite;
    }
    
    .app-header {
        text-align: left;
    }
    
    .field-and-players {
        display: flex;
        flex-direction: column;
        gap: 16px;
        min-height: auto;
        height: auto !important;
        overflow: visible !important;
    }
    
    /* Enable page scrolling on mobile */
    .app-container {
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
        -webkit-overflow-scrolling: touch;
    }
    
    .content-area {
        overflow: visible !important;
        height: auto !important;
        flex: none;
        min-height: 0;
    }
    
    .tab-content {
        overflow: visible !important;
        height: auto !important;
    }
    
    /* Hide available players section on mobile - not needed for tap interface */
    .available-players-section {
        display: none;
    }
    
    .soccer-field {
        flex: 1;
        order: 1;
    }
    
    .players-panel {
        order: 2;
        height: auto;
        flex: 0 0 auto;
        padding: 12px 12px 20px 12px;
        gap: 8px;
        margin-top: 8px;
        overflow: visible;
    }
    
    /* Mobile bench and jersey prep layout */
    .players-panel {
        display: flex !important;
        flex-direction: row !important; /* Side by side layout */
        gap: 12px !important;
    }
    
    .bench-section {
        flex: 2 !important;
        min-height: 0 !important;
    }

    .jersey-section {
        flex: 0 0 120px !important;
        min-height: 0 !important;
    }
    
    .bench-section h3, .jersey-section h3 {
        font-size: 0.9rem !important;
        margin-bottom: 6px !important;
        text-align: center;
        background: rgba(79, 70, 229, 0.1);
        padding: 8px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s ease;
        user-select: none;
    }
    
    .bench-section h3:active, .jersey-section h3:active {
        background: rgba(79, 70, 229, 0.2);
        transform: scale(0.98);
    }
    
    .players-list.bench {
        min-height: 80px !important;
        padding: 8px 8px 12px 8px !important;
        overflow-y: visible;
        border: 2px dashed rgba(79, 70, 229, 0.3);
        border-radius: 6px;
        background: rgba(255, 255, 255, 0.8);
    }

    .jersey-slot {
        min-height: 60px !important;
        max-height: 60px !important;
        padding: 6px !important;
        overflow: visible;
        border: 2px dashed #8b5cf6;
        border-radius: 6px;
        background: rgba(139, 92, 246, 0.05);
    }
    
    /* Compact player items for mobile bench/jersey */
    .players-list.bench .player-item,
    .jersey-slot .player-item {
        padding: 6px 8px !important;
        font-size: 0.8rem !important;
        margin-bottom: 4px !important;
        border-radius: 6px !important;
        min-height: 32px !important;
        cursor: pointer;
        transition: all 0.2s ease;
        justify-content: center !important; /* Center the player name */
    }
    
    /* Hide sitting count on mobile */
    .players-list.bench .sitting-count,
    .jersey-slot .sitting-count {
        display: none !important;
    }
    
    /* Mobile player item hover/active states */
    .players-list.bench .player-item:active,
    .jersey-slot .player-item:active {
        background: rgba(239, 68, 68, 0.1) !important;
        border-color: rgba(239, 68, 68, 0.3) !important;
        transform: scale(0.98);
    }
    
    /* Hide available players section on mobile */
    .available-players-section {
        display: none !important;
    }
    
    .soccer-field {
        height: auto;
        min-height: 300px;
        flex-direction: column; /* Stack vertically on mobile */
    }
    
    .field-section {
        flex-direction: row; /* Horizontal layout for sections on mobile */
        min-width: auto;
        min-height: 60px;
        height: auto;
    }
    
    .game-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .period-selector {
        flex-wrap: wrap;
    }
    
    .position {
        width: 50px;
        height: 50px;
        font-size: 0.7rem;
    }

    .position.occupied {
        line-height: 1.0;
        padding: 1px;
    }
    
    .teams-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .team-card {
        padding: 20px;
        border-radius: 12px;
    }
    
    /* Mobile field position touch feedback */
    .position.touch-active {
        transform: scale(0.95);
        background-color: rgba(79, 70, 229, 0.8) !important;
        box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.3);
    }
    
    /* Enhanced mobile field positions for better touch targets */
    .position {
        min-height: 40px !important;
        min-width: 40px !important;
        font-size: 0.7rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .position:active {
        transform: scale(0.95);
    }
    
    /* Mobile game header redesign */
    .unified-header {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        padding: 10px 12px;
        min-height: auto;
    }

    .header-left {
        width: 100%;
        justify-content: flex-start;
        gap: 8px;
    }

    .compact-team-logo {
        width: 28px !important;
        height: 28px !important;
    }

    .compact-game-info {
        text-align: left;
        flex: 1;
        min-width: 0;
    }

    .team-name {
        font-size: 0.95rem !important;
        font-weight: 700;
        display: block;
        margin-bottom: 2px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .game-details {
        font-size: 0.7rem !important;
        opacity: 0.8;
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    /* Mobile periods carousel - improved layout */
    .header-center {
        width: 100%;
        order: 2;
        position: static;
        transform: none;
        margin-top: 4px;
    }
    
    .compact-period-selector {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        background: var(--space-gray-2) !important;
        border: 1px solid var(--glass-border) !important;
        border-radius: 12px !important;
        padding: 8px 12px !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    }

    /* Hide individual period buttons on mobile, show only carousel */
    .compact-period-selector .period-btn {
        display: none !important;
    }

    /* Show mobile carousel elements */
    .compact-period-selector .period-nav-btn,
    .compact-period-selector .current-period-display {
        display: flex !important;
    }
    
    .period-nav-btn {
        background: rgba(99, 102, 241, 0.8);
        border: none;
        color: white;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .period-nav-btn:hover {
        background: rgba(99, 102, 241, 1);
        transform: scale(1.05);
    }
    
    .period-nav-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        transform: none;
    }
    
    .current-period-display {
        background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
        color: white;
        padding: 6px 12px;
        border-radius: 12px;
        font-weight: 700;
        font-size: 0.85rem;
        min-width: 80px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
        white-space: nowrap;
    }
    
    .header-right {
        width: 100%;
        justify-content: center;
        order: 3;
        margin-top: 4px;
    }
    
    .btn.compact {
        padding: 4px 10px !important;
        font-size: 0.75rem !important;
    }
    
    /* Mobile team logo sizing - match height of team name + game info */
    .compact-team-logo {
        width: 40px !important;
        height: 40px !important;
        border-radius: 12px !important;
        border: 3px solid rgba(255, 255, 255, 0.2) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Mobile vertical field orientation */
    .soccer-field {
        /* Change aspect ratio for vertical orientation - shrink height */
        aspect-ratio: 9/12 !important;
        max-width: 100% !important;
        height: auto !important;
        min-height: 360px !important; /* Reduced from 500px */
        max-height: 400px !important; /* Cap the height */
        
        /* Rotate field markings for vertical layout */
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 15px 12px !important; /* Reduced padding */
    }
    
    /* Mobile vertical soccer field - complete rewrite */
    .soccer-field {
        position: relative !important;
        height: 450px !important;
        background: 
            /* Vertical field grass stripes */
            repeating-linear-gradient(
                90deg,
                rgba(45, 122, 61, 0.8) 0px,
                rgba(45, 122, 61, 0.8) 30px,
                rgba(30, 95, 42, 0.9) 30px,
                rgba(30, 95, 42, 0.9) 60px
            ) !important;
    }
    
    /* Reposition field sections on vertical field instead of hiding */
    .field-section {
        position: absolute !important;
        width: 100% !important;
        height: auto !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
    }
    
    /* Position field sections aligned with field markings */
    .field-section.goalkeeper {
        bottom: 1% !important;
    }
    
    .field-section.defense {
        bottom: 80px !important;
        left: 10% !important;
    }
    
    .field-section.midfield {
        bottom: 45% !important;
        left: 15% !important;
    }
    
    .field-section.forward {
        bottom: 70% !important;
        left: 20% !important;
    }
    
    /* Position players within their sections */
    .field-section .position {
        position: static !important;
        margin: 0 10px !important;
    }
    
    /* For sections with multiple players, spread them out */
    .field-section {
        gap: 20px !important;
    }
    
    /* Mobile edit team header redesign */
    .creation-header {
        padding: 12px 16px !important;
        margin-bottom: 16px !important;
        border-radius: 8px !important;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08) !important;
    }
    
    .creation-header h1 {
        font-size: 1.3rem !important;
        font-weight: 500 !important;
        color: #374151 !important;
    }
    
    .creation-header .header-left {
        gap: 12px !important;
    }
    
    .creation-header .header-right {
        gap: 8px !important;
    }
    
    .creation-header .btn {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
        border-radius: 6px !important;
        font-weight: 500 !important;
    }
    
    #backToTeamsBtn {
        color: #6b7280 !important;
        background: #f9fafb !important;
        border: 1px solid #e5e7eb !important;
    }
    
    /* Mobile Players & Positions section - fix horizontal scrolling */
    .players-container {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding-right: 4px !important;
    }
    
    .position-checkboxes {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
    }
    
    .position-checkboxes label {
        padding: 4px 6px !important;
        font-size: 0.7rem !important;
        border-radius: 3px !important;
        min-width: 0 !important;
        text-align: center !important;
    }
    
    /* Mobile home page fixes */
    .native-nav {
        height: 50px !important;
        padding: 6px 16px calc(6px + env(safe-area-inset-bottom)) !important;
        box-shadow: 0 -1px 6px rgba(0, 0, 0, 0.05) !important;
    }
    
    .nav-item {
        padding: 8px !important;
        min-height: 40px !important;
        min-width: 40px !important;
        border-radius: 10px !important;
        flex: 1 !important;
        max-width: 56px !important;
    }

    /* Show nav icons only for native app feel */
    .nav-item .nav-icon {
        font-size: 1.25rem !important;
        display: block !important;
    }
    
    /* Ultra compact team cards for mobile */
    .teams-list {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .team-card {
        padding: 12px !important;
        border-radius: 6px !important;
        border-width: 1px !important;
    }
    
    .team-card h3 {
        font-size: 1rem !important;
        margin-bottom: 2px !important;
        line-height: 1.2 !important;
    }
    
    .team-card p {
        font-size: 0.75rem !important;
        margin-bottom: 6px !important;
        opacity: 0.8 !important;
    }
    
    .team-card .team-actions {
        margin-top: 6px !important;
        gap: 4px !important;
    }
    
    .team-card .team-actions .btn {
        padding: 3px 6px !important;
        font-size: 0.7rem !important;
        border-radius: 4px !important;
        font-weight: 500 !important;
    }
    
    /* Realistic vertical field section positioning and spacing */
    .field-section.forward {
        order: 1;
        flex: 1 !important;
        margin-top: 20px !important; /* Position closer to top goal */
        justify-content: center !important;
    }
    
    .field-section.midfield {
        order: 2;
        flex: 1 !important;
        margin: 10px 0 !important; /* Centered with balanced spacing */
        justify-content: center !important;
    }
    
    .field-section.defense {
        order: 3;
        flex: 1 !important;
        margin: 10px 0 !important; /* Position closer to own goal but with some spacing */
        justify-content: center !important;
    }
    
    .field-section.goalkeeper {
        order: 4;
        flex: 0.8 !important; /* Goalkeeper gets space near goal */
        margin-bottom: 20px !important; /* Position close to bottom goal */
        min-height: 50px !important;
        justify-content: center !important;
    }
    
    
    /* Mobile vertical field markings */
    .soccer-field::before {
        /* Center line - horizontal across the field */
        left: 15px !important;
        right: 15px !important;
        top: 50% !important;
        bottom: auto !important;
        width: calc(100% - 30px) !important;
        height: 3px !important;
        transform: translateY(-50%) !important;
    }
    
    .soccer-field::after {
        /* Center circle remains the same */
        top: 50% !important;
        left: 50% !important;
        width: 80px !important;
        height: 80px !important;
    }
    
    /* Mobile penalty areas - proper rectangles extending into field */
    .penalty-area-top {
        top: 15px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        width: 160px !important;
        height: 60px !important;
        border: 3px solid rgba(255, 255, 255, 0.95) !important;
        border-top: none !important;
        box-shadow: none !important;
    }
    
    .penalty-area-bottom {
        bottom: 15px !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        width: 160px !important;
        height: 60px !important;
        border: 3px solid rgba(255, 255, 255, 0.95) !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }
    
    /* Mobile goal areas - smaller rectangles within penalty areas */
    .goal-area-top {
        top: 15px !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        width: 80px !important;
        height: 25px !important;
        border: 3px solid rgba(255, 255, 255, 0.95) !important;
        border-top: none !important;
        box-shadow: none !important;
    }
    
    .goal-area-bottom {
        bottom: 15px !important;
        left: 50% !important;
        right: auto !important;
        top: auto !important;
        transform: translateX(-50%) !important;
        width: 80px !important;
        height: 25px !important;
        border: 3px solid rgba(255, 255, 255, 0.95) !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }
    
    /* Mobile corner arcs for vertical field */
    .corner-arc.top-left {
        top: 12px !important;
        left: 12px !important;
    }
    
    .corner-arc.top-right {
        top: 12px !important;
        right: 12px !important;
    }
    
    .corner-arc.bottom-left {
        bottom: 12px !important;
        left: 12px !important;
    }
    
    .corner-arc.bottom-right {
        bottom: 12px !important;
        right: 12px !important;
    }
    
    /* Hide bench positions on field for mobile */
    .field-bench-area {
        display: none !important;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
        max-height: 85vh;
    }
    
    .modal form {
        padding: 16px !important;
    }
    
    .form-group {
        margin-bottom: 14px !important;
    }
    
    .form-actions {
        margin-top: 16px !important;
        padding-top: 12px !important;
        gap: 8px !important;
    }
    
    .form-actions .btn {
        padding: 12px 20px !important;
        font-size: 0.9rem !important;
        min-height: 44px !important;
        min-width: 110px !important;
        white-space: nowrap !important;
    }
}

@media (max-width: 480px) {
    .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .game-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .position {
        width: 55px;
        height: 36px;
        font-size: 0.6rem;
    }

    .position.occupied {
        line-height: 0.9;
    }
    
    .field-and-players {
        min-height: auto;
        padding: 12px;
    }
    
    .players-panel {
        padding: 12px 12px 20px 12px;
    }
    
    .table-container {
        max-height: calc(100vh - 100px);
        padding: 8px;
    }
    
    .stats-column {
        min-width: 120px;
    }
    
    .player-stats .positions {
        max-width: 100px;
        font-size: 0.75rem;
    }
    
    .substitution {
        font-size: 0.7rem;
        margin-top: 1px;
    }
    
    /* Bottom navigation adjustments */
    .bottom-nav {
        padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
    }
    
    .nav-tab {
        min-width: 56px;
        min-height: 56px;
        padding: 8px 12px;
    }
    
    .nav-icon {
        font-size: 20px;
        margin-bottom: 2px;
    }
    
    .nav-label {
        font-size: 10px;
    }
    
    .floating-action-btn {
        width: 48px;
        height: 48px;
        bottom: calc(72px + env(safe-area-inset-bottom));
        right: 16px;
    }
    
    .fab-icon {
        font-size: 20px;
    }
}

/* ===== NATIVE APP NAVIGATION ===== */
.native-nav {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100vw - 40px);
    max-width: 400px;
    background: var(--space-gray);
    backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px 20px calc(8px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: var(--neumorphic-shadow),
                0 0 20px var(--electric-blue-alpha-20);
    height: 64px;
    transition: all var(--transition-smooth);
}

/* Dynamic navbar that adapts to scroll */
.native-nav.scrolled {
    background: var(--space-gray-2);
    box-shadow: var(--neumorphic-shadow),
                0 0 32px var(--electric-blue-alpha-30);
}

/* Enhanced navigation item with better touch targets */
.nav-item {
    position: relative;
    border-radius: 16px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

/* Apple-inspired active state */
.nav-item.active {
    background: linear-gradient(135deg, var(--electric-blue), var(--electric-blue-dark));
    color: var(--premium-white);
    box-shadow: 0 4px 12px var(--electric-blue-alpha-30),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Micro-interactions for better feedback */
.nav-item:active {
    transform: scale(0.95);
}

.nav-item.active:active {
    transform: scale(1.0);
}

/* Performance optimizations for mobile */
.nav-item,
.fab,
.btn {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Smooth tab content transitions */
.tab-content {
    transform: translateZ(0);
    will-change: scroll-position;
}

/* Legacy bottom-nav support for any remaining references */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    z-index: 9998;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
    min-height: 64px;
}

.nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 12px;
    min-height: 48px;
    min-width: 48px;
    position: relative;
    color: #64748b;
    font-weight: 500;
    flex: 1;
    max-width: 64px;
}

.nav-item:hover {
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
}

.nav-item.active {
    background: #4f46e5;
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.nav-item .nav-icon {
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s ease;
}

/* Nav text removed for native app feel */

/* Legacy nav-tab styles for any remaining references */
.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 12px;
    min-width: 64px;
    min-height: 64px;
    position: relative;
    flex: 1;
    max-width: 80px;
}

.nav-tab:hover {
    background: rgba(79, 70, 229, 0.08);
    transform: translateY(-1px);
}

.nav-tab.active {
    background: rgba(79, 70, 229, 0.12);
    color: #4f46e5;
}

.nav-tab.active .nav-icon {
    transform: scale(1.1);
    filter: brightness(1.2);
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
    display: block;
    line-height: 1;
}

.nav-label {
    font-size: 11px;
    font-weight: 500;
    color: #6b7280;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-tab.active .nav-label {
    color: #4f46e5;
    font-weight: 600;
}

/* Active indicator */
.nav-tab.active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: #4f46e5;
    border-radius: 0 0 4px 4px;
    animation: slideIn 0.3s ease;
}

/* Desktop tooltips for nav items */
@media (min-width: 769px) {
    .nav-item {
        position: relative;
    }
    .nav-item::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        background: var(--space-gray);
        color: var(--premium-white);
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 0.85rem;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                    0 1px 0px rgba(255, 255, 255, 0.1) inset;
        border: 1px solid var(--glass-border);
        margin-bottom: 8px;
    }
    .nav-item:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-4px);
    }
    /* Tooltip arrow */
    .nav-item::before {
        content: '';
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        width: 0;
        height: 0;
        border-left: 6px solid transparent;
        border-right: 6px solid transparent;
        border-top: 6px solid var(--space-gray);
        opacity: 0;
        visibility: hidden;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        pointer-events: none;
        z-index: 1001;
        margin-bottom: 2px;
    }
    .nav-item:hover::before {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-4px);
    }
}

@keyframes slideIn {
    from {
        width: 0;
        opacity: 0;
    }
    to {
        width: 32px;
        opacity: 1;
    }
}

/* ===== FLOATING ACTION BUTTON ===== */
.floating-action-btn {
    position: fixed;
    bottom: calc(80px + env(safe-area-inset-bottom));
    right: 20px;
    width: 56px;
    height: 56px;
    background: #4f46e5;
    border: none;
    border-radius: 50%;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4), 0 8px 32px rgba(79, 70, 229, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    transition: all 0.3s ease;
    transform: scale(0.9);
    opacity: 0;
}

.floating-action-btn.show {
    transform: scale(1);
    opacity: 1;
}

.floating-action-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5), 0 12px 40px rgba(79, 70, 229, 0.3);
}

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

.fab-icon {
    color: white;
    font-size: 24px;
    font-weight: 300;
    transition: transform 0.2s ease;
}

.floating-action-btn:hover .fab-icon {
    transform: rotate(90deg);
}

/* ===== SETTINGS CONTENT ===== */
.settings-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.setting-group {
    margin-bottom: 32px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group h3 {
    color: #2d3748;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.setting-group p {
    color: #64748b;
    margin: 8px 0;
}

.setting-group .btn {
    margin-right: 12px;
    margin-bottom: 8px;
}

/* View transitions */
.view-container {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.view-container.hiding {
    opacity: 0;
    transform: translateX(-20px);
}

.view-container.showing {
    opacity: 1;
    transform: translateX(0);
}

/* Player Row Styling */
.player-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.player-row:hover {
    border-color: #4f46e5;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.player-row .player-name {
    border: none;
    background: white;
    padding: 8px 10px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.position-checkboxes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.position-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 500;
    justify-content: center;
}

/* Position-specific colors (inverted style like table statistics) */
.position-checkboxes label[data-position="Forward"] {
    background: white;
    color: #6366f1;
    border: 2px solid #6366f1;
}

.position-checkboxes label[data-position="Midfield"] {
    background: white;
    color: #059669;
    border: 2px solid #059669;
}

.position-checkboxes label[data-position="Defense"] {
    background: white;
    color: #d97706;
    border: 2px solid #d97706;
}

.position-checkboxes label[data-position="Goalkeeper"] {
    background: white;
    color: #dc2626;
    border: 2px solid #dc2626;
}

/* Checked states - solid colors like field positions */
.position-checkboxes label[data-position="Forward"]:has(input[type="checkbox"]:checked) {
    background: #6366f1;
    color: white;
    border: 2px solid #6366f1;
}

.position-checkboxes label[data-position="Midfield"]:has(input[type="checkbox"]:checked) {
    background: #059669;
    color: white;
    border: 2px solid #059669;
}

.position-checkboxes label[data-position="Defense"]:has(input[type="checkbox"]:checked) {
    background: #d97706;
    color: white;
    border: 2px solid #d97706;
}

.position-checkboxes label[data-position="Goalkeeper"]:has(input[type="checkbox"]:checked) {
    background: #dc2626;
    color: white;
    border: 2px solid #dc2626;
}

/* Hover states for position colors */
.position-checkboxes label[data-position="Forward"]:hover {
    background: #eef2ff;
    border-color: #6366f1;
}

.position-checkboxes label[data-position="Midfield"]:hover {
    background: #ecfdf5;
    border-color: #059669;
}

.position-checkboxes label[data-position="Defense"]:hover {
    background: #fef3c7;
    border-color: #d97706;
}

.position-checkboxes label[data-position="Goalkeeper"]:hover {
    background: #fef2f2;
    border-color: #dc2626;
}

/* Hover states for checked items - slightly darker */
.position-checkboxes label[data-position="Forward"]:has(input[type="checkbox"]:checked):hover {
    background: #4f46e5;
    color: white;
}

.position-checkboxes label[data-position="Midfield"]:has(input[type="checkbox"]:checked):hover {
    background: #047857;
    color: white;
}

.position-checkboxes label[data-position="Defense"]:has(input[type="checkbox"]:checked):hover {
    background: #b45309;
    color: white;
}

.position-checkboxes label[data-position="Goalkeeper"]:has(input[type="checkbox"]:checked):hover {
    background: #b91c1c;
    color: white;
}


.position-checkboxes label input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.position-checkboxes label input[type="checkbox"]:checked + span {
    color: #4f46e5;
    font-weight: 600;
}

#addPlayerBtn {
    align-self: flex-start;
    margin-top: 8px;
}

.remove-player-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    align-self: flex-start;
}

.remove-player-btn:hover {
    background: #dc2626;
}

.player-row-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-row-header .player-name {
    flex: 1;
}

/* Position validation styling */
.position.preferred {
    border: 2px solid #10b981;
}

.position.not-preferred {
    border: 2px solid #f59e0b;
}

.position.invalid {
    border: 2px solid #ef4444;
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

.player-item.preferred {
    border-left: 4px solid #10b981;
}

.player-item.not-preferred {
    border-left: 4px solid #f59e0b;
}

.position-warning {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 4px 0;
    font-size: 0.875rem;
    color: #92400e;
}

/* Success animations */
.success-animation {
    animation: successPulse 0.6s ease-in-out;
}

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

/* Team Creation Full Page */
.team-creation-container {
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.creation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.creation-header .header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.creation-header .header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.creation-header h1 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
}

.team-creation-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.creation-card {
    background: var(--neutral-0);
    border-radius: var(--radius-2xl);
    padding: var(--space-6);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--neutral-200);
}

.creation-card h3 {
    color: var(--color-text-primary);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-semibold);
    margin-bottom: var(--space-4);
}

.players-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.players-container::-webkit-scrollbar {
    width: 6px;
}

.players-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.players-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.players-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Team Size Selector */
.team-size-selector {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.size-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.9rem;
}

.size-option:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.size-option input[type="radio"] {
    display: none;
}

.size-option input[type="radio"]:checked + span {
    color: #4f46e5;
    font-weight: 600;
}

.size-option:has(input[type="radio"]:checked) {
    border-color: #4f46e5;
    background: #eef2ff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

/* Formation Selector */
.formation-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-top: 8px;
}

.formation-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.formation-option:hover {
    border-color: #4f46e5;
    background: #eef2ff;
}

.formation-option input[type="radio"] {
    display: none;
}

.formation-option:has(input[type="radio"]:checked) {
    border-color: #4f46e5;
    background: #eef2ff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.formation-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 4px;
}

.formation-description {
    font-size: 0.875rem;
    color: #64748b;
}

.formation-option:has(input[type="radio"]:checked) .formation-name {
    color: #4f46e5;
}

/* Mini Field Preview for Formation Selector */
.formation-preview {
    margin-bottom: 8px;
}

.mini-field {
    width: 120px;
    height: 40px;
    background: linear-gradient(135deg, #2d7a3d 0%, #1e5f2a 50%, #16472a 100%);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 6px;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin: 0 auto;
}

.mini-field::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 2px;
    bottom: 2px;
    width: 1px;
    background: rgba(255, 255, 255, 0.6);
    transform: translateX(-50%);
}

.mini-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
}

.mini-section.defense {
    transform: translateX(-10%);
}

.mini-section.midfield {
    transform: translateX(-15%);
}

.mini-section.forward {
    transform: translateX(-20%);
}

.mini-section.goalkeeper {
    transform: translateX(0%);
}

.mini-position {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* Mini position colors to match main field */
.mini-position.position-forward {
    background: #6366f1;
}

.mini-position.position-midfield {
    background: #059669;
}

.mini-position.position-defense {
    background: #d97706;
}

.mini-position.position-goalkeeper {
    background: #dc2626;
}

/* Fixed Actions */

/* Click to remove position styling */
.position.occupied {
    cursor: pointer;
    position: relative;
}

.position.occupied::after {
    content: '×';
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.position.occupied:hover::after {
    opacity: 1;
}

/* Mobile responsive for player rows */
@media (max-width: 1024px) {
    .position-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .player-row {
        padding: 12px;
    }
    
    .team-size-selector {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .form-actions-fixed {
        flex-direction: column;
    }
}

/* Position Cards */
.position-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-align: center;
    color: white;
    min-width: 36px;
    min-height: 32px;
    margin: 1px;
    line-height: 1.1;
    vertical-align: middle;
    box-sizing: border-box;
}

.position-card small {
    font-size: 0.5rem;
    font-weight: 400;
    opacity: 0.9;
    margin-top: -2px;
}

/* Position substitution styling - position indicator above player name */
.position-substitution {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.substitution-player {
    font-size: 0.5rem;
    font-weight: 500;
    color: #6b7280;
    text-align: center;
    line-height: 1.1;
    max-width: 70px;
    word-wrap: break-word;
}

/* Position Color Coding */
.position-forward, .position-card.forward {
    background-color: #6366f1; /* Muted Indigo */
}

.position-midfield, .position-card.midfield {
    background-color: #059669; /* Forest Green */
}

.position-defense, .position-card.defense {
    background-color: #d97706; /* Amber */
}

.position-goalkeeper, .position-card.goalkeeper {
    background-color: #dc2626; /* Deep Red */
}

.position-bench, .position-card.bench {
    background-color: #6b7280; /* Cool Gray */
}

.position-jersey, .position-card.jersey {
    background-color: #ea580c; /* Bright Orange */
}

.position-absent, .position-card.absent {
    background-color: #9ca3af; /* Gray 400 */
    color: #374151; /* Gray 700 */
}

/* Statistics position cards */
.stat-line.positions .position-card {
    margin: 2px;
    min-height: auto;
    padding: 1px 4px;
    font-size: 0.55rem;
    line-height: 1;
    display: inline-block;
    height: auto;
}

/* Statistics position cards with inverted colors */
.stat-position-card {
    display: inline-block;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 0.55rem;
    font-weight: 600;
    text-align: center;
    min-width: auto;
    height: auto;
    margin: 1px;
    border: 1px solid;
    background: white;
    line-height: 1;
    vertical-align: middle;
    box-sizing: border-box;
}

.stat-position-card.forward {
    color: #6366f1;
    border-color: #6366f1;
}

.stat-position-card.midfield {
    color: #059669;
    border-color: #059669;
}

.stat-position-card.defense {
    color: #d97706;
    border-color: #d97706;
}

.stat-position-card.goalkeeper {
    color: #dc2626;
    border-color: #dc2626;
}

.stat-position-card.jersey {
    color: #ea580c;
    border-color: #ea580c;
}

/* Compact player stats for table */
.player-stats {
    font-size: 0.7rem;
    line-height: 1.1;
}

.player-stats .stat-line {
    margin: 1px 0;
}

/* Bench player styling */
.bench-player {
    background: #6b7280 !important;
    color: white !important;
    border-color: #4b5563 !important;
}

.bench-player:hover {
    background: #4b5563 !important;
    border-color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.25) !important;
}

/* ===== MOBILE ACCORDION TABLE ===== */
.mobile-table-container {
    display: none; /* Hidden by default, shown on mobile */
    flex-direction: column;
    gap: 12px; /* Consistent spacing for all accordion items */
}

.lineup-accordion {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.accordion-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.accordion-header {
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.accordion-header:hover {
    background: #f1f5f9;
}

.accordion-header.active {
    background: #eef2ff;
    border-bottom-color: #c7d2fe;
}

.accordion-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.accordion-toggle {
    font-size: 1.2rem;
    color: #64748b;
    transition: transform 0.2s ease;
}

.accordion-header.active .accordion-toggle {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-content.expanded {
    padding: 16px;
    max-height: 1000px; /* Large enough to accommodate content */
}

.period-lineup {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.player-assignment {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.player-assignment.forward {
    border-left-color: #6366f1;
    background: #fafbff;
}

.player-assignment.midfield {
    border-left-color: #059669;
    background: #f0fdf4;
}

.player-assignment.defense {
    border-left-color: #d97706;
    background: #fffbeb;
}

.player-assignment.goalkeeper {
    border-left-color: #be185d;
    background: #fdf2f8;
}

.player-assignment.bench {
    border-left-color: #6b7280;
    background: #f9fafb;
}

.player-assignment.jersey {
    border-left-color: #dc2626;
    background: #fef2f2;
}

.player-name-mobile {
    font-weight: 500;
    color: #1e293b;
}

.position-badge-mobile {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.position-badge-mobile.forward {
    background: #eef2ff;
    color: #6366f1;
}

.position-badge-mobile.midfield {
    background: #ecfdf5;
    color: #059669;
}

.position-badge-mobile.defense {
    background: #fef3c7;
    color: #d97706;
}

.position-badge-mobile.goalkeeper {
    background: #fce7f3;
    color: #be185d;
}

.position-badge-mobile.bench {
    background: #f3f4f6;
    color: #6b7280;
}

.position-badge-mobile.jersey {
    background: #fef2f2;
    color: #dc2626;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.stat-player {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid #e2e8f0;
}

.stat-player-name {
    font-weight: 500;
    color: #1e293b;
}

.stat-summary {
    display: flex;
    gap: 8px;
    font-size: 0.8rem;
    color: #64748b;
}

/* Desktop/Mobile toggle */
@media (max-width: 1024px) {
    .desktop-table {
        display: none !important;
    }

    .mobile-table-container {
        display: flex !important;
    }
}

@media (min-width: 1025px) {
    .mobile-table-container {
        display: none !important;
    }

    .desktop-table {
        display: block !important;
    }
}

/* Jersey player styling */
.jersey-player {
    background: #ea580c !important;
    color: white !important;
    border-color: #dc2626 !important;
}

.jersey-player:hover {
    background: #dc2626 !important;
    border-color: #b91c1c !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25) !important;
}
}

/* ===== HISTORY INTERFACE STYLES ===== */
.history-content {
    padding: 0.5rem;
    max-height: 100%;
    overflow-y: auto;
}

.history-controls {
    display: flex;
    gap: 1rem;
}

/* ===== MODERN GAME HISTORY ===== */
.games-list {
    display: grid;
    gap: 24px;
    margin-top: 20px;
}

.game-card {
    background: var(--space-gray);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    transition: all var(--transition-smooth);
    cursor: pointer;
    box-shadow: var(--neumorphic-shadow);
    backdrop-filter: var(--glass-backdrop);
    margin-bottom: 10px;
    position: relative;
}

.game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--electric-blue-alpha-30), transparent);
    opacity: 0;
    transition: all var(--transition-smooth);
}

.game-card:hover {
    border-color: var(--electric-blue-alpha-30);
    box-shadow: var(--neumorphic-shadow), 0 0 20px var(--electric-blue-alpha-20);
    transform: translateY(-2px);
}

.game-card:hover::before {
    opacity: 1;
}

.game-card-content {
    padding: 8px;
}

.game-primary {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.game-info {
    flex: 1;
}

.game-title {
    margin: 0 0 4px 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--premium-white);
    line-height: 1.3;
}

.game-subtitle {
    margin: 0;
    font-size: 0.8rem;
    color: var(--space-gray-6);
    font-weight: 500;
}

.game-date-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    min-width: 70px;
    margin-left: 12px;
}

.game-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-top: 12px;
    border-top: 1px solid #f1f5f9;
}

.game-details-modern {
    display: flex;
    gap: 16px;
    align-items: center;
}

.game-stat {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

.game-stat-icon {
    font-size: 0.8rem;
    opacity: 0.8;
}

.game-completion {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    color: #059669;
    font-weight: 600;
    background: #f0fdf4;
    padding: 3px 6px;
    border-radius: 6px;
}

.game-actions-modern {
    display: flex;
    gap: 6px;
    align-items: center;
}

.game-action-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.game-action-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.25);
}

.game-action-secondary {
    background: none;
    border: none;
    color: #64748b;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.game-action-secondary:hover {
    background: #fef2f2;
    color: #dc2626;
}

/* Empty state styling */
.games-list .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #64748b;
    background: white;
    border-radius: 16px;
    border: 2px dashed #e2e8f0;
}

.games-list .empty-state::before {
    content: '📚';
    display: block;
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Mobile responsive for game history */
@media (max-width: 1024px) {
    .game-card-content {
        padding: 12px;
    }

    .game-primary {
        margin-bottom: 8px;
    }

    .game-title {
        font-size: 1rem;
        margin-bottom: 2px;
    }

    .game-subtitle {
        font-size: 0.75rem;
    }

    .game-date-primary {
        padding: 4px 8px;
        font-size: 0.65rem;
        min-width: 60px;
        margin-left: 8px;
    }

    .game-metadata {
        padding-top: 8px;
        margin-bottom: 0;
    }

    .game-details-modern {
        gap: 12px;
    }

    .game-stat {
        font-size: 0.7rem;
        gap: 3px;
    }

    .game-completion {
        font-size: 0.65rem;
        padding: 2px 4px;
    }

    .game-action-primary {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .game-action-secondary {
        padding: 6px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .games-list {
        gap: 16px;
    }

    .game-card-content {
        padding: 8px;
    }

    .game-primary {
        margin-bottom: 6px;
    }

    .game-title {
        font-size: 0.9rem;
        line-height: 1.3;
    }

    .game-subtitle {
        font-size: 0.7rem;
    }

    .game-date-primary {
        padding: 3px 6px;
        font-size: 0.6rem;
        margin-left: 6px;
    }

    .game-metadata {
        padding-top: 6px;
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .game-details-modern {
        gap: 8px;
        justify-content: space-between;
    }

    .game-stat {
        font-size: 0.65rem;
    }

    .game-completion {
        font-size: 0.6rem;
        padding: 1px 3px;
    }

    .game-actions-modern {
        justify-content: center;
    }

    .game-action-primary {
        padding: 5px 8px;
        font-size: 0.7rem;
        flex: 1;
        max-width: 120px;
    }

    .game-action-secondary {
        padding: 5px;
        font-size: 0.75rem;
    }
}

/* Historical Game View */
.historical-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 8px;
}

.game-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

.game-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
}

.view-toggle .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.view-toggle .btn.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

/* Read-only Banner */
.read-only-banner {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: #92400e;
}

/* Read-only Field and Players Panel */
.soccer-field.read-only,
.players-panel.read-only {
    opacity: 0.9;
    pointer-events: none;
}

.soccer-field.read-only .position,
.players-panel.read-only .player-item {
    cursor: default !important;
}

.soccer-field.read-only .position:hover,
.players-panel.read-only .player-item:hover {
    transform: none !important;
    box-shadow: none !important;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .historical-game-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .game-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .game-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .game-actions {
        justify-content: stretch;
    }

    .view-game-btn {
        width: 100%;
    }
}

/* ===== GAME TIMER STYLES ===== */
.game-timer-container {
    padding: 20px;
    background: var(--space-gray);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin: 0.75rem 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: var(--neumorphic-shadow);
    backdrop-filter: var(--glass-backdrop);
}

/* Modern Timer Display */
.modern-timer-display {
    text-align: center;
    padding: 1.25rem 1rem;
    background: var(--space-gray-2);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--premium-white);
    margin-bottom: 1rem;
    box-shadow: var(--neumorphic-shadow);
    backdrop-filter: var(--glass-backdrop);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.period-badge {
    display: inline-block;
    background: var(--electric-blue);
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 1rem;
    border: 1px solid var(--electric-blue-dark);
    color: var(--premium-white);
    box-shadow: 0 2px 8px var(--electric-blue-alpha-30);
}

.digital-clock {
    margin: 1rem 0;
}

.time-digits {
    font-size: 3.25rem;
    font-weight: 200;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Courier New', monospace;
    line-height: 1;
    margin-bottom: 0.375rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    letter-spacing: 0.1em;
}

.time-remaining {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.timer-controls-modern {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.control-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 1px solid var(--space-gray-4);
    background: var(--space-gray-3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    touch-action: manipulation;
    user-select: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                0 1px 0px rgba(255, 255, 255, 0.1) inset;
}

.control-btn:hover {
    background: var(--space-gray-4);
    border-color: var(--electric-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px var(--electric-blue-alpha-20),
                0 1px 0px rgba(255, 255, 255, 0.15) inset;
}

.control-btn:active {
    transform: translateY(0);
}

.control-btn.primary {
    width: 68px;
    height: 68px;
    background: var(--electric-blue);
    border-color: var(--electric-blue-dark);
}

.control-btn.primary:hover {
    background: var(--electric-blue-dark);
    border-color: var(--electric-blue);
    box-shadow: 0 6px 20px var(--electric-blue-alpha-30),
                0 1px 0px rgba(255, 255, 255, 0.2) inset;
}

.control-icon {
    font-size: 1.3rem;
    color: var(--premium-white);
    font-weight: bold;
}

.control-btn.primary .control-icon {
    font-size: 1.7rem;
}

/* Progress Bar */
.timer-progress-container {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--space-gray-2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--neumorphic-shadow);
}

.timer-progress-bar {
    width: 100%;
    height: 12px;
    background: var(--space-gray-4);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.timer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--electric-blue), var(--electric-blue-dark));
    border-radius: 6px;
    transition: width 0.3s ease;
}

.progress-percentage {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--premium-white);
}

/* Notifications */
.timer-notifications {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--space-gray-2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--neumorphic-shadow);
}

.timer-notifications h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--premium-white);
}

.upcoming-subs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.upcoming-sub {
    padding: 0.5rem;
    background: #fef3c7;
    border: 1px solid #f59e0b;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.sub-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #92400e;
    text-transform: uppercase;
}

.sub-change {
    font-size: 0.875rem;
    font-weight: 500;
    color: #451a03;
}

.no-subs-message {
    margin: 0;
    padding: 1rem;
    text-align: center;
    color: var(--space-gray-6);
    font-style: italic;
    background: var(--space-gray-3);
    border-radius: 8px;
}

/* Quick Actions */
.timer-quick-actions {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timer-quick-actions h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.quick-action-btn {
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-weight: 600;
    touch-action: manipulation;
    user-select: none;
    transition: all 0.2s ease;
}

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

.quick-action-icon {
    font-size: 1.25rem;
    margin-bottom: 0.125rem;
}

.quick-action-text {
    font-size: 0.7rem;
    font-weight: 500;
}

.quick-action-btn.warning {
    background: #fbbf24;
    border-color: #f59e0b;
    color: #92400e;
}

.quick-action-btn.warning:hover {
    background: #f59e0b;
    color: white;
}

.quick-action-btn.danger {
    background: #f87171;
    border-color: #ef4444;
    color: #991b1b;
}

.quick-action-btn.danger:hover {
    background: #ef4444;
    color: white;
}

/* Time Warning Notifications */
.time-warning-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fbbf24;
    color: #92400e;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-size: 1.25rem;
    font-weight: 700;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: warningPulse 0.5s ease-in-out;
    border: 2px solid #f59e0b;
}

@keyframes warningPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

/* Mobile Optimizations */
@media (max-width: 1024px) {
    .game-timer-container {
        margin: 0.5rem 0;
        padding: 0.5rem;
    }

    .modern-timer-display {
        padding: 1rem 0.75rem;
        margin-bottom: 0.75rem;
    }

    .time-digits {
        font-size: 2.75rem;
    }

    .timer-controls-modern {
        gap: 0.5rem;
        margin-top: 0.75rem;
    }

    .control-btn {
        width: 44px;
        height: 44px;
    }

    .control-btn.primary {
        width: 60px;
        height: 60px;
    }

    .control-icon {
        font-size: 1.1rem;
    }

    .control-btn.primary .control-icon {
        font-size: 1.5rem;
    }

    .quick-actions-grid {
        grid-template-columns: 1fr;
        gap: 0.375rem;
    }

    .quick-action-btn {
        min-height: 44px;
    }

    .timer-notifications,
    .timer-quick-actions,
    .timer-progress-container {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .timer-notifications h3,
    .timer-quick-actions h3 {
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }
}

/* High Contrast Mode for Outdoor Use */
@media (prefers-contrast: high) {
    .game-timer-container {
        background: white;
        border: 2px solid #000;
    }

    .timer-display {
        color: #000;
        text-shadow: none;
    }

    .timer-progress-fill {
        background: #000;
    }
}

/* ===== ERROR HANDLING STYLES ===== */
.error-modal {
    z-index: 10000;
}

.error-modal-content {
    max-width: 500px;
    width: 90%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(220, 38, 38, 0.3);
}

.error-header {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.error-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.error-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.error-body {
    padding: 24px;
}

.error-message {
    margin: 0 0 20px 0;
    color: #374151;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.error-retry-btn, .error-refresh-btn {
    flex: 1;
}

.error-details-container {
    border-top: 1px solid #e5e7eb;
    padding-top: 15px;
}

.error-details {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0 0 0;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 11px;
    line-height: 1.4;
}

/* Error Toast Styles */
.error-toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10001;
    pointer-events: none;
}

.error-toast {
    background: white;
    border-left: 4px solid #ef4444;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    animation: slideInRight 0.3s ease, fadeOut 0.3s ease 4.5s forwards;
    pointer-events: auto;
    min-width: 300px;
    max-width: 400px;
}

.error-toast-content {
    display: flex;
    align-items: center;
    padding: 16px;
    gap: 12px;
}

.error-toast-icon {
    flex-shrink: 0;
    font-size: 18px;
}

.error-toast-message {
    flex: 1;
    color: #374151;
    font-size: 14px;
    line-height: 1.4;
}

.error-toast-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.error-toast-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Mobile Error Styles */
@media (max-width: 1024px) {
    .error-modal-content {
        width: 95%;
        margin: 20px;
    }

    .error-actions {
        flex-direction: column;
    }

    .error-toast {
        min-width: auto;
        max-width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
    }

    .error-toast-container {
        right: 20px;
        left: 20px;
    }
}

/* Floating Header - Apple-inspired minimal design */
