/* CSS Variables for Dark/Light Mode */
:root {
    /* Light Mode Colors - Stimmige, angenehme Farben */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-danger: #ef4444;
    --accent-warning: #f59e0b;
    --accent-success: #10b981;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --button-hover: #4f46e5;
    --button-active: #4338ca;
    --surface-primary: #f8fafc;
}

[data-theme="dark"] {
    /* Dark Mode Colors - Stimmige, angenehme Farben */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --accent-primary: #818cf8;
    --accent-secondary: #a78bfa;
    --accent-danger: #f87171;
    --accent-warning: #fbbf24;
    --accent-success: #34d399;
    --border-color: #475569;
    --shadow-color: rgba(0, 0, 0, 0.25);
    --button-hover: #6366f1;
    --button-active: #4f46e5;
    --surface-primary: #1e293b;
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
}

/* Base Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 8px 32px var(--shadow-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    pointer-events: none;
}

header h1 {
    font-size: 2.4rem;
    font-weight: 700;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.header-controls {
    display: flex;
    gap: 15px;
}

/* Dark Mode Toggle */
.dark-mode-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.dark-mode-toggle .sun {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle .moon {
    display: none;
}

[data-theme="dark"] .dark-mode-toggle .sun {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border: 2px solid #1f2937;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    box-sizing: border-box;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: #374151;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    background: #4b5563;
    border-color: #6b7280;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: #374151;
    color: white;
    border-color: #1f2937;
}

.btn-secondary {
    background: #374151;
    color: white;
    border-color: #1f2937;
}

.btn-success {
    background: #374151;
    color: white;
    border-color: #1f2937;
}

.btn-danger {
    background: #374151;
    color: white;
    border-color: #1f2937;
}

.btn-warning {
    background: #374151;
    color: white;
    border-color: #1f2937;
}

.btn-info {
    background: #374151;
    color: white;
    border-color: #1f2937;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    min-height: 36px;
}

.btn-large {
    padding: 16px 24px;
    font-size: 1.1rem;
    min-height: 52px;
}

/* Section Styles */
.section {
    background: var(--bg-secondary);
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px var(--shadow-color);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
}

.section h2 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 1.8rem;
    font-weight: 600;
    position: relative;
}

.section h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 48px;
    height: 2px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 1px;
}

/* Form Styles */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px var(--shadow-color);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1), 0 4px 16px var(--shadow-color);
    transform: translateY(-1px);
}

.form-control:hover {
    border-color: var(--accent-secondary);
    box-shadow: 0 4px 16px var(--shadow-color);
}

/* Login Section */
.login-section {
    text-align: center;
    max-width: 420px;
    margin: 0 auto;
    background: var(--bg-primary);
    padding: 36px;
    border-radius: 16px;
    box-shadow: 0 6px 24px var(--shadow-color);
    border: 1px solid var(--border-color);
}

.login-section h2 {
    margin-bottom: 28px;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 600;
}

.login-section .form-group {
    margin-bottom: 24px;
}

.login-section .form-control {
    font-size: 1rem;
    padding: 14px 18px;
    border-width: 2px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.login-section .form-control:focus {
    border-width: 2px;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-1px);
}

.login-section .btn {
    width: 100%;
    margin-top: 8px;
    font-size: 1.1rem;
    padding: 16px 28px;
    border-radius: 12px;
    font-weight: 600;
}

/* Bingo Section */
.bingo-section {
    text-align: center;
}

/* Bingo Controls */
.bingo-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.bingo-controls .btn {
    min-width: 120px;
}

/* Bingo Grid */
.bingo-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin: 20px auto;
    max-width: 600px;
    box-sizing: border-box;
}

.bingo-field {
    aspect-ratio: 1;
    min-height: 100px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    box-sizing: border-box;
}

.bingo-field:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.bingo-field.marked {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.bingo-field.frei {
    background: var(--surface-primary);
    color: var(--text-primary);
    font-weight: 600;
}

.bingo-field.frei:hover {
    background: var(--accent-warning);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
}

.bingo-field.empty {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-style: dashed;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--bg-primary);
    margin: 5% auto;
    padding: 28px;
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 16px 48px var(--shadow-color);
    border: 1px solid var(--border-color);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--accent-danger);
    background: var(--bg-secondary);
}

