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

        /* CSS Variables for Light and Dark Mode */
        :root {
            /* Light Mode (Default) */
            --bg-gradient-start: #667eea;
            --bg-gradient-end: #764ba2;
            --bg-primary: #ffffff;
            --bg-secondary: #f8f9fa;
            --bg-sidebar: #ffffff;
            --text-primary: #333333;
            --text-secondary: #666666;
            --text-muted: #999999;
            --border-color: #dee2e6;
            --card-bg: #ffffff;
            --card-border: #667eea;
            --card-selected-bg: #667eea;
            --card-selected-text: #ffffff;
            --btn-primary-bg: #667eea;
            --btn-primary-text: #ffffff;
            --btn-primary-hover: #5568d3;
            --btn-secondary-bg: #6c757d;
            --btn-secondary-text: #ffffff;
            --btn-secondary-hover: #5a6268;
            --modal-overlay: rgba(0, 0, 0, 0.5);
            --modal-bg: #ffffff;
            --input-bg: #ffffff;
            --input-border: #ced4da;
            --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
            --shadow-lg: 0 10px 20px rgba(102, 126, 234, 0.3);
        }

        /* Dark Mode Variables */
        body.dark-mode {
            --bg-gradient-start: #1a1a2e;
            --bg-gradient-end: #16213e;
            --bg-primary: #1e1e2e;
            --bg-secondary: #2a2a3e;
            --bg-sidebar: #252535;
            --text-primary: #e0e0e0;
            --text-secondary: #b0b0b0;
            --text-muted: #808080;
            --border-color: #3a3a4e;
            --card-bg: #2a2a3e;
            --card-border: #667eea;
            --card-selected-bg: #667eea;
            --card-selected-text: #ffffff;
            --btn-primary-bg: #667eea;
            --btn-primary-text: #ffffff;
            --btn-primary-hover: #5568d3;
            --btn-secondary-bg: #3a3a4e;
            --btn-secondary-text: #e0e0e0;
            --btn-secondary-hover: #4a4a5e;
            --modal-overlay: rgba(0, 0, 0, 0.7);
            --modal-bg: #2a2a3e;
            --input-bg: #1e1e2e;
            --input-border: #3a3a4e;
            --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
            --shadow-md: 0 4px 6px rgba(0,0,0,0.3);
            --shadow-lg: 0 10px 20px rgba(102, 126, 234, 0.5);
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
            background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
            min-height: 100vh;
            padding: 20px;
            color: var(--text-primary);
            transition: background 0.3s ease, color 0.3s ease;
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
        }

        .login-screen {
            background: white;
            border-radius: 12px;
            padding: 40px;
            max-width: 500px;
            margin: 100px auto;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
        }

        .login-screen h1 {
            color: #333;
            margin-bottom: 30px;
            text-align: center;
        }

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

        label {
            display: block;
            margin-bottom: 5px;
            color: #555;
            font-weight: 500;
        }

        input[type="text"], input[type="password"], select {
            width: 100%;
            padding: 12px;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
            font-size: 16px;
            transition: border-color 0.3s;
        }

        input[type="text"]:focus, input[type="password"]:focus, select:focus {
            outline: none;
            border-color: #667eea;
        }

        .role-tags {
            display: flex;
            gap: 10px;
            margin-top: 10px;
        }

        .tag-option {
            flex: 1;
            padding: 10px;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
            cursor: pointer;
            text-align: center;
            transition: all 0.3s;
        }

        .tag-option:hover {
            border-color: #667eea;
        }

        .tag-option.selected {
            background: #667eea;
            color: white;
            border-color: #667eea;
        }

        button {
            width: 100%;
            padding: 14px;
            background: #667eea;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.3s;
        }

        button:hover {
            background: #5568d3;
        }

        button:disabled {
            background: #ccc;
            cursor: not-allowed;
        }

        .create-room-link, .superadmin-link {
            text-align: center;
            margin-top: 15px;
            color: #667eea;
            cursor: pointer;
            text-decoration: underline;
        }

        .room-list {
            max-height: 200px;
            overflow-y: auto;
            border: 2px solid #e0e0e0;
            border-radius: 6px;
            margin-top: 10px;
        }

        .room-item {
            padding: 12px;
            border-bottom: 1px solid #e0e0e0;
            cursor: pointer;
            transition: background 0.3s;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .room-item:hover {
            background: #f8f9fa;
        }

        .room-item.selected {
            background: #667eea;
            color: white;
        }

        .room-item:last-child {
            border-bottom: none;
        }

        .room-info {
            font-size: 12px;
            color: #666;
            margin-top: 3px;
        }

        .room-item.selected .room-info {
            color: rgba(255,255,255,0.8);
        }

        .delete-room-btn {
            padding: 4px 12px;
            font-size: 12px;
            width: auto;
            background: #dc3545;
        }

        .delete-room-btn:hover {
            background: #c82333;
        }

        .main-app {
            display: none;
        }

        .header {
            background: white;
            border-radius: 12px;
            padding: 20px 30px;
            margin-bottom: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .header-left h1 {
            color: #333;
            font-size: 24px;
        }

        .room-name {
            color: #667eea;
            font-size: 14px;
            margin-top: 5px;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 15px;
        }

        .settings-icon {
            width: auto;
            height: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.3s, opacity 0.3s;
            font-size: 28px;
            color: #6c757d;
        }

        .settings-icon:hover {
            transform: scale(1.1);
            opacity: 0.8;
        }

        .dark-mode-toggle {
            width: auto;
            height: auto;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.3s, opacity 0.3s;
            font-size: 24px;
            margin-right: 15px;
        }

        .dark-mode-toggle:hover {
            transform: scale(1.1);
            opacity: 0.8;
        }

        .user-badge {
            padding: 8px 16px;
            background: #667eea;
            color: white;
            border-radius: 20px;
            font-weight: 500;
        }

        .user-badge.superadmin {
            background: #dc3545;
        }

        .logout-btn {
            padding: 8px 20px;
            width: auto;
            background: #dc3545;
        }

        .logout-btn:hover {
            background: #c82333;
        }

        .content {
            display: grid;
            grid-template-columns: 350px 1fr;
            gap: 20px;
        }

        .sidebar {
            background: white;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            max-height: calc(100vh - 160px);
            overflow-y: auto;
        }

        .sidebar h2 {
            color: #333;
            margin-bottom: 20px;
            font-size: 20px;
        }

        .bli-list {
            list-style: none;
        }

        .bli-item {
            padding: 15px;
            margin-bottom: 10px;
            background: #f8f9fa;
            border-radius: 8px;
            border-left: 4px solid #667eea;
            cursor: pointer;
            transition: all 0.3s;
        }

        .bli-item.draggable {
            cursor: move;
        }

        .bli-item:hover {
            background: #e9ecef;
        }

        .bli-item.dragging {
            opacity: 0.5;
        }

        .bli-item.drag-over {
            border-top: 3px solid #667eea;
        }

        .bli-item.active {
            background: #667eea;
            color: white;
        }

        .bli-controls {
            display: flex;
            gap: 5px;
            margin-top: 10px;
        }

        .bli-controls button {
            padding: 6px 12px;
            font-size: 12px;
        }

        .skip-btn {
            background: #ffc107;
        }

        .skip-btn:hover {
            background: #e0a800;
        }

        .delete-btn {
            background: #dc3545;
        }

        .delete-btn:hover {
            background: #c82333;
        }

        .add-bli {
            margin-bottom: 20px;
        }

        .add-bli input {
            margin-bottom: 10px;
        }

        .main-content {
            background: white;
            border-radius: 12px;
            padding: 30px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        .current-bli {
            text-align: center;
            margin-bottom: 40px;
        }

        .current-bli h2 {
            color: #667eea;
            font-size: 28px;
            margin-bottom: 10px;
        }

        .current-bli-description {
            color: #666;
            font-size: 18px;
        }

        .voting-status {
            text-align: center;
            color: #666;
            margin-bottom: 20px;
            font-size: 14px;
        }

        .voting-cards {
            display: flex;
            justify-content: center;
            gap: 15px;
            flex-wrap: wrap;
            margin-bottom: 40px;
        }

        .card {
            width: 80px;
            height: 120px;
            background: white;
            border: 3px solid #667eea;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 32px;
            font-weight: bold;
            color: #667eea;
            cursor: pointer;
            transition: all 0.3s;
        }

        .card:hover {
            transform: translateY(-10px);
            box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
        }

        .card.selected {
            background: #667eea;
            color: white;
            transform: translateY(-10px);
        }

        /* Card configuration with reorder buttons */
        .card-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
        }

        .reorder-buttons {
            display: flex;
            gap: 4px;
            justify-content: center;
        }

        .reorder-btn {
            width: 28px;
            height: 28px;
            padding: 0;
            border: 1px solid #667eea;
            background: white;
            color: #667eea;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            line-height: 1;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .reorder-btn:hover:not(:disabled) {
            background: #667eea;
            color: white;
            transform: scale(1.1);
        }

        .reorder-btn:disabled {
            opacity: 0.3;
            cursor: not-allowed;
        }

        .reorder-btn:active:not(:disabled) {
            transform: scale(0.95);
        }

        .card-config {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 20px;
            justify-content: flex-start;
        }

        .participants {
            margin-top: 40px;
        }

        .participants h3 {
            color: #333;
            margin-bottom: 20px;
            font-size: 20px;
        }

        .participant-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 15px;
        }

        .participant-card {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            border-left: 4px solid #6c757d;
        }

        .participant-card.voted {
            border-left-color: #28a745;
        }

        .participant-card.observer {
            opacity: 0.6;
            border-left-color: #6c757d;
        }

        .participant-name {
            font-weight: 600;
            color: #333;
            margin-bottom: 5px;
        }

        .participant-role {
            font-size: 12px;
            color: #666;
            margin-bottom: 5px;
        }

        .participant-vote {
            font-size: 24px;
            font-weight: bold;
            color: #667eea;
            margin-top: 10px;
        }

        .participant-vote.hidden {
            color: #28a745;
        }

        .admin-controls {
            display: flex;
            gap: 10px;
            justify-content: center;
            margin-top: 30px;
            flex-wrap: wrap;
        }

        .admin-controls button {
            width: auto;
            padding: 12px 24px;
        }

        .reveal-btn {
            background: #28a745;
        }

        .reveal-btn:hover:not(:disabled) {
            background: #218838;
        }

        .next-btn {
            background: #007bff;
        }

        .next-btn:hover:not(:disabled) {
            background: #0056b3;
        }

        .config-btn {
            background: #6c757d;
        }

        .config-btn:hover {
            background: #5a6268;
        }

        .results {
            background: #f8f9fa;
            padding: 20px;
            border-radius: 8px;
            margin-top: 20px;
        }

        .results h4 {
            color: #333;
            margin-bottom: 15px;
        }

        .result-stats {
            display: flex;
            gap: 20px;
            justify-content: center;
            flex-wrap: wrap;
        }

        .stat {
            text-align: center;
        }

        .stat-value {
            font-size: 32px;
            font-weight: bold;
            color: #667eea;
        }

        .stat-label {
            color: #666;
            font-size: 14px;
        }

        .observer-controls {
            margin-top: 10px;
        }

        .observer-controls button {
            width: auto;
            padding: 4px 8px;
            font-size: 11px;
        }

        .no-bli {
            text-align: center;
            padding: 60px 20px;
            color: #999;
        }

        .no-bli h3 {
            font-size: 24px;
            margin-bottom: 10px;
        }

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

        .modal.active {
            display: flex;
        }

        .modal-content {
            background: white;
            border-radius: 12px;
            padding: 30px;
            max-width: 900px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
        }

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

        .modal-header h2 {
            color: #333;
        }

        .close-btn {
            background: none;
            color: #999;
            font-size: 24px;
            width: auto;
            padding: 0;
            cursor: pointer;
        }

        .card-config {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            margin-bottom: 20px;
        }

        .voting-history {
            margin-top: 20px;
        }

        .history-item {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 8px;
            margin-bottom: 10px;
            border-left: 4px solid #28a745;
        }

        .history-title {
            font-weight: 600;
            color: #333;
            margin-bottom: 10px;
        }

        .history-votes {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            font-size: 14px;
            color: #666;
        }

        .history-vote {
            background: white;
            padding: 5px 10px;
            border-radius: 4px;
        }

        .warning-text {
            color: #dc3545;
            font-size: 14px;
            margin-top: 5px;
        }

        .error-message {
            background: #f8d7da;
            border: 1px solid #f5c6cb;
            color: #721c24;
            padding: 12px;
            border-radius: 6px;
            margin-bottom: 15px;
        }

        .success-message {
            background: #d4edda;
            border: 1px solid #c3e6cb;
            color: #155724;
            padding: 12px;
            border-radius: 6px;
            margin-bottom: 15px;
        }

        .loading {
            text-align: center;
            padding: 20px;
            color: #666;
        }

        .checkbox-group {
            display: flex;
            align-items: center;
            gap: 10px;
            margin: 15px 0;
        }

        .checkbox-group input[type="checkbox"] {
            width: 20px;
            height: 20px;
            cursor: pointer;
        }

        .checkbox-group label {
            margin: 0;
            cursor: pointer;
        }

        .settings-section {
            border-top: 1px solid #e0e0e0;
            padding-top: 20px;
            margin-top: 20px;
        }

        .settings-section h3 {
            color: #333;
            margin-bottom: 15px;
            font-size: 18px;
        }

        .tag-separator {
            border-top: 2px solid #667eea;
            margin: 20px 0 10px 0;
            padding-top: 10px;
        }

        .tag-label {
            font-weight: bold;
            color: #667eea;
            font-size: 16px;
            margin-bottom: 10px;
        }

/* Release Notes Styles */
.release-notes-link {
    color: #000 !important;
    text-decoration: underline;
    cursor: pointer;
}

.release-notes-link:hover {
    opacity: 0.8;
}

.release-notes-content {
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.release-version {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.release-version.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left-color: #fff;
}

.release-version.current h3 {
    color: white;
}

.release-version h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 18px;
}

.release-version ul {
    margin-left: 20px;
    line-height: 1.8;
}

.release-version li {
    margin-bottom: 8px;
}

/* BLI URL Links */
.bli-url {
    display: inline-block;
    margin-top: 5px;
    color: #667eea;
    text-decoration: none;
    font-size: 12px;
    padding: 2px 8px;
    background: #e8f0fe;
    border-radius: 4px;
}

.bli-url:hover {
    background: #d2e3fc;
    text-decoration: underline;
}

.bli-item.active .bli-url {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.bli-item.active .bli-url:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Restart Button */
.btn-warning {
    background: #ffc107;
    color: #333;
}

.btn-warning:hover:not(:disabled) {
    background: #e0a800;
}

/* Access Code Display */
#displayAccessCode {
    user-select: all;
}

/* ========================================
   MOBILE RESPONSIVE STYLES
   ======================================== */

/* Tablet Landscape and Below (1024px) */
@media screen and (max-width: 1024px) {
    .content {
        grid-template-columns: 300px 1fr;
        gap: 15px;
    }
    
    .modal-content {
        max-width: 90%;
        padding: 25px;
    }
}

/* Tablet Portrait and Below (768px) */
@media screen and (max-width: 768px) {
    /* Stack sidebar and main content vertically */
    .content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .sidebar {
        max-height: none;
        margin-bottom: 15px;
    }
    
    /* Reduce card size slightly */
    .card {
        width: 70px;
        height: 105px;
        font-size: 28px;
    }
    
    /* Participant grid - 2 columns max */
    .participant-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    /* Modal adjustments */
    .modal-content {
        max-width: 95%;
        padding: 20px;
        max-height: 90vh;
    }
    
    /* Card configuration - wrap more aggressively */
    .card-config {
        gap: 8px;
    }
    
    .card-container {
        flex: 0 0 auto;
    }
}

/* Mobile Landscape (640px) */
@media screen and (max-width: 640px) {
    /* Header adjustments */
    .header h1 {
        font-size: 20px;
    }
    
    .header-buttons {
        gap: 5px;
    }
    
    .header-buttons button {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    /* Smaller voting cards */
    .card {
        width: 60px;
        height: 90px;
        font-size: 24px;
        gap: 10px;
    }
    
    /* Participant cards - single column */
    .participant-grid {
        grid-template-columns: 1fr;
    }
    
    .participant-card {
        padding: 12px;
    }
    
    /* BLI items */
    .bli-item {
        padding: 12px;
        font-size: 14px;
    }
    
    /* Form inputs */
    input, select, textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Buttons */
    .primary-btn, .secondary-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
}

/* Mobile Portrait (480px) */
@media screen and (max-width: 480px) {
    /* Header */
    .header {
        padding: 12px 15px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header-buttons button {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    /* Even smaller voting cards for portrait */
    .voting-cards {
        gap: 8px;
        margin-bottom: 30px;
    }
    
    .card {
        width: 50px;
        height: 75px;
        font-size: 20px;
        border: 2px solid #667eea;
    }
    
    /* Sidebar padding */
    .sidebar, .main-content {
        padding: 15px;
    }
    
    /* Modal full screen on small mobile */
    .modal-content {
        max-width: 100%;
        width: 95%;
        max-height: 95vh;
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 18px;
    }
    
    /* Card configuration - smaller cards */
    .card-config .card {
        width: 60px;
        height: 90px;
        font-size: 24px;
    }
    
    .reorder-btn {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }
    
    /* Form groups */
    .form-group {
        margin-bottom: 15px;
    }
    
    /* Participant cards */
    .participant-card {
        padding: 10px;
    }
    
    .participant-name {
        font-size: 14px;
    }
    
    .participant-role {
        font-size: 11px;
    }
    
    .participant-vote {
        font-size: 16px;
    }
    
    /* Room list */
    .room-item {
        padding: 12px;
    }
    
    .room-name {
        font-size: 16px;
    }
    
    /* Results */
    .results-grid {
        gap: 10px;
    }
    
    .result-card {
        padding: 12px;
    }
}

/* Small Mobile Portrait (360px) */
@media screen and (max-width: 360px) {
    /* Ultra compact for small phones */
    .header h1 {
        font-size: 16px;
    }
    
    .header-buttons {
        flex-wrap: wrap;
    }
    
    /* Tiny voting cards */
    .voting-cards {
        gap: 6px;
    }
    
    .card {
        width: 45px;
        height: 68px;
        font-size: 18px;
    }
    
    /* Single column everything */
    .participant-grid,
    .results-grid,
    .card-config {
        grid-template-columns: 1fr;
    }
    
    /* Compact padding */
    .sidebar, .main-content {
        padding: 12px;
    }
    
    /* Modal */
    .modal-content {
        padding: 12px;
    }
    
    /* Buttons */
    .primary-btn, .secondary-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
}

/* Landscape orientation specific */
@media screen and (max-height: 500px) and (orientation: landscape) {
    /* Compact vertical spacing in landscape */
    .header {
        padding: 8px 15px;
    }
    
    .voting-cards {
        margin-bottom: 20px;
    }
    
    .sidebar {
        max-height: calc(100vh - 100px);
    }
    
    .modal-content {
        max-height: 95vh;
        overflow-y: auto;
    }
}

/* High DPI / Retina displays - keep crisp on mobile */
@media screen and (-webkit-min-device-pixel-ratio: 2),
       screen and (min-resolution: 192dpi) {
    .card, .participant-card, .bli-item {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */

body.dark-mode .login-screen,
body.dark-mode .sidebar,
body.dark-mode .main-content,
body.dark-mode .modal-content {
    background: var(--bg-primary);
    color: var(--text-primary);
}

body.dark-mode .login-screen h1,
body.dark-mode .login-screen h2,
body.dark-mode h1, body.dark-mode h2, body.dark-mode h3 {
    color: var(--text-primary);
}

body.dark-mode .card {
    background: var(--card-bg);
    border-color: var(--card-border);
    color: var(--card-border);
}

body.dark-mode .card:hover {
    box-shadow: var(--shadow-lg);
}

body.dark-mode .card.selected {
    background: var(--card-selected-bg);
    color: var(--card-selected-text);
}

body.dark-mode .participant-card,
body.dark-mode .bli-item,
body.dark-mode .room-item {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode .participant-name,
body.dark-mode .room-name {
    color: var(--text-primary);
}

body.dark-mode .participant-role,
body.dark-mode .room-info {
    color: var(--text-secondary);
}

body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: var(--input-border);
}

body.dark-mode input::placeholder {
    color: var(--text-muted);
}

body.dark-mode .primary-btn {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

body.dark-mode .primary-btn:hover:not(:disabled) {
    background: var(--btn-primary-hover);
}

body.dark-mode .secondary-btn,
body.dark-mode .logout-btn {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-text);
}

body.dark-mode .secondary-btn:hover:not(:disabled),
body.dark-mode .logout-btn:hover {
    background: var(--btn-secondary-hover);
}

body.dark-mode .header {
    background: var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

body.dark-mode .user-badge {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

body.dark-mode .settings-icon {
    color: var(--text-secondary);
}

body.dark-mode .modal-overlay {
    background: var(--modal-overlay);
}

body.dark-mode .result-card {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.dark-mode .voting-result {
    color: var(--text-primary);
}

body.dark-mode label {
    color: var(--text-primary);
}

body.dark-mode .error-message {
    background: #3d1f1f;
    color: #ff6b6b;
    border-color: #ff6b6b;
}

body.dark-mode .success-message {
    background: #1f3d1f;
    color: #51cf66;
    border-color: #51cf66;
}

body.dark-mode .warning-text {
    color: #ffa94d;
}

body.dark-mode .participant-vote {
    color: var(--text-primary);
}

body.dark-mode .bli-controls button,
body.dark-mode .reorder-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

body.dark-mode .bli-controls button:hover,
body.dark-mode .reorder-btn:hover:not(:disabled) {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
}

body.dark-mode .release-notes-link {
    color: var(--text-primary);
}

body.dark-mode .release-notes-link:hover {
    color: var(--btn-primary-bg);
}

body.dark-mode .current-bli {
    background: var(--bg-secondary);
}

body.dark-mode .completed-items {
    border-color: var(--border-color);
}

body.dark-mode .completed-item {
    color: var(--text-secondary);
}

body.dark-mode .room-password-display {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Dark mode transitions */
body.dark-mode,
body.dark-mode .card,
body.dark-mode .participant-card,
body.dark-mode input,
body.dark-mode select,
body.dark-mode button,
body.dark-mode .modal-content {
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* App Icon Styling */
.app-icon {
    height: 32px;
    width: 32px;
    vertical-align: middle;
    margin-right: 10px;
    display: inline-block;
}

.login-screen .app-icon {
    height: 48px;
    width: 48px;
}

.header h1 .app-icon {
    height: 28px;
    width: 28px;
}

/* ========================================
   DARK MODE STYLE FIXES v2.15.1
   ======================================== */

/* Fix release notes text readability */
body.dark-mode .release-version {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-left-color: #667eea;
}

body.dark-mode .release-version.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-left-color: #fff;
}

body.dark-mode .release-version h3 {
    color: var(--text-primary);
}

body.dark-mode .release-version.current h3 {
    color: white;
}

body.dark-mode .release-version ul {
    color: var(--text-primary);
}

body.dark-mode .release-version li {
    color: var(--text-primary);
}

/* Fix disabled button text readability */
body.dark-mode button:disabled {
    background: #3a3a4e;
    color: #666666;
    border-color: #3a3a4e;
}

body.dark-mode .primary-btn:disabled {
    background: #3a3a4e;
    color: #666666;
}

body.dark-mode .secondary-btn:disabled {
    background: #2a2a3a;
    color: #666666;
}

body.dark-mode .reveal-btn:disabled,
body.dark-mode .next-btn:disabled {
    background: #3a3a4e;
    color: #666666;
}

/* Ensure better contrast for disabled states */
body.dark-mode button:disabled:hover {
    background: #3a3a4e;
    color: #666666;
}

/* ========================================
   MORE UI FIXES v2.15.2
   ======================================== */

/* No completed message styling */
.no-completed-message {
    padding: 10px;
    color: #999;
    text-align: center;
    font-size: 14px;
}

body.dark-mode .no-completed-message {
    color: #666;
}

/* History subtitle styling */
.history-subtitle {
    font-size: 12px;
    color: #666;
}

body.dark-mode .history-subtitle {
    color: #999;
}

/* Fix dark mode for completed items (history-item) */
body.dark-mode .history-item {
    background: var(--bg-secondary);
    border-left-color: #28a745;
}

body.dark-mode .history-title {
    color: var(--text-primary);
}

body.dark-mode .history-vote {
    background: var(--bg-primary);
    color: var(--text-primary);
}

/* Fix dark mode for results section */
body.dark-mode .results {
    background: var(--bg-secondary);
}

body.dark-mode .results h4 {
    color: var(--text-primary);
}

body.dark-mode .stat-value {
    color: var(--text-primary);
}

body.dark-mode .stat-label {
    color: var(--text-secondary);
}

/* Fix release notes link in dark mode - make it lighter */
body.dark-mode .release-notes-link {
    color: var(--text-primary) !important;
}

body.dark-mode .release-notes-link:hover {
    color: var(--btn-primary-bg) !important;
}

/* Fix current BLI description in dark mode */
body.dark-mode .current-bli h2 {
    color: #8b9dff; /* Lighter purple for dark mode */
}

body.dark-mode .current-bli-description {
    color: var(--text-secondary);
}

body.dark-mode .voting-status {
    color: var(--text-secondary);
}

/* Tag label in dark mode */
body.dark-mode .tag-label {
    color: #8b9dff; /* Lighter purple to match */
}

body.dark-mode .tag-separator {
    border-top-color: #8b9dff;
}

/* ========================================
   PAPER TOSS FEATURE v3.0.0
   ======================================== */

/* Notification Container */
.paper-notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 350px;
}

/* Individual Notification */
.paper-notification {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-left: 4px solid #667eea;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
}

.paper-notification.show {
    opacity: 1;
    transform: translateX(0);
}

/* Notification Types */
.paper-notification-success {
    border-left-color: #28a745;
}

.paper-notification-error {
    border-left-color: #dc3545;
}

.paper-notification-warning {
    border-left-color: #ffc107;
}

.paper-notification-info {
    border-left-color: #17a2b8;
}

.paper-notification-hit {
    border-left-color: #ff6b6b;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe5e5 100%);
    font-weight: 600;
}

/* Hit Notification Content */
.paper-hit-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.paper-emoji {
    font-size: 24px;
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Throw Paper Button */
.throw-paper-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
    z-index: 10;
}

.throw-paper-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.2) rotate(15deg);
}

.throw-paper-btn:active {
    transform: scale(0.9) rotate(-15deg);
}

/* Paper Hit Animation */
.participant-card {
    position: relative;
    transition: all 0.1s;
}

.participant-card.paper-hit {
    animation: shake 0.5s;
    background: rgba(255, 200, 0, 0.2);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-8px); }
    20%, 40%, 60%, 80% { transform: translateX(8px); }
}

/* Screen Shake Animation */
.screen-shake {
    animation: screenShake 0.5s;
}

@keyframes screenShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Dark Mode for Paper Toss */
body.dark-mode .paper-notification {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

body.dark-mode .paper-notification-hit {
    background: linear-gradient(135deg, #3a1f1f 0%, #4a2f2f 100%);
}

body.dark-mode .throw-paper-btn:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Mobile Responsive */
@media screen and (max-width: 640px) {
    .paper-notifications-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .throw-paper-btn {
        font-size: 16px;
        top: 8px;
        right: 8px;
    }
}