/* User Management Section */
.user-management-section {
    display: none;
}

.user-management-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.user-management-header h2 {
    color: var(--text-primary);
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Field Pool Management Section */
.field-pool-management-section {
    display: none;
}

.field-pool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.field-pool-header h2 {
    color: var(--text-primary);
    margin: 0;
}

.add-field-section,
.existing-fields-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    margin-bottom: 28px;
}

.add-field-section h3,
.existing-fields-section h3 {
    color: var(--text-primary);
    margin: 0 0 20px 0;
    font-size: 1.2rem;
}

.add-field-form .form-row {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 16px;
    align-items: end;
}

.add-field-form .form-group {
    margin: 0;
}

.fields-info {
    background: var(--bg-secondary);
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
}

.fields-info p {
    margin: 0 0 8px 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.fields-info p:last-child {
    margin-bottom: 0;
}

.fields-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    box-shadow: 0 4px 20px var(--shadow-color);
    margin-top: 20px;
}

.fields-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.fields-table th,
.fields-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.fields-table th {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.fields-table th:first-child {
    border-top-left-radius: 12px;
}

.fields-table th:last-child {
    border-top-right-radius: 12px;
}

.fields-table tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.fields-table tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.fields-table tr:hover {
    background: var(--bg-secondary);
    transition: background-color 0.2s ease;
}

.fields-table tr:last-child {
    border-bottom: none;
}

.field-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.fields-actions {
    margin-bottom: 20px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.selection-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-primary);
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-primary);
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label:hover .checkmark {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.fields-table th:first-child {
    text-align: center;
}

.fields-table th:first-child input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.fields-table td:first-child {
    text-align: center;
}

.fields-table td:first-child input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.add-user-section,
.existing-users-section {
    background: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 12px var(--shadow-color);
    border: 1px solid var(--border-color);
    margin-bottom: 28px;
}

.add-user-section h3,
.existing-users-section h3 {
    color: var(--text-primary);
    margin: 0 0 20px 0;
    font-size: 1.2rem;
}

.add-user-form .form-row {
    display: grid;
    grid-template-columns: 2fr 2fr 1.5fr 1.5fr;
    gap: 16px;
    align-items: end;
}

.add-user-form .form-group {
    margin: 0;
}

.users-table-container {
    overflow-x: auto;
    border-radius: 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    box-shadow: 0 4px 20px var(--shadow-color);
    margin-top: 20px;
}

.users-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-primary);
    border-radius: 12px;
    overflow: hidden;
}

.users-table th,
.users-table td {
    padding: 16px 20px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.users-table th {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.users-table th:first-child {
    border-top-left-radius: 12px;
}

.users-table th:last-child {
    border-top-right-radius: 12px;
}

.users-table tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.users-table tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

.users-table tr:hover {
    background: var(--bg-secondary);
    transition: background-color 0.2s ease;
}

.users-table tr:last-child {
    border-bottom: none;
}

.user-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* Connection Info */
.connection-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.connection-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

.connection-status.connected {
    background: var(--accent-success);
    color: white;
}

.connection-status.disconnected {
    background: var(--accent-danger);
    color: white;
}

#userCount {
    background: var(--accent-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* Password Strength */
.password-strength {
    margin-top: 8px;
    padding: 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
}

.password-strength.weak {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.password-strength.medium {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.password-strength.strong {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* User Info */
.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-secondary);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 15px;
}

.user-info span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
}

.user-actions-top {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Modal Footer */
.modal-footer {
    padding: 20px 0 0 0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-body p {
    margin-bottom: 16px;
    color: var(--text-primary);
}

/* Responsive Design */
/* Mobile Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 8px;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 15px 10px;
    }
    
    header h1 {
        font-size: 1.6rem;
        margin: 0;
    }
    
    .header-controls {
        justify-content: center;
    }
    
    /* Connection Info - Mobile optimiert */
    .connection-info {
        flex-direction: column;
        gap: 8px;
        text-align: center;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .connection-status {
        font-size: 0.85rem;
        padding: 6px 10px;
    }
    
    #userCount {
        font-size: 0.85rem;
        padding: 8px 12px;
        background: var(--bg-secondary);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* User Info - Mobile optimiert */
    .user-info {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 12px;
        margin-bottom: 15px;
    }
    
    .user-info span {
        font-size: 0.9rem;
        padding: 8px 12px;
        background: var(--bg-secondary);
        border-radius: 8px;
        border: 1px solid var(--border-color);
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .user-actions-top {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }
    
    .user-actions-top .btn {
        width: 100%;
        max-width: 180px;
        margin: 0 auto;
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    /* Bingo Controls - Mobile optimiert */
    .bingo-controls {
        flex-direction: column;
        gap: 10px;
        padding: 12px;
        margin-bottom: 15px;
        align-items: center;
    }
    
    .bingo-controls .btn {
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
        padding: 12px 18px;
        font-size: 0.9rem;
        min-height: 48px;
    }
    
    /* Bingo Grid - Mobile optimiert */
    .bingo-grid {
        gap: 6px;
        padding: 12px;
        margin: 0 auto;
        max-width: calc(100vw - 24px);
    }
    
    .bingo-field {
        min-height: 75px;
        font-size: 0.75rem;
        padding: 6px 4px;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    /* User Management - Mobile optimiert */
    .user-management-section {
        padding: 12px;
    }
    
    .user-management-header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .add-user-form .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .add-user-form .form-group {
        width: 100%;
    }
    
         .users-table-container {
         overflow-x: auto;
         margin: 0 -12px;
         padding: 0 12px;
         border-radius: 8px;
         border: 1px solid var(--border-color);
         background: var(--bg-primary);
         box-shadow: 0 2px 12px var(--shadow-color);
     }
     
     .users-table {
         font-size: 0.9rem;
         min-width: 400px;
         border-radius: 8px;
         border-collapse: collapse;
         margin-top: 0;
         background: var(--bg-primary);
         overflow: hidden;
         box-shadow: none;
     }
     
     .users-table th,
     .users-table td {
         padding: 16px 12px;
         font-size: 0.9rem;
         line-height: 1.4;
     }
     
     .users-table th {
         background: var(--bg-tertiary);
         color: var(--text-primary);
         font-weight: 600;
         text-transform: uppercase;
         font-size: 0.8rem;
         letter-spacing: 0.3px;
         position: static;
         top: auto;
         z-index: auto;
         border-radius: 0;
     }
     
     .users-table th:first-child,
     .users-table th:last-child,
     .users-table tr:last-child td:first-child,
     .users-table tr:last-child td:last-child {
         border-radius: 0;
     }
     
     .users-table tr:last-child {
         border-bottom: 1px solid var(--border-color);
     }
    
    .user-actions {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }
    
    .user-actions .btn {
        font-size: 0.75rem;
        padding: 6px 8px;
        min-height: 36px;
    }
    
    /* Modals - Mobile optimiert */
    .modal-content {
        margin: 15px;
        max-width: calc(100vw - 30px);
        max-height: calc(100vh - 30px);
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-height: 44px;
    }
    
    /* Form Controls - Mobile optimiert */
    .form-control {
        font-size: 16px; /* Verhindert Zoom auf iOS */
        padding: 12px;
        min-height: 44px;
    }
    
    .btn {
        font-size: 16px; /* Verhindert Zoom auf iOS */
        padding: 12px 18px;
        min-height: 44px; /* Touch-freundliche Größe */
    }
    
    /* Dark Mode Toggle - Mobile optimiert */
    .dark-mode-toggle {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    /* Section spacing */
    .section {
        margin-bottom: 15px;
        padding: 12px;
    }
    
    /* Form groups */
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        display: block;
        margin-bottom: 6px;
        font-size: 0.9rem;
    }
}

/* Extra Small Mobile Devices */
@media (max-width: 480px) {
    .container {
        padding: 6px;
    }
    
    header {
        padding: 12px 8px;
    }
    
    header h1 {
        font-size: 1.4rem;
    }
    
    .connection-info,
    .user-info,
    .bingo-controls {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .bingo-grid {
        gap: 5px;
        padding: 10px;
    }
    
    .bingo-field {
        min-height: 65px;
        font-size: 0.7rem;
        padding: 5px 3px;
    }
    
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .user-actions-top .btn {
        max-width: 160px;
        font-size: 0.85rem;
    }
    
    .bingo-controls .btn {
        max-width: 200px;
        font-size: 0.85rem;
    }
}

/* Ultra Small Mobile Devices */
@media (max-width: 360px) {
    .container {
        padding: 4px;
    }
    
    header h1 {
        font-size: 1.3rem;
    }
    
    .bingo-field {
        min-height: 60px;
        font-size: 0.65rem;
        padding: 4px 2px;
    }
    
    .user-actions-top .btn,
    .bingo-controls .btn {
        max-width: 140px;
        font-size: 0.8rem;
        padding: 10px 14px;
    }
}

/* User Notifications */
.user-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 16px;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.5s ease-out;
    max-width: 300px;
    word-wrap: break-word;
    backdrop-filter: blur(10px);
    border: 2px solid transparent;
}

.user-notification.join {
    background: linear-gradient(135deg, #28a745, #20c997);
    border-color: #1e7e34;
}

.user-notification.leave {
    background: linear-gradient(135deg, #dc3545, #c82333);
    border-color: #bd2130;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.user-notification.fade-out {
    animation: slideOutRight 0.5s ease-in forwards;
}

/* Mobile responsive adjustments for notifications */
@media (max-width: 768px) {
    .user-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        font-size: 14px;
        padding: 12px 16px;
    }
}

/* Bingo Win Modal - Special Styling */
#bingoPopupModal .modal-content {
    max-width: 400px;
    width: fit-content;
    height: fit-content;
    padding: 0;
    text-align: center;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border: 3px solid #047857;
    box-shadow: 0 20px 60px rgba(16, 185, 129, 0.4);
    display: block;
}

#bingoPopupModal .modal-header {
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    margin: 0;
    padding: 16px 20px 12px 20px;
}

#bingoPopupModal .modal-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin: 0;
}

#bingoPopupModal .modal-body {
    margin: 0;
    padding: 16px 20px;
}

#bingoPopupModal .modal-body p {
    color: white;
    font-size: 1.1rem;
    font-weight: 500;
    margin: 0 0 8px 0;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

#bingoPopupModal .modal-body p:last-child {
    margin-bottom: 0;
}

#bingoPopupModal .modal-footer {
    border-top: 2px solid rgba(255, 255, 255, 0.2);
    padding: 16px 20px;
    margin: 0;
    justify-content: center;
}

#bingoPopupModal .btn {
    background: white;
    color: #059669;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 14px 32px;
    border-radius: 12px;
    border: 2px solid white;
    transition: all 0.3s ease;
    min-width: 120px;
}

#bingoPopupModal .btn:hover {
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.3);
}

#bingoPopupModal .btn:active {
    transform: translateY(0);
}

/* Mobile responsive for Bingo Modal */
@media (max-width: 768px) {
    #bingoPopupModal .modal-content {
        margin: 20px;
        max-width: calc(100vw - 40px);
        padding: 20px;
    }
    
    #bingoPopupModal .modal-title {
        font-size: 1.6rem;
    }
    
    #bingoPopupModal .modal-body p {
        font-size: 1rem;
    }
    
    #bingoPopupModal .btn {
        width: 100%;
        max-width: 200px;
        padding: 12px 24px;
        font-size: 1rem;
    }
}

/* Loading Animation Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    max-height: 400px;
    padding: 30px 20px;
    text-align: center;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-tertiary));
    border-radius: 16px;
    border: 2px solid var(--border-color);
    box-shadow: 0 8px 32px var(--shadow-color);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 4px 16px var(--shadow-color);
}

.loading-text {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    text-shadow: 0 1px 4px var(--shadow-color);
}

.loading-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
    opacity: 0.8;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading container responsive */
@media (max-width: 768px) {
    .loading-container {
        min-height: 250px;
        max-height: 300px;
        padding: 25px 15px;
    }
    
    .loading-spinner {
        width: 50px;
        height: 50px;
        margin-bottom: 20px;
    }
    
    .loading-text {
        font-size: 1.3rem;
    }
    
    .loading-subtitle {
        font-size: 0.9rem;
    }
}

/* Error state styling */
.loading-container.error {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border-color: #fecaca;
}

.loading-container.error .loading-text {
    color: #dc2626;
}

.loading-container.error .loading-subtitle {
    color: #991b1b;
}

.error-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}
