        *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
        
        :root {
            --bg-dark: #0d0d0d;
            --bg-card: #1a1a2e;
            --bg-card-hover: #252542;
            --bg-elevated: #16162a;
            --text-primary: #ffffff;
            --text-secondary: #a0a0b8;
            --text-muted: #6b6b80;
            
            --pastel-pink: #FFB3BA;
            --pastel-mint: #BAFFC9;
            --pastel-lavender: #D4A5FF;
            --pastel-yellow: #FFFFBA;
            --pastel-blue: #BAE1FF;
            --pastel-coral: #FFCAB0;
            
            --discord-blurple: #5865F2;
            --success: #4ade80;
            --error: #f87171;
            
            --radius-sm: 8px;
            --radius-md: 12px;
            --radius-lg: 20px;
            --radius-xl: 28px;
            
            --shadow-glow: 0 0 40px rgba(212, 165, 255, 0.15);
            --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
        }
        
        body {
            font-family: 'Outfit', sans-serif;
            background: var(--bg-dark);
            color: var(--text-primary);
            min-height: 100vh;
            line-height: 1.6;
        }
        
        /* Background Effects */
        .bg-pattern {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 0;
            overflow: hidden;
        }
        
        .bg-pattern::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background-image: 
                radial-gradient(circle at 20% 30%, rgba(212, 165, 255, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 80% 70%, rgba(186, 225, 249, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 50% 50%, rgba(255, 179, 186, 0.04) 0%, transparent 60%);
        }
        
        .grain-overlay {
            position: fixed;
            inset: 0;
            pointer-events: none;
            z-index: 1000;
            opacity: 0.03;
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
        }
        
        /* Layout */
        .app-container {
            position: relative;
            z-index: 1;
            min-height: 100vh;
        }
        
        /* Header */
        .header {
            position: sticky;
            top: 0;
            z-index: 100;
            padding: 16px 24px;
            background: rgba(13, 13, 13, 0.8);
            backdrop-filter: blur(20px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }
        
        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .logo {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .logo-icon {
            width: 44px;
            height: 44px;
            background: var(--pastel-lavender);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--bg-dark);
            font-size: 24px;
        }
        
        .logo-text {
            font-weight: 700;
            font-size: 1.25rem;
            letter-spacing: -0.5px;
        }
        
        .logo-text span {
            color: var(--pastel-lavender);
        }
        
        .header-actions {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .user-badge {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 6px 14px 6px 6px;
            background: var(--bg-card);
            border-radius: 100px;
            border: 1px solid rgba(255, 255, 255, 0.08);
        }
        
        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            object-fit: cover;
        }
        
        .user-name {
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .admin-badge {
            padding: 2px 8px;
            background: var(--pastel-yellow);
            color: var(--bg-dark);
            font-size: 0.7rem;
            font-weight: 700;
            border-radius: 100px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 24px;
            border: none;
            border-radius: var(--radius-md);
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            text-decoration: none;
        }
        
        .btn-primary {
            background: var(--pastel-lavender);
            color: var(--bg-dark);
        }
        
        .btn-primary:hover {
            background: #c9a0ff;
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(212, 165, 255, 0.3);
        }
        
        .btn-discord {
            background: var(--discord-blurple);
            color: white;
        }
        
        .btn-discord:hover {
            background: #4752c4;
            transform: translateY(-2px);
            box-shadow: 0 8px 24px rgba(88, 101, 242, 0.4);
        }
        
        .btn-ghost {
            background: transparent;
            color: var(--text-secondary);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .btn-ghost:hover {
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-primary);
        }
        
        .btn-sm {
            padding: 8px 16px;
            font-size: 0.85rem;
        }
        
        .btn .material-icons-round {
            font-size: 20px;
        }
        
        /* Landing Page */
        .landing {
            max-width: 1200px;
            margin: 0 auto;
            padding: 80px 24px;
        }
        
        .hero {
            text-align: center;
            margin-bottom: 80px;
        }
        
        .hero-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: rgba(212, 165, 255, 0.1);
            border: 1px solid rgba(212, 165, 255, 0.2);
            border-radius: 100px;
            font-size: 0.85rem;
            color: var(--pastel-lavender);
            margin-bottom: 24px;
        }
        
        .hero h1 {
            font-size: clamp(2.5rem, 6vw, 4rem);
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -1px;
            margin-bottom: 20px;
        }
        
        .hero h1 .accent-text {
            color: var(--pastel-lavender);
        }
        
        .hero-description {
            font-size: 1.2rem;
            color: var(--text-secondary);
            max-width: 600px;
            margin: 0 auto 40px;
        }
        
        .hero-cta {
            display: flex;
            gap: 16px;
            justify-content: center;
            flex-wrap: wrap;
        }
        
        /* Features Grid */
        .features-section {
            margin-bottom: 80px;
        }
        
        .section-header {
            text-align: center;
            margin-bottom: 48px;
        }
        
        .section-header h2 {
            font-size: 1.75rem;
            font-weight: 700;
            margin-bottom: 12px;
        }
        
        .section-header p {
            color: var(--text-secondary);
        }
        
        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 24px;
        }
        
        .feature-card {
            background: var(--bg-card);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-lg);
            padding: 32px;
            transition: all 0.3s ease;
        }
        
        .feature-card:hover {
            background: var(--bg-card-hover);
            transform: translateY(-4px);
            box-shadow: var(--shadow-card);
        }
        
        .feature-icon {
            width: 56px;
            height: 56px;
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 20px;
            font-size: 28px;
        }
        
        .feature-icon.pink { background: rgba(255, 179, 186, 0.15); color: var(--pastel-pink); }
        .feature-icon.mint { background: rgba(186, 255, 201, 0.15); color: var(--pastel-mint); }
        .feature-icon.lavender { background: rgba(212, 165, 255, 0.15); color: var(--pastel-lavender); }
        .feature-icon.yellow { background: rgba(255, 255, 186, 0.15); color: var(--pastel-yellow); }
        .feature-icon.blue { background: rgba(186, 225, 255, 0.15); color: var(--pastel-blue); }
        .feature-icon.coral { background: rgba(255, 202, 176, 0.15); color: var(--pastel-coral); }
        
        .feature-card h3 {
            font-size: 1.25rem;
            font-weight: 600;
            margin-bottom: 8px;
        }
        
        .feature-card p {
            color: var(--text-secondary);
            font-size: 0.95rem;
        }
        
        .feature-tag {
            display: inline-block;
            padding: 4px 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 100px;
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 16px;
        }
        
        .feature-tag.soon {
            background: rgba(212, 165, 255, 0.1);
            color: var(--pastel-lavender);
        }
        
        /* Dashboard */
        .dashboard {
            display: none;
            max-width: 1400px;
            margin: 0 auto;
            padding: 32px 24px;
        }
        
        .dashboard.active {
            display: block;
        }
        
        .dashboard-grid {
            display: grid;
            grid-template-columns: 320px 1fr;
            gap: 24px;
        }
        
        @media (max-width: 1024px) {
            .dashboard-grid {
                grid-template-columns: 1fr;
            }
        }
        
        /* Sidebar */
        .sidebar {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }
        
        .card {
            background: var(--bg-card);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-lg);
            padding: 24px;
        }
        
        .card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 20px;
        }
        
        .card-header .material-icons-round {
            color: var(--pastel-lavender);
        }
        
        .card-title {
            font-weight: 600;
            font-size: 1rem;
        }
        
        /* Form Elements */
        .form-group {
            margin-bottom: 16px;
        }
        
        .form-label {
            display: block;
            font-size: 0.8rem;
            font-weight: 500;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        .form-hint {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 4px;
            opacity: 0.8;
        }

        .role-checkbox-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 200px;
            overflow-y: auto;
            padding: 8px;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            border: 1px solid rgba(255, 255, 255, 0.08);
        }

        .role-checkbox-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 8px;
            border-radius: var(--radius-sm);
            transition: background 0.2s;
        }

        .role-checkbox-item:hover {
            background: rgba(255, 255, 255, 0.05);
        }

        .role-checkbox-item input[type="checkbox"] {
            width: 16px;
            height: 16px;
        }

        .role-checkbox-item .role-name {
            font-size: 0.875rem;
        }

        .role-checkbox-item .role-color {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .form-select {
            width: 100%;
            padding: 12px 16px;
            background: var(--bg-elevated);
            border: 1px solid rgba(255, 255, 255, 0.08);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='%23a0a0b8' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            transition: all 0.2s ease;
        }
        
        .form-select:focus {
            outline: none;
            border-color: var(--pastel-lavender);
            box-shadow: 0 0 0 3px rgba(212, 165, 255, 0.15);
        }
        
        .form-select:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .form-select option {
            background: var(--bg-card);
        }
        
        /* Stats Bar */
        .stats-bar {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-top: 20px;
            padding-top: 20px;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }
        
        .stat-item {
            text-align: center;
        }
        
        .stat-value {
            font-family: 'Space Mono', monospace;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--pastel-mint);
        }
        
        .stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
        }
        
        /* Member List */
        .member-list {
            max-height: 300px;
            overflow-y: auto;
            margin-top: 16px;
            scrollbar-width: thin;
            scrollbar-color: transparent transparent;
            transition: scrollbar-color 0.3s ease;
        }
        
        .member-list:hover {
            scrollbar-color: rgba(212, 165, 255, 0.3) transparent;
        }
        
        .member-list::-webkit-scrollbar {
            width: 6px;
        }
        
        .member-list::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .member-list::-webkit-scrollbar-thumb {
            background: transparent;
            border-radius: 3px;
            transition: background 0.3s ease;
        }
        
        .member-list:hover::-webkit-scrollbar-thumb {
            background: rgba(212, 165, 255, 0.3);
        }
        
        .member-list::-webkit-scrollbar-thumb:hover {
            background: rgba(212, 165, 255, 0.5);
        }
        
        .member-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 12px;
            border-radius: var(--radius-sm);
            transition: all 0.2s ease;
            cursor: default;
        }
        
        .member-item:hover {
            background: rgba(255, 255, 255, 0.03);
        }
        
        .member-item.observer {
            opacity: 0.4;
        }
        
        .member-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--pastel-blue);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.85rem;
            color: var(--bg-dark);
            overflow: hidden;
            flex-shrink: 0;
        }
        
        .member-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .member-info {
            flex: 1;
            min-width: 0;
        }
        
        .member-name {
            font-weight: 500;
            font-size: 0.9rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        .member-stats {
            font-size: 0.75rem;
            color: var(--text-muted);
        }
        
        .member-stats .kd {
            color: var(--pastel-yellow);
            font-weight: 600;
        }
        
        .icon-btn {
            width: 32px;
            height: 32px;
            border-radius: var(--radius-sm);
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .icon-btn:hover {
            background: rgba(255, 255, 255, 0.08);
            color: var(--text-primary);
        }
        
        .icon-btn.active {
            background: rgba(255, 179, 186, 0.15);
            color: var(--pastel-pink);
        }
        
        /* Main Content */
        .main-content {
            display: flex;
            flex-direction: column;
            gap: 24px;
        }
        
        /* Feature Tabs */
        .feature-tabs {
            display: flex;
            gap: 8px;
            padding: 6px;
            background: var(--bg-card);
            border-radius: var(--radius-lg);
            width: fit-content;
        }
        
        .feature-tab {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 20px;
            border: none;
            border-radius: var(--radius-md);
            background: transparent;
            color: var(--text-secondary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.95rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .feature-tab:hover {
            color: var(--text-primary);
            background: rgba(255, 255, 255, 0.05);
        }
        
        .feature-tab.active {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }
        
        .feature-tab .material-icons-round {
            font-size: 20px;
        }
        
        /* Feature Panels */
        .feature-panel {
            display: none;
        }
        
        .feature-panel.active {
            display: block;
        }
        
        /* Team Randomizer */
        .mode-selector {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 12px;
            margin-bottom: 24px;
        }
        
        .mode-card {
            padding: 20px;
            background: var(--bg-elevated);
            border: 2px solid transparent;
            border-radius: var(--radius-md);
            text-align: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .mode-card:hover {
            border-color: rgba(255, 255, 255, 0.1);
        }
        
        .mode-card.active {
            border-color: var(--pastel-lavender);
            background: rgba(212, 165, 255, 0.08);
        }
        
        .mode-card .material-icons-round {
            font-size: 32px;
            margin-bottom: 8px;
            color: var(--pastel-lavender);
        }
        
        .mode-card .game-icon {
            font-size: 32px;
            margin-bottom: 8px;
            display: block;
        }

        .recruit-game-selector {
            grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        }

        .mode-name {
            font-weight: 600;
            margin-bottom: 4px;
        }

        .mode-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        
        .action-btn {
            width: 100%;
            padding: 18px 32px;
            font-size: 1.1rem;
            background: var(--pastel-mint);
            color: var(--bg-dark);
            border: none;
            border-radius: var(--radius-md);
            font-family: 'Outfit', sans-serif;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
        }
        
        .action-btn:hover:not(:disabled) {
            background: #a8f0c0;
            transform: translateY(-2px);
            box-shadow: 0 8px 32px rgba(186, 255, 201, 0.3);
        }
        
        .action-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }
        
        /* Results */
        .results-container {
            margin-top: 24px;
        }
        
        .teams-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 20px;
        }
        
        .teams-grid.multi {
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        }
        
        @media (max-width: 600px) {
            .teams-grid {
                grid-template-columns: 1fr;
            }
        }
        
        .team-card {
            background: var(--bg-elevated);
            border-radius: var(--radius-lg);
            overflow: hidden;
            animation: slideUp 0.4s ease forwards;
            opacity: 0;
        }
        
        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }
        
        .team-header {
            padding: 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        
        .team-alpha .team-header {
            background: var(--pastel-blue);
            color: var(--bg-dark);
        }
        
        .team-beta .team-header {
            background: var(--pastel-coral);
            color: var(--bg-dark);
        }
        
        .team-party .team-header {
            background: var(--pastel-lavender);
            color: var(--bg-dark);
        }
        
        .team-name {
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .team-count {
            font-weight: 500;
            opacity: 0.8;
        }
        
        .team-members {
            padding: 16px;
        }
        
        .team-member {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px;
            background: rgba(255, 255, 255, 0.02);
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
        }
        
        .team-member:last-child {
            margin-bottom: 0;
        }
        
        .team-member-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.8rem;
            overflow: hidden;
        }
        
        .team-alpha .team-member-avatar {
            background: var(--pastel-blue);
            color: var(--bg-dark);
        }
        
        .team-beta .team-member-avatar {
            background: var(--pastel-coral);
            color: var(--bg-dark);
        }
        
        .team-party .team-member-avatar {
            background: var(--pastel-lavender);
            color: var(--bg-dark);
        }
        
        .team-member-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .team-member-name {
            flex: 1;
            font-weight: 500;
            font-size: 0.9rem;
        }
        
        .team-member-kd {
            font-family: 'Space Mono', monospace;
            font-size: 0.8rem;
            color: var(--pastel-yellow);
        }

        /* Team Adjust Mode */
        .team-card.adjust-mode {
            border: 2px solid var(--pastel-lavender);
            box-shadow: 0 0 20px rgba(212, 165, 255, 0.2);
        }

        .team-member.swappable {
            cursor: pointer;
            transition: all 0.2s ease;
            border: 2px solid transparent;
        }

        .team-member.swappable:hover {
            background: rgba(212, 165, 255, 0.15);
            border-color: var(--pastel-lavender);
            transform: translateY(-2px);
        }

        .team-member.selected-for-swap {
            background: rgba(212, 165, 255, 0.25) !important;
            border-color: var(--pastel-lavender) !important;
            box-shadow: 0 0 12px rgba(212, 165, 255, 0.4);
        }

        .team-result-actions-row {
            display: flex;
            gap: 12px;
            align-items: center;
            flex-wrap: wrap;
        }

        /* VC Move Section */
        .vc-move-section {
            background: rgba(255, 255, 255, 0.03);
            border-radius: var(--radius-md);
            padding: 16px;
            margin-top: 16px;
        }

        .vc-move-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 12px;
        }

        .vc-move-header .material-icons-round {
            font-size: 18px;
            color: var(--pastel-mint);
        }

        .vc-move-controls {
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .vc-move-row {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .vc-move-row .form-label-sm {
            font-size: 0.8rem;
            color: var(--text-secondary);
            min-width: 80px;
            flex-shrink: 0;
        }

        .vc-move-row .form-select-sm {
            flex: 1;
            min-width: 140px;
        }

        .vc-move-row .btn {
            flex-shrink: 0;
        }

        @media (max-width: 768px) {
            .vc-move-row {
                flex-wrap: wrap;
            }

            .vc-move-row .form-label-sm {
                min-width: 100%;
                margin-bottom: -4px;
            }

            .vc-move-row .form-select-sm {
                flex: 1;
                min-width: 0;
            }
        }

        /* Balance Mode Toggle */
        .balance-mode-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 16px;
            background: rgba(255, 255, 255, 0.03);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-md);
            margin-top: 16px;
        }

        .toggle-label {
            display: flex;
            align-items: center;
            gap: 10px;
            cursor: pointer;
            user-select: none;
        }

        .toggle-label input[type="checkbox"] {
            display: none;
        }

        .toggle-slider {
            width: 44px;
            height: 24px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 12px;
            position: relative;
            transition: background 0.3s ease;
        }

        .toggle-slider::after {
            content: '';
            position: absolute;
            width: 18px;
            height: 18px;
            background: white;
            border-radius: 50%;
            top: 3px;
            left: 3px;
            transition: transform 0.3s ease;
        }

        .toggle-label input[type="checkbox"]:checked + .toggle-slider {
            background: var(--pastel-mint);
        }

        .toggle-label input[type="checkbox"]:checked + .toggle-slider::after {
            transform: translateX(20px);
        }

        .toggle-text {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .balance-hint {
            font-size: 0.8rem;
            color: var(--text-muted);
            opacity: 0.7;
            transition: opacity 0.3s ease;
        }

        .balance-hint.active {
            opacity: 1;
            color: var(--pastel-mint);
        }

        /* Action Button Group */
        .action-btn-group {
            display: flex;
            gap: 12px;
            margin-top: 16px;
        }

        .action-btn-secondary {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .action-btn-secondary:hover:not(:disabled) {
            background: rgba(255, 255, 255, 0.1);
            border-color: var(--pastel-lavender);
        }

        /* Draft Mode Styles */
        .draft-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .draft-turn-indicator {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 12px 20px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-md);
            font-size: 1rem;
        }

        .turn-label {
            color: var(--text-muted);
        }

        .turn-team {
            font-weight: 600;
            padding: 4px 12px;
            border-radius: var(--radius-sm);
        }

        .turn-team.team-1 {
            background: var(--pastel-blue);
            color: var(--bg-dark);
        }

        .turn-team.team-2 {
            background: var(--pastel-coral);
            color: var(--bg-dark);
        }

        .draft-teams {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }

        .draft-team {
            background: rgba(255, 255, 255, 0.03);
            border: 2px solid transparent;
            border-radius: var(--radius-md);
            padding: 16px;
            transition: all 0.3s ease;
        }

        .draft-team.active-turn {
            border-color: var(--pastel-lavender);
            box-shadow: 0 0 20px rgba(212, 165, 255, 0.2);
        }

        .draft-team-1.active-turn {
            border-color: var(--pastel-blue);
            box-shadow: 0 0 20px rgba(186, 225, 255, 0.2);
        }

        .draft-team-2.active-turn {
            border-color: var(--pastel-coral);
            box-shadow: 0 0 20px rgba(255, 202, 176, 0.2);
        }

        .draft-team-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            font-weight: 600;
        }

        .draft-team-1 .draft-team-header .material-icons-round {
            color: var(--pastel-blue);
        }

        .draft-team-2 .draft-team-header .material-icons-round {
            color: var(--pastel-coral);
        }

        .draft-team-count {
            margin-left: auto;
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        .draft-team-members {
            display: flex;
            flex-direction: column;
            gap: 8px;
            min-height: 60px;
        }

        .draft-member {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-sm);
            animation: slideUp 0.3s ease forwards;
        }

        .draft-member-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.75rem;
            background: var(--pastel-lavender);
            color: var(--bg-dark);
            overflow: hidden;
        }

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

        .draft-member-name {
            font-size: 0.9rem;
        }

        .draft-empty {
            padding: 16px;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.85rem;
        }

        .draft-pool {
            background: rgba(255, 255, 255, 0.03);
            border-radius: var(--radius-md);
            padding: 16px;
        }

        .draft-pool-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 12px;
            font-weight: 600;
        }

        .draft-pool-header .material-icons-round {
            color: var(--pastel-mint);
        }

        .draft-pool-count {
            margin-left: auto;
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        .draft-pool-members {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .draft-pool-member {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid transparent;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .draft-pool-member:hover {
            background: rgba(212, 165, 255, 0.15);
            border-color: var(--pastel-lavender);
            transform: translateY(-2px);
        }

        .draft-pick-icon {
            color: var(--pastel-mint);
            font-size: 18px;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        .draft-pool-member:hover .draft-pick-icon {
            opacity: 1;
        }

        /* Team Constraints Styles */
        .card-header.collapsible {
            cursor: pointer;
            user-select: none;
        }

        .card-header.collapsible:hover {
            background: rgba(255, 255, 255, 0.03);
        }

        .collapse-icon {
            margin-left: auto;
            transition: transform 0.2s ease;
        }

        .constraints-body {
            padding-top: 16px;
        }

        .constraint-form {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 16px;
        }

        .constraint-selectors {
            display: flex;
            gap: 8px;
            align-items: center;
            flex-wrap: wrap;
        }

        .constraint-select {
            flex: 1;
            min-width: 120px;
        }

        .constraint-type-select {
            width: auto;
            min-width: 140px;
        }

        .constraints-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .empty-constraints {
            text-align: center;
            padding: 16px;
            color: var(--text-muted);
            font-size: 0.9rem;
        }

        .constraint-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: rgba(255, 255, 255, 0.03);
            border-radius: var(--radius-sm);
            border-left: 3px solid transparent;
        }

        .constraint-item.constraint-exclude {
            border-left-color: var(--pastel-coral);
        }

        .constraint-item.constraint-pair {
            border-left-color: var(--pastel-mint);
        }

        .constraint-player {
            font-weight: 500;
            font-size: 0.9rem;
        }

        .constraint-label {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            border-radius: var(--radius-sm);
            font-size: 0.75rem;
            font-weight: 600;
        }

        .constraint-label .material-icons-round {
            font-size: 14px;
        }

        .constraint-label.exclude {
            background: rgba(255, 202, 176, 0.2);
            color: var(--pastel-coral);
        }

        .constraint-label.pair {
            background: rgba(186, 255, 201, 0.2);
            color: var(--pastel-mint);
        }

        .constraint-remove {
            margin-left: auto;
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .constraint-remove:hover {
            background: rgba(255, 179, 186, 0.2);
            color: var(--pastel-pink);
        }

        .constraint-remove .material-icons-round {
            font-size: 18px;
        }

        /* Observer Section */
        .observer-section {
            margin-top: 20px;
            padding: 16px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px dashed rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
        }
        
        .observer-title {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .observer-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        
        .observer-tag {
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 100px;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        /* Send Result Checkbox Container */
        .send-result-checkbox {
            display: flex;
            align-items: center;
            gap: 16px;
            margin-top: 16px;
            padding-top: 16px;
            border-top: 1px solid rgba(255, 255, 255, 0.05);
        }

        .mute-checkbox {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 0.85rem;
            color: var(--text-secondary);
        }

        .mute-checkbox input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: var(--pastel-lavender);
            cursor: pointer;
        }

        .mute-checkbox:hover {
            color: var(--text-primary);
        }

        /* Apex Legend Picker */
        .apex-options {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            margin-bottom: 24px;
        }
        
        .apex-option {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background: var(--bg-elevated);
            border: 2px solid transparent;
            border-radius: var(--radius-md);
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .apex-option:hover {
            border-color: rgba(255, 255, 255, 0.1);
        }
        
        .apex-option.active {
            border-color: var(--pastel-pink);
            background: rgba(255, 179, 186, 0.08);
        }
        
        .apex-option input {
            display: none;
        }
        
        .apex-checkbox {
            width: 20px;
            height: 20px;
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        
        .apex-checkbox .material-icons-round {
            display: none;
            font-size: 16px;
        }
        
        .apex-option.active .apex-checkbox {
            background: var(--pastel-pink);
            border-color: var(--pastel-pink);
        }
        
        .apex-option.active .apex-checkbox .material-icons-round {
            display: block;
            color: var(--bg-dark);
        }
        
        .apex-results {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 16px;
            justify-items: center;
        }
        
        .apex-result-card {
            background: var(--bg-elevated);
            border-radius: var(--radius-lg);
            overflow: hidden;
            animation: slideUp 0.4s ease forwards;
            opacity: 0;
            width: 100%;
            max-width: 280px;
        }
        
        .apex-player-header {
            padding: 12px 16px;
            background: rgba(255, 255, 255, 0.03);
            display: flex;
            align-items: center;
            gap: 10px;
        }
        
        .apex-player-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--pastel-lavender);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.8rem;
            color: var(--bg-dark);
            overflow: hidden;
        }
        
        .apex-player-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .apex-player-name {
            font-weight: 600;
            font-size: 0.9rem;
        }
        
        .apex-legend-info {
            padding: 16px;
            text-align: center;
        }
        
        .apex-legend-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 12px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 28px;
        }
        
        .apex-legend-icon.assault { background: rgba(255, 107, 107, 0.2); color: #ff6b6b; }
        .apex-legend-icon.skirmisher { background: rgba(186, 225, 255, 0.2); color: var(--pastel-blue); }
        .apex-legend-icon.recon { background: rgba(255, 255, 186, 0.2); color: var(--pastel-yellow); }
        .apex-legend-icon.controller { background: rgba(186, 255, 201, 0.2); color: var(--pastel-mint); }
        .apex-legend-icon.support { background: rgba(212, 165, 255, 0.2); color: var(--pastel-lavender); }
        
        .apex-legend-name {
            font-weight: 700;
            font-size: 1.1rem;
            margin-bottom: 4px;
        }
        
        .apex-legend-class {
            font-size: 0.8rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        
        .apex-category-pool-section {
            margin-bottom: 24px;
            padding: 20px;
            background: var(--bg-elevated);
            border: 1px solid rgba(212, 165, 255, 0.2);
            border-radius: var(--radius-lg);
            text-align: center;
        }
        
        .pool-label {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--pastel-lavender);
            margin-bottom: 12px;
        }
        
        .pool-label .material-icons-round {
            font-size: 20px;
        }
        
        .pool-categories {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }
        
        .pool-category-tag {
            padding: 8px 16px;
            border-radius: 100px;
            font-size: 0.85rem;
            font-weight: 600;
        }
        
        .pool-category-tag.assault {
            background: rgba(255, 107, 107, 0.2);
            color: #ff6b6b;
        }
        
        .pool-category-tag.skirmisher {
            background: rgba(186, 225, 255, 0.2);
            color: var(--pastel-blue);
        }
        
        .pool-category-tag.recon {
            background: rgba(255, 255, 186, 0.2);
            color: var(--pastel-yellow);
        }
        
        .pool-category-tag.controller {
            background: rgba(186, 255, 201, 0.2);
            color: var(--pastel-mint);
        }
        
        .pool-category-tag.support {
            background: rgba(212, 165, 255, 0.2);
            color: var(--pastel-lavender);
        }

        /* Apex Legend Exclusion */
        .apex-exclusion-body {
            padding-top: 16px;
        }

        .exclusion-hint {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 16px;
        }

        .exclusion-count {
            font-size: 0.8rem;
            color: var(--pastel-coral);
            margin-left: 8px;
        }

        .apex-exclusion-grid {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }

        .exclusion-category {
            background: rgba(255, 255, 255, 0.02);
            border-radius: var(--radius-md);
            overflow: hidden;
        }

        .exclusion-category-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            font-weight: 600;
            font-size: 0.9rem;
        }

        .exclusion-category-header.assault { background: rgba(255, 107, 107, 0.1); color: #ff6b6b; }
        .exclusion-category-header.skirmisher { background: rgba(186, 225, 255, 0.1); color: var(--pastel-blue); }
        .exclusion-category-header.recon { background: rgba(255, 255, 186, 0.1); color: var(--pastel-yellow); }
        .exclusion-category-header.controller { background: rgba(186, 255, 201, 0.1); color: var(--pastel-mint); }
        .exclusion-category-header.support { background: rgba(212, 165, 255, 0.1); color: var(--pastel-lavender); }

        .exclusion-legends {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            padding: 12px;
        }

        .exclusion-legend {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid transparent;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.85rem;
        }

        .exclusion-legend:hover {
            background: rgba(255, 255, 255, 0.1);
            border-color: var(--pastel-lavender);
        }

        .exclusion-legend.excluded {
            background: rgba(255, 179, 186, 0.15);
            border-color: var(--pastel-pink);
            opacity: 0.7;
        }

        .exclusion-legend.excluded .legend-name {
            text-decoration: line-through;
        }

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

        .exclusion-legend:not(.excluded) .exclusion-icon {
            color: var(--pastel-mint);
        }

        .exclusion-legend.excluded .exclusion-icon {
            color: var(--pastel-coral);
        }

        .exclusion-actions {
            margin-top: 16px;
            display: flex;
            justify-content: flex-end;
        }

        /* Apex Actions */
        .apex-actions {
            display: flex;
            gap: 12px;
            align-items: center;
            flex-wrap: wrap;
        }

        .prefs-badge {
            background: var(--pastel-lavender);
            color: var(--bg-dark);
            padding: 2px 6px;
            border-radius: 10px;
            font-size: 0.7rem;
            font-weight: 600;
            margin-left: 4px;
        }

        /* Apex Preferences Modal */
        .modal-large {
            max-width: 700px;
            max-height: 80vh;
        }

        .modal-body {
            max-height: 60vh;
            overflow-y: auto;
            padding: 0 20px;
        }

        .prefs-section {
            margin-bottom: 24px;
        }

        .prefs-section-title {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 1rem;
            font-weight: 600;
            margin-bottom: 8px;
        }

        .prefs-hint {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 12px;
        }

        .prefs-legend-grid {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .prefs-legend {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 12px;
            background: rgba(255, 255, 255, 0.05);
            border: 2px solid transparent;
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.85rem;
        }

        .prefs-legend:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .prefs-legend.selected {
            border-color: var(--pastel-coral);
            background: rgba(255, 202, 176, 0.15);
        }

        .prefs-legend.fav.selected {
            border-color: var(--pastel-mint);
            background: rgba(186, 255, 201, 0.15);
        }

        .prefs-check {
            font-size: 16px;
            color: var(--text-muted);
        }

        .prefs-legend.selected .prefs-check {
            color: var(--pastel-coral);
        }

        .prefs-legend.fav.selected .prefs-check {
            color: var(--pastel-mint);
        }

        /* Apex Team-Based Results */
        .apex-teams-results {
            display: flex;
            flex-direction: column;
            gap: 24px;
        }

        .apex-team-group {
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(255, 255, 255, 0.05);
            border-radius: var(--radius-lg);
            padding: 16px;
            animation: slideUp 0.4s ease forwards;
        }

        .apex-team-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 16px;
            color: var(--pastel-lavender);
        }

        .apex-team-members {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 12px;
        }

        .apex-result-card.team-card {
            background: rgba(255, 255, 255, 0.03);
        }

        /* Placeholder */
        .empty-state {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 60px 24px;
            text-align: center;
            color: var(--text-muted);
        }
        
        .empty-state .material-icons-round {
            font-size: 64px;
            margin-bottom: 16px;
            opacity: 0.3;
        }
        
        .empty-state p {
            font-size: 1rem;
        }
        
        /* Shuffle Animation */
        .shuffle-overlay {
            position: fixed;
            inset: 0;
            background: rgba(13, 13, 13, 0.95);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
        }
        
        .shuffle-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        
        .shuffle-text {
            font-family: 'Space Mono', monospace;
            font-size: 2rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--pastel-mint), var(--pastel-blue), var(--pastel-lavender));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            animation: pulse 0.6s ease-in-out infinite;
        }
        
        @keyframes pulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.05); opacity: 0.8; }
        }
        
        .shuffle-cards {
            display: flex;
            gap: 12px;
            margin-top: 32px;
            flex-wrap: wrap;
            justify-content: center;
            max-width: 400px;
        }
        
        .shuffle-card {
            padding: 10px 18px;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            font-weight: 500;
            animation: float 0.4s ease-in-out infinite alternate;
        }
        
        @keyframes float {
            from { transform: translateY(-4px); }
            to { transform: translateY(4px); }
        }
        
        /* Error Message */
        .error-banner {
            padding: 14px 20px;
            background: rgba(248, 113, 113, 0.1);
            border: 1px solid rgba(248, 113, 113, 0.3);
            border-radius: var(--radius-md);
            color: var(--error);
            margin-bottom: 20px;
            display: none;
            align-items: center;
            gap: 10px;
        }
        
        .error-banner.show {
            display: flex;
        }
        
        /* Modal */
        .modal-overlay {
            position: fixed;
            inset: 0;
            background: rgba(13, 13, 13, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            padding: 24px;
        }
        
        .modal-overlay.active {
            opacity: 1;
            visibility: visible;
        }
        
        .modal {
            background: var(--bg-card);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-xl);
            padding: 32px;
            width: 100%;
            max-width: 500px;
            max-height: 80vh;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: rgba(212, 165, 255, 0.3) transparent;
        }
        
        .modal::-webkit-scrollbar {
            width: 6px;
        }
        
        .modal::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .modal::-webkit-scrollbar-thumb {
            background: rgba(212, 165, 255, 0.3);
            border-radius: 3px;
        }
        
        .modal::-webkit-scrollbar-thumb:hover {
            background: rgba(212, 165, 255, 0.5);
        }
        
        .modal-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 24px;
        }
        
        .modal-header .material-icons-round {
            color: var(--pastel-lavender);
        }
        
        .modal-title {
            font-size: 1.25rem;
            font-weight: 700;
        }
        
        .modal-close {
            margin-left: auto;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: rgba(255, 255, 255, 0.05);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        
        .modal-close:hover {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
        }
        
        .kd-group {
            margin-bottom: 16px;
        }
        
        .kd-team-title {
            font-weight: 600;
            color: var(--pastel-lavender);
            margin-bottom: 12px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }
        
        .kd-row {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px;
            background: var(--bg-elevated);
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
        }
        
        .kd-name {
            flex: 1;
            font-weight: 500;
        }
        
        .kd-input-group {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        
        .kd-label {
            font-size: 0.75rem;
            color: var(--text-muted);
        }
        
        .kd-input {
            width: 60px;
            padding: 8px;
            background: rgba(0, 0, 0, 0.3);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
            font-family: 'Space Mono', monospace;
            font-size: 0.9rem;
            text-align: center;
        }
        
        .kd-input:focus {
            outline: none;
            border-color: var(--pastel-lavender);
        }
        
        .modal-footer {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }
        
        .modal-footer .btn {
            flex: 1;
        }

        /* Member Search Dropdown */
        .member-search-container {
            position: relative;
        }

        .member-search-results {
            position: absolute;
            top: 100%;
            left: 0;
            right: 0;
            background: #1a1a2e;
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-md);
            max-height: 200px;
            overflow-y: auto;
            z-index: 100;
            margin-top: 4px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .member-search-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            cursor: pointer;
            transition: background 0.2s;
        }

        .member-search-item:hover {
            background: rgba(255, 255, 255, 0.1);
        }

        .member-search-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: var(--glass-light);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        .member-search-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
        }

        .member-search-info {
            flex: 1;
            min-width: 0;
        }

        .member-search-name {
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .member-search-username {
            font-size: 0.8rem;
            color: var(--text-secondary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .member-search-empty {
            padding: 16px;
            text-align: center;
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        .selected-member-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            background: var(--glass-light);
            padding: 8px 12px;
            border-radius: var(--radius-md);
            border: 1px solid var(--glass-border);
        }

        .btn-clear-member {
            background: transparent;
            border: none;
            padding: 2px;
            cursor: pointer;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s;
        }

        .btn-clear-member:hover {
            color: var(--danger);
        }

        .btn-clear-member .material-icons-round {
            font-size: 18px;
        }

        /* Selected Members List (Multi-select) */
        .selected-members-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 200px;
            overflow-y: auto;
        }

        .selected-member-item {
            display: flex;
            align-items: center;
            gap: 10px;
            background: var(--glass-light);
            padding: 8px 12px;
            border-radius: var(--radius-md);
            border: 1px solid var(--glass-border);
        }

        .selected-member-item .member-info {
            flex: 1;
            min-width: 0;
        }

        .selected-member-item .member-name {
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .selected-member-item .member-type-select {
            padding: 4px 8px;
            font-size: 0.8rem;
            background: var(--glass-dark);
            border: 1px solid var(--glass-border);
            border-radius: var(--radius-sm);
            color: var(--text-primary);
        }

        .selected-member-item .btn-remove-member {
            background: transparent;
            border: none;
            padding: 4px;
            cursor: pointer;
            color: var(--text-secondary);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s;
        }

        .selected-member-item .btn-remove-member:hover {
            color: var(--danger);
        }

        .selected-member-item .btn-remove-member .material-icons-round {
            font-size: 18px;
        }

        .selected-member-item.left-participant {
            opacity: 0.6;
            background: transparent;
            border-style: dashed;
        }

        .selected-member-item .member-type-badge {
            font-size: 0.75rem;
            padding: 2px 8px;
            border-radius: var(--radius-sm);
            background: var(--glass-dark);
        }

        /* Selected Member Chip (inline style for fixed members) */
        .selected-member-chip {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: var(--accent);
            color: white;
            padding: 4px 10px;
            border-radius: var(--radius-full);
            font-size: 0.875rem;
            margin: 2px;
        }

        .selected-member-chip .chip-remove-btn {
            background: transparent;
            border: none;
            padding: 0;
            margin-left: 2px;
            cursor: pointer;
            color: rgba(255, 255, 255, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s;
        }

        .selected-member-chip .chip-remove-btn:hover {
            color: white;
        }

        .selected-member-chip .chip-remove-btn .material-icons-round {
            font-size: 16px;
        }

        /* History & Leaderboard */
        .tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 20px;
        }
        
        .tab-btn {
            padding: 10px 20px;
            border: none;
            border-radius: var(--radius-sm);
            background: transparent;
            color: var(--text-secondary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.9rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .tab-btn:hover {
            color: var(--text-primary);
        }
        
        .tab-btn.active {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }
        
        .tab-panel {
            display: none;
        }
        
        .tab-panel.active {
            display: block;
        }
        
        .history-list {
            max-height: 400px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: transparent transparent;
            transition: scrollbar-color 0.3s ease;
        }
        
        .history-list:hover {
            scrollbar-color: rgba(212, 165, 255, 0.3) transparent;
        }
        
        .history-list::-webkit-scrollbar {
            width: 6px;
        }
        
        .history-list::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .history-list::-webkit-scrollbar-thumb {
            background: transparent;
            border-radius: 3px;
            transition: background 0.3s ease;
        }
        
        .history-list:hover::-webkit-scrollbar-thumb {
            background: rgba(212, 165, 255, 0.3);
        }
        
        .history-list::-webkit-scrollbar-thumb:hover {
            background: rgba(212, 165, 255, 0.5);
        }
        
        .history-date-section {
            margin-bottom: 16px;
        }
        
        .history-date-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 0;
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
            margin-bottom: 10px;
        }
        
        .history-date-header .material-icons-round {
            font-size: 16px;
        }
        
        .history-item {
            position: relative;
            padding: 14px;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            margin-bottom: 10px;
        }
        
        .history-item:hover .history-delete-btn {
            opacity: 1;
        }
        
        .history-delete-btn {
            position: absolute;
            top: 10px;
            right: 10px;
            width: 28px;
            height: 28px;
            border: none;
            border-radius: 50%;
            background: rgba(248, 113, 113, 0.1);
            color: var(--error);
            cursor: pointer;
            opacity: 0;
            transition: all 0.2s ease;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .history-delete-btn:hover {
            background: rgba(248, 113, 113, 0.2);
        }
        
        .history-delete-btn .material-icons-round {
            font-size: 18px;
        }
        
        .history-type-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            border-radius: 100px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        
        .history-type-badge.match {
            background: rgba(186, 255, 201, 0.15);
            color: var(--pastel-mint);
        }
        
        .history-type-badge.apex {
            background: rgba(255, 179, 186, 0.15);
            color: var(--pastel-pink);
        }
        
        .history-type-badge .material-icons-round {
            font-size: 14px;
        }
        
        .history-apex-picks {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 10px;
        }
        
        .history-apex-pick {
            padding: 4px 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 100px;
            font-size: 0.8rem;
            color: var(--text-secondary);
        }
        
        .history-apex-pick.assault {
            background: rgba(255, 107, 107, 0.15);
            color: #ff6b6b;
        }
        
        .history-apex-pick.skirmisher {
            background: rgba(186, 225, 255, 0.15);
            color: var(--pastel-blue);
        }
        
        .history-apex-pick.recon {
            background: rgba(255, 255, 186, 0.15);
            color: var(--pastel-yellow);
        }
        
        .history-apex-pick.controller {
            background: rgba(186, 255, 201, 0.15);
            color: var(--pastel-mint);
        }
        
        .history-apex-pick.support {
            background: rgba(212, 165, 255, 0.15);
            color: var(--pastel-lavender);
        }
        
        .history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }
        
        .history-mode {
            font-weight: 600;
            color: var(--pastel-lavender);
        }
        
        .history-date {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        
        .history-teams {
            display: flex;
            gap: 12px;
            font-size: 0.85rem;
        }
        
        .history-team {
            flex: 1;
            padding: 8px 10px;
            background: rgba(0, 0, 0, 0.2);
            border-radius: var(--radius-sm);
        }
        
        .history-team-name {
            font-weight: 600;
            margin-bottom: 4px;
            font-size: 0.75rem;
        }
        
        .history-team.alpha .history-team-name { color: var(--pastel-blue); }
        .history-team.beta .history-team-name { color: var(--pastel-coral); }

        .history-team.winner {
            background: rgba(255, 215, 0, 0.15);
            border: 1px solid rgba(255, 215, 0, 0.3);
        }

        .history-team.loser {
            opacity: 0.7;
        }

        .history-team-name {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .winner-icon {
            color: #ffd700;
            font-size: 14px !important;
        }

        .winner-badge {
            background: linear-gradient(135deg, #ffd700, #ffb700);
            color: #1a1a2e;
            font-size: 0.6rem;
            font-weight: 700;
            padding: 1px 5px;
            border-radius: 4px;
            margin-left: auto;
        }

        .player-with-kd small {
            color: var(--text-muted);
            font-size: 0.7rem;
        }

        .leaderboard-list {
            max-height: 350px;
            overflow-y: auto;
            scrollbar-width: thin;
            scrollbar-color: transparent transparent;
            transition: scrollbar-color 0.3s ease;
        }
        
        .leaderboard-list:hover {
            scrollbar-color: rgba(212, 165, 255, 0.3) transparent;
        }
        
        .leaderboard-list::-webkit-scrollbar {
            width: 6px;
        }
        
        .leaderboard-list::-webkit-scrollbar-track {
            background: transparent;
        }
        
        .leaderboard-list::-webkit-scrollbar-thumb {
            background: transparent;
            border-radius: 3px;
            transition: background 0.3s ease;
        }
        
        .leaderboard-list:hover::-webkit-scrollbar-thumb {
            background: rgba(212, 165, 255, 0.3);
        }
        
        .leaderboard-list::-webkit-scrollbar-thumb:hover {
            background: rgba(212, 165, 255, 0.5);
        }
        
        .leaderboard-item {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 12px;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            margin-bottom: 8px;
        }
        
        .leaderboard-rank {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Space Mono', monospace;
            font-weight: 700;
            font-size: 0.9rem;
            background: var(--bg-card);
        }
        
        .leaderboard-rank.gold {
            background: linear-gradient(135deg, #ffd700, #ffec8b);
            color: var(--bg-dark);
        }
        
        .leaderboard-rank.silver {
            background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
            color: var(--bg-dark);
        }
        
        .leaderboard-rank.bronze {
            background: linear-gradient(135deg, #cd7f32, #daa06d);
            color: var(--bg-dark);
        }
        
        .leaderboard-info {
            flex: 1;
        }
        
        .leaderboard-name {
            font-weight: 600;
        }
        
        .leaderboard-stats {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        
        .leaderboard-kd {
            font-family: 'Space Mono', monospace;
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--pastel-yellow);
        }
        
        /* Loading */
        .loading {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            padding: 40px;
            color: var(--text-muted);
        }
        
        .spinner {
            width: 24px;
            height: 24px;
            border: 3px solid rgba(212, 165, 255, 0.2);
            border-top-color: var(--pastel-lavender);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        .spinning {
            animation: spin 1s linear infinite;
        }

        /* Checkbox */
        .checkbox-wrapper {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-top: 16px;
            padding: 12px;
            background: var(--bg-elevated);
            border-radius: var(--radius-sm);
            cursor: pointer;
        }
        
        .checkbox-wrapper input {
            display: none;
        }
        
        .custom-checkbox {
            width: 20px;
            height: 20px;
            border: 2px solid rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }
        
        .custom-checkbox .material-icons-round {
            display: none;
            font-size: 16px;
        }
        
        .checkbox-wrapper input:checked + .custom-checkbox {
            background: var(--pastel-lavender);
            border-color: var(--pastel-lavender);
        }
        
        .checkbox-wrapper input:checked + .custom-checkbox .material-icons-round {
            display: block;
            color: var(--bg-dark);
        }
        
        .checkbox-label {
            font-size: 0.9rem;
        }

        /* Mini Games */
        .game-container {
            position: relative;
            width: 100%;
            height: 400px;
            background: var(--bg-elevated);
            border-radius: var(--radius-lg);
            overflow: hidden;
            user-select: none;
        }
        
        .game-hud {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            padding: 16px 20px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
            z-index: 10;
        }
        
        .game-timer {
            font-family: 'Space Mono', monospace;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--pastel-mint);
        }
        
        .game-score {
            font-family: 'Space Mono', monospace;
            font-size: 1.2rem;
            color: var(--pastel-yellow);
        }
        
        .game-start-overlay {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: rgba(13, 13, 13, 0.95);
            z-index: 20;
            gap: 20px;
        }
        
        .game-start-overlay.hidden {
            display: none;
        }
        
        .game-title {
            font-size: 1.5rem;
            font-weight: 700;
            text-align: center;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        
        .game-title .material-icons-round {
            font-size: 32px;
        }
        
        .game-title.eye .material-icons-round { color: var(--pastel-pink); }
        .game-title.attention .material-icons-round { color: var(--pastel-blue); }
        .game-title.focus .material-icons-round { color: var(--pastel-mint); }
        
        .game-description {
            color: var(--text-secondary);
            text-align: center;
            max-width: 320px;
            line-height: 1.6;
        }
        
        .game-results {
            text-align: center;
        }
        
        .game-results-title {
            font-size: 1.25rem;
            font-weight: 700;
            margin-bottom: 16px;
            color: var(--pastel-lavender);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        
        .game-stats-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-bottom: 20px;
        }
        
        .game-stat {
            padding: 12px;
            background: var(--bg-elevated);
            border-radius: var(--radius-sm);
        }
        
        .game-stat-value {
            font-family: 'Space Mono', monospace;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--pastel-mint);
        }
        
        .game-stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
        }
        
        /* Eye Training Game */
        #eyeGameArea {
            position: absolute;
            inset: 0;
        }
        
        .eye-target {
            position: absolute;
            width: 60px;
            height: 60px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transform: scale(0);
            animation: targetAppear 0.2s ease forwards;
            transition: transform 0.1s ease;
        }
        
        .eye-target:hover {
            transform: scale(1.1);
        }
        
        .eye-target:active {
            transform: scale(0.9);
        }
        
        .eye-target.hit {
            animation: targetHit 0.3s ease forwards;
        }
        
        .eye-target.missed {
            animation: targetMiss 0.3s ease forwards;
        }
        
        @keyframes targetAppear {
            from { transform: scale(0); opacity: 0; }
            to { transform: scale(1); opacity: 1; }
        }
        
        @keyframes targetHit {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); opacity: 0.5; }
            100% { transform: scale(0); opacity: 0; }
        }
        
        @keyframes targetMiss {
            0% { transform: scale(1); }
            50% { transform: scale(0.8); filter: grayscale(1); }
            100% { transform: scale(0); opacity: 0; }
        }
        
        .target-ring {
            position: absolute;
            inset: 0;
            border: 3px solid rgba(255,255,255,0.3);
            border-radius: 50%;
            animation: ringPulse 1s ease-in-out infinite;
        }
        
        @keyframes ringPulse {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.2); opacity: 0.5; }
        }
        
        .target-inner {
            width: 20px;
            height: 20px;
            background: white;
            border-radius: 50%;
        }
        
        /* Attention Training Game */
        .attention-game-area {
            position: absolute;
            inset: 60px 20px 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .attention-stimulus {
            width: 120px;
            height: 120px;
            border-radius: var(--radius-lg);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 48px;
            transform: scale(0);
            transition: transform 0.15s ease;
        }
        
        .attention-stimulus.show {
            transform: scale(1);
        }
        
        .attention-stimulus.correct {
            animation: stimulusCorrect 0.3s ease;
        }
        
        .attention-stimulus.wrong {
            animation: stimulusWrong 0.3s ease;
        }
        
        @keyframes stimulusCorrect {
            0% { transform: scale(1); }
            50% { transform: scale(1.2); box-shadow: 0 0 40px var(--pastel-mint); }
            100% { transform: scale(1); }
        }
        
        @keyframes stimulusWrong {
            0%, 100% { transform: translateX(0) scale(1); }
            25% { transform: translateX(-10px) scale(1); }
            75% { transform: translateX(10px) scale(1); }
        }
        
        .attention-instruction {
            position: absolute;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            padding: 12px 24px;
            background: rgba(0,0,0,0.6);
            border-radius: var(--radius-md);
            font-size: 0.9rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        
        .attention-instruction .target-color {
            font-weight: 700;
        }
        
        .attention-instruction .target-color.pink { color: var(--pastel-pink); }
        .attention-instruction .target-color.mint { color: var(--pastel-mint); }
        .attention-instruction .target-color.blue { color: var(--pastel-blue); }
        .attention-instruction .target-color.yellow { color: var(--pastel-yellow); }
        
        .attention-feedback {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 1.5rem;
            font-weight: 700;
            pointer-events: none;
            opacity: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .attention-feedback.show {
            animation: feedbackPop 0.5s ease forwards;
        }
        
        @keyframes feedbackPop {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
            50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
            100% { opacity: 0; transform: translate(-50%, -50%) scale(1) translateY(-20px); }
        }
        
        /* Focus Training Game (Based on Research) */
        .focus-game-area {
            position: absolute;
            inset: 60px 20px 20px;
        }
        
        .focus-center {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: rgba(212, 165, 255, 0.3);
            border: 3px solid var(--pastel-lavender);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5;
        }
        
        .focus-center-dot {
            width: 12px;
            height: 12px;
            background: var(--pastel-lavender);
            border-radius: 50%;
        }
        
        .focus-center.warning {
            animation: focusWarning 0.3s ease;
            border-color: var(--error);
        }
        
        @keyframes focusWarning {
            0%, 100% { transform: translate(-50%, -50%) scale(1); }
            50% { transform: translate(-50%, -50%) scale(1.2); }
        }
        
        .peripheral-target {
            position: absolute;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transform: scale(0);
            transition: transform 0.1s ease;
        }
        
        .peripheral-target.show {
            animation: peripheralAppear 0.15s ease forwards;
        }
        
        .peripheral-target.hit {
            animation: peripheralHit 0.2s ease forwards;
        }
        
        .peripheral-target.missed {
            animation: peripheralMiss 0.2s ease forwards;
        }
        
        @keyframes peripheralAppear {
            from { transform: scale(0); }
            to { transform: scale(1); }
        }
        
        @keyframes peripheralHit {
            0% { transform: scale(1); }
            50% { transform: scale(1.3); }
            100% { transform: scale(0); opacity: 0; }
        }
        
        @keyframes peripheralMiss {
            0% { transform: scale(1); opacity: 1; }
            100% { transform: scale(0.5); opacity: 0; }
        }
        
        .peripheral-target .material-icons-round {
            font-size: 24px;
            color: var(--bg-dark);
        }
        
        .focus-instruction {
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            padding: 10px 20px;
            background: rgba(0,0,0,0.7);
            border-radius: var(--radius-md);
            font-size: 0.85rem;
            color: var(--text-secondary);
            text-align: center;
            max-width: 300px;
        }
        
        .focus-zones {
            position: absolute;
            inset: 0;
            pointer-events: none;
        }
        
        .focus-zone-indicator {
            position: absolute;
            border: 1px dashed rgba(255,255,255,0.1);
            border-radius: var(--radius-sm);
        }
        
        .focus-zone-indicator.left {
            left: 0;
            top: 20%;
            width: 25%;
            height: 60%;
        }
        
        .focus-zone-indicator.right {
            right: 0;
            top: 20%;
            width: 25%;
            height: 60%;
        }
        
        .gaze-distribution-meter {
            position: absolute;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 12px;
            background: rgba(0,0,0,0.5);
            border-radius: 100px;
            font-size: 0.75rem;
            color: var(--text-muted);
        }
        
        .gaze-meter-bar {
            width: 100px;
            height: 6px;
            background: rgba(255,255,255,0.1);
            border-radius: 3px;
            overflow: hidden;
        }
        
        .gaze-meter-fill {
            height: 100%;
            background: var(--pastel-mint);
            border-radius: 3px;
            transition: width 0.3s ease;
        }
        
        /* Game Mode Selection */
        .game-mode-select {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 24px;
        }
        
        @media (max-width: 768px) {
            .game-mode-select {
                grid-template-columns: 1fr;
            }
        }
        
        .game-mode-card {
            padding: 20px 16px;
            background: var(--bg-elevated);
            border: 2px solid transparent;
            border-radius: var(--radius-lg);
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: center;
        }
        
        .game-mode-card:hover {
            border-color: rgba(255,255,255,0.1);
            transform: translateY(-2px);
        }
        
        .game-mode-card.active {
            border-color: var(--pastel-lavender);
            background: rgba(212, 165, 255, 0.1);
        }
        
        .game-mode-card .material-icons-round {
            font-size: 36px;
            margin-bottom: 10px;
        }
        
        .game-mode-card.eye .material-icons-round { color: var(--pastel-pink); }
        .game-mode-card.attention .material-icons-round { color: var(--pastel-blue); }
        .game-mode-card.focus .material-icons-round { color: var(--pastel-mint); }
        
        .game-mode-name {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 4px;
        }
        
        .game-mode-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        
        .game-mode-badge {
            display: inline-block;
            margin-top: 8px;
            padding: 2px 8px;
            background: rgba(186, 255, 201, 0.15);
            color: var(--pastel-mint);
            font-size: 0.65rem;
            font-weight: 600;
            border-radius: 100px;
            text-transform: uppercase;
        }
        
        .difficulty-select {
            display: flex;
            gap: 8px;
            justify-content: center;
            margin-bottom: 20px;
        }
        
        .difficulty-btn {
            padding: 8px 20px;
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 100px;
            background: transparent;
            color: var(--text-secondary);
            font-family: 'Outfit', sans-serif;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        
        .difficulty-btn:hover {
            border-color: rgba(255,255,255,0.2);
            color: var(--text-primary);
        }
        
        .difficulty-btn.active {
            background: var(--pastel-lavender);
            border-color: var(--pastel-lavender);
            color: var(--bg-dark);
        }

        /* ============================================
           Party Games
           ============================================ */
        
        .party-game-card {
            background: var(--bg-elevated);
            border: 2px solid transparent;
            border-radius: var(--radius-lg);
            padding: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            text-align: center;
        }
        
        .party-game-card:hover {
            background: var(--bg-card-hover);
            transform: translateY(-2px);
        }
        
        .party-game-card.active {
            border-color: var(--pastel-coral);
            background: rgba(255, 202, 176, 0.1);
        }
        
        .party-game-card .material-icons-round {
            font-size: 2.5rem;
            color: var(--pastel-coral);
            margin-bottom: 8px;
        }
        
        .party-game-name {
            font-weight: 600;
            font-size: 1rem;
            margin-bottom: 4px;
        }
        
        .party-game-desc {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        
        .party-game-select {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
            margin-bottom: 20px;
        }
        
        @media (max-width: 600px) {
            .party-game-select {
                grid-template-columns: 1fr;
            }
        }
        
        /* クラッシュアイス (物理エンジン版) */
        .crash-ice-physics-wrapper {
            position: relative;
            width: 100%;
            max-width: 500px;
            margin: 0 auto 20px;
            border-radius: var(--radius-lg);
            overflow: hidden;
            background: #1a1a2e;
        }

        #crashIceCanvas {
            display: block;
            width: 100%;
            height: auto;
        }

        .crash-ice-controls {
            display: flex;
            justify-content: center;
            gap: 12px;
            margin-bottom: 16px;
        }

        .crash-ice-info {
            display: flex;
            justify-content: center;
            gap: 24px;
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        .crash-ice-info .ice-count {
            color: var(--pastel-blue);
            font-weight: 600;
        }

        .crash-ice-info .turn-info {
            color: var(--pastel-lavender);
            font-weight: 600;
        }

        /* Roulette Overlay - Slot Machine Style */
        .roulette-overlay {
            position: absolute;
            inset: 0;
            background: rgba(13, 13, 13, 0.95);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 10;
        }

        /* Slot Machine Frame */
        .roulette-wheel {
            width: 320px;
            height: 210px;
            overflow: hidden;
            position: relative;
            background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
            border-radius: 16px;
            border: 4px solid #ffd700;
            box-shadow:
                0 0 0 8px #2d2d44,
                0 0 0 12px #1a1a2e,
                0 8px 32px rgba(0, 0, 0, 0.5),
                inset 0 0 60px rgba(0, 0, 0, 0.4);
        }

        /* Top label */
        .roulette-wheel::before {
            content: 'ROULETTE';
            position: absolute;
            top: -45px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 1.3rem;
            font-weight: 800;
            color: #ffd700;
            letter-spacing: 6px;
            text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
            z-index: 20;
        }

        /* Center selection box */
        .roulette-wheel::after {
            content: '';
            position: absolute;
            left: 10px;
            right: 10px;
            top: 50%;
            height: 72px;
            transform: translateY(-50%);
            border: 3px solid #ffd700;
            border-radius: 8px;
            background: rgba(255, 215, 0, 0.08);
            box-shadow:
                0 0 20px rgba(255, 215, 0, 0.3),
                inset 0 0 20px rgba(255, 215, 0, 0.1);
            z-index: 10;
            pointer-events: none;
        }

        /* Side arrows */
        .roulette-wheel .arrow-left,
        .roulette-wheel .arrow-right {
            position: absolute;
            top: 50%;
            transform: translateY(-50%);
            width: 0;
            height: 0;
            border: 15px solid transparent;
            z-index: 15;
        }

        .slot-spinner {
            position: absolute;
            width: 100%;
            left: 0;
            top: 0;
        }

        .slot-item {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 16px;
            height: 70px;
            padding: 0 24px;
            font-weight: 700;
            font-size: 1.1rem;
            color: rgba(255, 255, 255, 0.6);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

        .slot-item .material-icons-round {
            font-size: 1.8rem;
            color: var(--pastel-coral);
        }

        .slot-item-name {
            min-width: 130px;
            text-align: left;
        }

        .slot-item.selected {
            color: #fff;
            background: linear-gradient(90deg,
                rgba(255, 215, 0, 0.1) 0%,
                rgba(255, 215, 0, 0.2) 50%,
                rgba(255, 215, 0, 0.1) 100%);
            text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
        }

        .slot-item.selected .material-icons-round {
            color: #ffd700;
            animation: iconPulse 0.5s ease;
        }

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

        .roulette-result {
            display: none;
            align-items: center;
            gap: 16px;
            padding: 20px 36px;
            margin-top: 30px;
            background: linear-gradient(135deg, rgba(255, 215, 0, 0.15) 0%, rgba(255, 215, 0, 0.05) 100%);
            border: 3px solid #ffd700;
            border-radius: 12px;
            font-size: 1.4rem;
            font-weight: 800;
            color: #ffd700;
            box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
        }

        .roulette-result.show {
            display: flex;
            animation: resultPop 0.5s ease;
        }

        .roulette-result .material-icons-round {
            font-size: 2rem;
        }

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

        /* Gradient fade at top and bottom */
        .roulette-wheel .fade-top,
        .roulette-wheel .fade-bottom {
            position: absolute;
            left: 0;
            right: 0;
            height: 50px;
            pointer-events: none;
            z-index: 5;
        }

        .roulette-wheel .fade-top {
            top: 0;
            background: linear-gradient(to bottom, #1a1a2e 0%, transparent 100%);
        }

        .roulette-wheel .fade-bottom {
            bottom: 0;
            background: linear-gradient(to top, #1a1a2e 0%, transparent 100%);
        }

        /* Crash Ice Notification */
        .crash-ice-notification {
            position: absolute;
            top: 60px;
            left: 50%;
            transform: translateX(-50%);
            padding: 12px 24px;
            background: rgba(212, 165, 255, 0.95);
            color: var(--bg-dark);
            border-radius: var(--radius-md);
            font-weight: 600;
            z-index: 20;
            display: flex;
            align-items: center;
            gap: 8px;
            animation: notificationSlide 2.5s ease forwards;
            box-shadow: 0 4px 20px rgba(212, 165, 255, 0.4);
        }

        .crash-ice-notification .material-icons-round {
            font-size: 1.2rem;
        }

        @keyframes notificationSlide {
            0% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
            10% { opacity: 1; transform: translateX(-50%) translateY(0); }
            80% { opacity: 1; transform: translateX(-50%) translateY(0); }
            100% { opacity: 0; transform: translateX(-50%) translateY(-20px); }
        }
        
        /* マッチ棒取りゲーム */
        .matchstick-pile {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 4px;
            padding: 20px;
            min-height: 120px;
            background: var(--bg-elevated);
            border-radius: var(--radius-lg);
            margin-bottom: 16px;
        }
        
        .matchstick-item {
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: all 0.3s ease;
        }

        .matchstick-head {
            width: 10px;
            height: 10px;
            background: linear-gradient(135deg, #ff6b6b 0%, #c0392b 50%, #8b0000 100%);
            border-radius: 50% 50% 30% 30%;
            box-shadow: 0 0 6px rgba(255, 107, 107, 0.6);
        }

        .matchstick-body {
            width: 4px;
            height: 36px;
            background: linear-gradient(90deg, #d4a574 0%, #c4956a 50%, #b8875a 100%);
            border-radius: 0 0 2px 2px;
        }
        
        .matchstick-count {
            text-align: center;
            font-size: 1.2rem;
            margin-bottom: 16px;
        }
        
        .matchstick-count .count-number {
            font-weight: 700;
            font-size: 1.5rem;
            color: var(--pastel-coral);
        }
        
        .matchstick-buttons {
            display: flex;
            justify-content: center;
            gap: 12px;
        }
        
        .take-btn {
            padding: 12px 24px;
            background: linear-gradient(135deg, var(--pastel-coral) 0%, #ff9a76 100%);
            border: none;
            border-radius: var(--radius-md);
            color: var(--bg-dark);
            font-family: 'Outfit', sans-serif;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .take-btn:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 20px rgba(255, 202, 176, 0.4);
        }
        
        .take-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        /* タイミング止めゲーム */
        .timing-bar-container {
            position: relative;
            height: 60px;
            background: var(--bg-elevated);
            border-radius: var(--radius-lg);
            margin-bottom: 20px;
            overflow: hidden;
        }
        
        .timing-target-zone {
            position: absolute;
            top: 0;
            height: 100%;
            background: rgba(186, 255, 201, 0.3);
            border-left: 2px solid var(--pastel-mint);
            border-right: 2px solid var(--pastel-mint);
        }
        
        .timing-center-line {
            position: absolute;
            left: 50%;
            top: 0;
            width: 2px;
            height: 100%;
            background: var(--pastel-mint);
            transform: translateX(-50%);
        }
        
        .timing-bar {
            position: absolute;
            top: 5px;
            bottom: 5px;
            width: 6px;
            background: linear-gradient(180deg, var(--pastel-pink) 0%, #ff6b8a 100%);
            border-radius: 3px;
            transform: translateX(-50%);
            box-shadow: 0 0 10px rgba(255, 179, 186, 0.6);
        }
        
        .timing-controls {
            display: flex;
            justify-content: center;
            margin-bottom: 20px;
        }
        
        .timing-stop-btn {
            padding: 16px 48px;
            background: linear-gradient(135deg, var(--pastel-pink) 0%, #ff6b8a 100%);
            border: none;
            border-radius: var(--radius-xl);
            color: var(--bg-dark);
            font-family: 'Outfit', sans-serif;
            font-size: 1.2rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .timing-stop-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 20px rgba(255, 179, 186, 0.4);
        }
        
        .timing-scores {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 8px;
        }
        
        .timing-score-item {
            padding: 8px 16px;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            display: flex;
            gap: 12px;
            align-items: center;
        }
        
        .timing-score-item.current {
            border: 2px solid var(--pastel-lavender);
        }
        
        .timing-score-item.done {
            opacity: 0.7;
        }
        
        .timing-score-item .player-name {
            font-weight: 500;
        }
        
        .timing-score-item .score-value {
            color: var(--pastel-mint);
            font-weight: 600;
        }
        
        .timing-final-scores {
            text-align: center;
        }
        
        .timing-final-scores h3 {
            margin-bottom: 16px;
            color: var(--text-secondary);
        }
        
        .timing-final-score {
            display: flex;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            margin-bottom: 8px;
        }
        
        .timing-final-score.winner {
            background: rgba(186, 255, 201, 0.15);
            border: 2px solid var(--pastel-mint);
        }
        
        .timing-final-score .rank {
            font-weight: 700;
            color: var(--pastel-yellow);
        }
        
        /* 共通ゲームUI */
        .current-player {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 12px;
            margin-bottom: 12px;
            font-size: 1.1rem;
            font-weight: 500;
        }
        
        .player-avatar {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            background: var(--bg-elevated);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            overflow: hidden;
        }
        
        .player-avatar img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .player-list {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 8px;
            margin-top: 12px;
        }
        
        .player-tag {
            padding: 4px 12px;
            background: var(--bg-elevated);
            border-radius: 100px;
            font-size: 0.85rem;
            transition: all 0.3s ease;
        }
        
        .player-tag.active {
            background: var(--pastel-lavender);
            color: var(--bg-dark);
        }
        
        .game-rule {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-bottom: 8px;
        }
        
        .game-result {
            text-align: center;
            padding: 20px;
        }
        
        .game-result .result-title {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            font-size: 1.3rem;
            font-weight: 600;
            margin-bottom: 16px;
        }
        
        .game-result .result-title .material-icons-round {
            color: var(--pastel-yellow);
        }
        
        .game-result .loser,
        .game-result .winner,
        .game-result .winners {
            margin-bottom: 16px;
            font-size: 1.1rem;
        }
        
        .game-result .penguin-fall,
        .game-result .match-icon,
        .game-result .trophy {
            font-size: 2rem;
            display: block;
            margin-bottom: 8px;
        }
        
        .hidden {
            display: none !important;
        }
        
        .party-game-container {
            padding: 20px 0;
        }

        /* Phaser Game Wrapper */
        #phaserGameWrapper {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 16px;
        }

        #phaserGameContainer {
            width: 100%;
            max-width: 500px;
            aspect-ratio: 500 / 450;
            background: var(--bg-elevated);
            border-radius: var(--radius-lg);
            overflow: hidden;
        }

        #phaserGameContainer canvas {
            width: 100% !important;
            height: 100% !important;
        }

        #phaserGameStatus {
            width: 100%;
            max-width: 500px;
        }

        #phaserGameControls {
            display: flex;
            gap: 12px;
            justify-content: center;
        }

        /* Party Game Actions */
        .party-game-actions {
            display: flex;
            gap: 12px;
            margin-bottom: 24px;
        }

        .party-game-actions .action-btn {
            flex: 1;
        }

        /* Room Lobby */
        .room-lobby {
            background: var(--bg-elevated);
            border-radius: var(--radius-lg);
            padding: 24px;
            margin-bottom: 24px;
        }

        .room-code {
            text-align: center;
            margin-bottom: 20px;
        }

        .room-code-label {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 8px;
        }

        .room-code-value {
            font-family: 'Space Mono', monospace;
            font-size: 2.5rem;
            font-weight: 700;
            color: var(--pastel-coral);
            letter-spacing: 4px;
            background: rgba(255, 202, 176, 0.1);
            padding: 12px 24px;
            border-radius: var(--radius-md);
            display: inline-block;
        }

        .lobby-game-type {
            text-align: center;
            margin-bottom: 20px;
            padding: 12px;
            background: rgba(212, 165, 255, 0.1);
            border-radius: var(--radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .lobby-game-type .material-icons-round {
            color: var(--pastel-lavender);
        }

        .lobby-players {
            margin-bottom: 20px;
        }

        .lobby-players-title {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .lobby-player-list {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .lobby-player {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 16px;
            background: var(--bg-card);
            border-radius: 100px;
        }

        .lobby-player-avatar {
            width: 28px;
            height: 28px;
            border-radius: 50%;
            background: var(--pastel-blue);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 600;
            font-size: 0.75rem;
            color: var(--bg-dark);
            overflow: hidden;
        }

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

        .lobby-player-name {
            font-weight: 500;
            font-size: 0.9rem;
        }

        .lobby-player .host-badge {
            padding: 2px 6px;
            background: var(--pastel-yellow);
            color: var(--bg-dark);
            font-size: 0.65rem;
            font-weight: 700;
            border-radius: 100px;
            text-transform: uppercase;
        }

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

        .lobby-actions .btn {
            flex: 1;
        }

        /* Join Room Modal */
        .join-room-input {
            width: 100%;
            padding: 16px;
            background: var(--bg-elevated);
            border: 2px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            color: var(--text-primary);
            font-family: 'Space Mono', monospace;
            font-size: 1.5rem;
            text-align: center;
            text-transform: uppercase;
            letter-spacing: 4px;
            margin-bottom: 16px;
        }

        .join-room-input:focus {
            outline: none;
            border-color: var(--pastel-lavender);
        }

        .join-room-input::placeholder {
            color: var(--text-muted);
            letter-spacing: 2px;
        }

        /* Game Status Messages */
        .game-status {
            text-align: center;
            padding: 12px;
            background: rgba(212, 165, 255, 0.1);
            border-radius: var(--radius-md);
            margin-bottom: 16px;
            color: var(--pastel-lavender);
        }

        .game-error {
            text-align: center;
            padding: 12px;
            background: rgba(248, 113, 113, 0.1);
            border-radius: var(--radius-md);
            margin-bottom: 16px;
            color: var(--error);
        }

        .waiting-message {
            text-align: center;
            padding: 20px;
            color: var(--text-muted);
            font-style: italic;
        }

        /* Recruit Styles */
        .recruit-mode-selector {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 12px;
        }

        .recruit-mode-selector .mode-card {
            padding: 16px 8px;
        }

        .recruit-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .recruit-item {
            background: var(--bg-elevated);
            border-radius: var(--radius-md);
            padding: 16px;
            border: 1px solid rgba(255, 255, 255, 0.05);
        }

        .recruit-header {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }

        .game-channel-settings {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .game-channel-setting {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        .game-channel-setting .recruit-mode-label {
            min-width: 120px;
            flex-shrink: 0;
        }

        .game-channel-selects {
            display: flex;
            gap: 8px;
            flex: 1;
            min-width: 0;
        }

        .game-channel-selects .form-select {
            flex: 1;
            min-width: 0;
        }

        .badge-apex {
            background: linear-gradient(135deg, #e74c3c, #c0392b);
            color: #fff;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 2px 8px;
            border-radius: 12px;
            vertical-align: middle;
            margin-left: 6px;
        }

        .recruit-game-badge {
            background: linear-gradient(135deg, var(--pastel-purple), var(--pastel-pink));
            color: var(--bg-dark);
            font-size: 0.75rem;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 20px;
        }

        .recruit-mode-badge {
            background: linear-gradient(135deg, var(--pastel-mint), var(--pastel-blue));
            color: var(--bg-dark);
            font-size: 0.75rem;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 20px;
        }

        .recruit-rank-badge {
            background: linear-gradient(135deg, var(--pastel-lavender), var(--pastel-pink));
            color: var(--bg-dark);
            font-size: 0.75rem;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 20px;
        }

        .recruit-status-badge.scheduled {
            background: linear-gradient(135deg, var(--pastel-yellow), var(--pastel-coral));
            color: var(--bg-dark);
            font-size: 0.75rem;
            font-weight: 600;
            padding: 4px 10px;
            border-radius: 20px;
        }

        .recruit-item.scheduled {
            border-color: rgba(255, 200, 100, 0.3);
        }

        .recruit-scheduled-time {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 0.85rem;
            color: var(--pastel-yellow);
        }

        .recruit-scheduled-time .material-icons-round {
            font-size: 16px;
        }

        /* Rank checkboxes for multiple selection */
        .rank-checkboxes {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }

        .rank-checkbox {
            display: flex;
            align-items: center;
            cursor: pointer;
        }

        .rank-checkbox input[type="checkbox"] {
            display: none;
        }

        .rank-label {
            padding: 6px 12px;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 500;
            background: rgba(255, 255, 255, 0.1);
            border: 2px solid transparent;
            transition: all 0.2s ease;
        }

        .rank-checkbox input:checked + .rank-label {
            border-color: currentColor;
            background: rgba(255, 255, 255, 0.2);
        }

        .rank-label.rookie { color: #cd7f32; }
        .rank-label.bronze { color: #cd7f32; }
        .rank-label.silver { color: #c0c0c0; }
        .rank-label.gold { color: #ffd700; }
        .rank-label.platinum { color: #00d4aa; }
        .rank-label.diamond { color: #00bfff; }
        .rank-label.master { color: #9966ff; }
        .rank-label.predator { color: #ff4444; }

        .rank-checkbox input:checked + .rank-label.rookie,
        .rank-checkbox input:checked + .rank-label.bronze { background: rgba(205, 127, 50, 0.2); }
        .rank-checkbox input:checked + .rank-label.silver { background: rgba(192, 192, 192, 0.2); }
        .rank-checkbox input:checked + .rank-label.gold { background: rgba(255, 215, 0, 0.2); }
        .rank-checkbox input:checked + .rank-label.platinum { background: rgba(0, 212, 170, 0.2); }
        .rank-checkbox input:checked + .rank-label.diamond { background: rgba(0, 191, 255, 0.2); }
        .rank-checkbox input:checked + .rank-label.master { background: rgba(153, 102, 255, 0.2); }
        .rank-checkbox input:checked + .rank-label.predator { background: rgba(255, 68, 68, 0.2); }

        .recruit-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }

        .recruit-recruiter,
        .recruit-count {
            display: flex;
            align-items: center;
            gap: 6px;
            color: var(--text-secondary);
            font-size: 0.875rem;
        }

        .recruit-recruiter .material-icons-round,
        .recruit-count .material-icons-round {
            font-size: 18px;
        }

        .observer-count {
            color: var(--text-muted);
            font-size: 0.75rem;
        }

        .recruit-note {
            background: rgba(255, 255, 255, 0.03);
            border-radius: var(--radius-sm);
            padding: 8px 12px;
            margin-bottom: 12px;
            font-size: 0.875rem;
            color: var(--text-secondary);
            white-space: pre-line; /* Preserve line breaks */
        }

        .recruit-actions {
            display: flex;
            gap: 8px;
        }

        /* Participant management UI */
        .recruit-count.clickable {
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 8px;
            border-radius: 8px;
            transition: background 0.2s;
        }

        .recruit-count.clickable:hover {
            background: var(--bg-elevated);
        }

        .recruit-count .expand-icon {
            font-size: 18px;
            transition: transform 0.2s;
        }

        .recruit-participants-section {
            margin-top: 12px;
            padding: 12px;
            background: var(--bg-elevated);
            border-radius: 12px;
            border: 1px solid var(--border-color);
        }

        .recruit-participants-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }

        .recruit-participants-header .material-icons-round {
            font-size: 18px;
        }

        .recruit-participants-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .recruit-participant-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 8px 12px;
            background: var(--card-bg);
            border-radius: 8px;
        }

        .participant-type-badge {
            font-size: 0.75rem;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 500;
        }

        .participant-type-badge.participant {
            background: var(--pastel-mint);
            color: #166534;
        }

        .participant-type-badge.observer {
            background: var(--pastel-lavender);
            color: #6b21a8;
        }

        .participant-name {
            flex: 1;
            font-size: 0.875rem;
        }

        .participant-remove-btn {
            padding: 4px !important;
            opacity: 0.6;
            transition: opacity 0.2s;
        }

        .participant-remove-btn:hover {
            opacity: 1;
            color: var(--error);
        }

        .btn-xs {
            padding: 4px 8px !important;
            font-size: 0.75rem !important;
        }

        .btn-xs .material-icons-round {
            font-size: 16px !important;
        }

        /* Recruit filter bar */
        .recruit-filter-bar {
            display: flex;
            gap: 16px;
            padding: 12px 0;
            margin-bottom: 12px;
            border-bottom: 1px solid var(--border-color);
            flex-wrap: wrap;
        }

        .recruit-filter-group {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .filter-label {
            font-size: 0.875rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }

        .form-select-sm {
            padding: 6px 12px;
            font-size: 0.875rem;
            min-width: 120px;
        }

        /* Recruit button group */
        .recruit-button-group {
            display: flex;
            gap: 12px;
            align-items: center;
        }

        .recruit-button-group .action-btn {
            flex: 1;
        }

        /* Template styles */
        .template-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .template-empty {
            text-align: center;
            padding: 24px;
            color: var(--text-secondary);
        }

        .template-empty .material-icons-round {
            font-size: 32px;
            margin-bottom: 8px;
            opacity: 0.5;
        }

        .template-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--bg-elevated);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid transparent;
        }

        .template-item:hover {
            background: var(--card-hover);
            border-color: var(--pastel-lavender);
        }

        .template-item.default {
            border-color: var(--pastel-yellow);
        }

        .template-info {
            flex: 1;
            min-width: 0;
        }

        .template-name {
            display: flex;
            align-items: center;
            gap: 4px;
            font-weight: 500;
            margin-bottom: 4px;
        }

        .template-default-icon {
            font-size: 16px;
            color: var(--pastel-yellow);
        }

        .template-details {
            font-size: 0.875rem;
            color: var(--text-secondary);
        }

        .template-actions {
            display: flex;
            gap: 4px;
        }

        /* Schedule inputs for scheduled recruitments */
        .schedule-inputs {
            display: flex;
            gap: 8px;
        }

        .schedule-inputs input[type="date"],
        .schedule-inputs input[type="time"] {
            flex: 1;
            min-width: 0;
        }

        .btn-sm {
            padding: 8px 16px;
            font-size: 0.875rem;
        }

        .btn-sm .material-icons-round {
            font-size: 16px;
        }

        .btn-icon {
            padding: 8px;
            min-width: auto;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .btn-icon .material-icons-round {
            font-size: 20px;
            margin: 0;
        }

        .btn-danger {
            background: linear-gradient(135deg, var(--error), #dc2626);
            color: white;
        }

        .btn-danger:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 20px rgba(248, 113, 113, 0.3);
        }

        .form-input {
            width: 100%;
            padding: 12px 16px;
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: var(--radius-md);
            background: var(--bg-elevated);
            color: var(--text-primary);
            font-family: inherit;
            font-size: 0.9375rem;
            transition: all 0.2s;
        }

        .form-input:focus {
            outline: none;
            border-color: var(--pastel-lavender);
            box-shadow: 0 0 0 3px rgba(212, 165, 255, 0.1);
        }

        .form-input::placeholder {
            color: var(--text-muted);
        }

        @media (max-width: 768px) {
            .recruit-mode-selector {
                grid-template-columns: repeat(2, 1fr);
            }
        }

/* ============================================
   Admin Panel Styles
   ============================================ */

/* Admin Stats Grid */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.admin-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.admin-stat-icon.mint { background: rgba(186, 255, 201, 0.15); color: var(--pastel-mint); }
.admin-stat-icon.pink { background: rgba(255, 179, 186, 0.15); color: var(--pastel-pink); }
.admin-stat-icon.lavender { background: rgba(212, 165, 255, 0.15); color: var(--pastel-lavender); }
.admin-stat-icon.yellow { background: rgba(255, 255, 186, 0.15); color: var(--pastel-yellow); }
.admin-stat-icon.blue { background: rgba(186, 225, 255, 0.15); color: var(--pastel-blue); }
.admin-stat-icon.coral { background: rgba(255, 202, 176, 0.15); color: var(--pastel-coral); }

.admin-stat-content {
    flex: 1;
}

.admin-stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Admin Guild List */
.admin-guild-list {
    max-height: 300px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.admin-guild-list:hover {
    scrollbar-color: rgba(212, 165, 255, 0.3) transparent;
}

.admin-guild-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.admin-guild-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-card);
}

.admin-guild-info {
    flex: 1;
    min-width: 0;
}

.admin-guild-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-guild-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Admin User Filters */
.admin-user-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* Admin User List */
.admin-user-list {
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.admin-user-list:hover {
    scrollbar-color: rgba(212, 165, 255, 0.3) transparent;
}

.admin-user-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.admin-user-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-user-item.banned {
    opacity: 0.7;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.admin-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.admin-user-info {
    flex: 1;
    min-width: 0;
}

.admin-user-name {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-user-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-ban-badge {
    padding: 2px 8px;
    background: #f87171;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 100px;
    text-transform: uppercase;
}

.admin-user-actions {
    display: flex;
    gap: 8px;
}

/* Admin Pagination */
.admin-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Button Danger Variant */
.btn-danger {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
    border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
    background: rgba(248, 113, 113, 0.25);
}

/* ============================================
   User Menu Dropdown
   ============================================ */

.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-elevated);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-trigger:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-menu-trigger .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.user-menu-trigger .user-name {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.user-menu-arrow {
    font-size: 18px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.user-menu-dropdown.active + .user-menu-trigger .user-menu-arrow,
.user-menu:has(.user-menu-dropdown.active) .user-menu-arrow {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.user-menu-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-menu-item:first-child {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.user-menu-item:last-child {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.user-menu-item:only-child {
    border-radius: var(--radius-md);
}

.user-menu-item .material-icons-round {
    font-size: 20px;
    color: var(--text-muted);
}

/* User menu divider */
.user-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 4px 0;
}

/* Linked accounts section */
.linked-accounts-section {
    padding: 4px 0;
}

.linked-accounts-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.linked-accounts-header .material-icons-round {
    font-size: 16px;
}

.linked-accounts-list {
    max-height: 200px;
    overflow-y: auto;
}

.linked-accounts-empty {
    padding: 8px 14px;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

.linked-account-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.linked-account-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.linked-account-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.linked-account-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.linked-account-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    background: var(--pastel-mint);
    color: #000;
    border-radius: 4px;
    font-weight: 600;
}

.add-account-btn {
    color: var(--pastel-mint) !important;
}

.add-account-btn .material-icons-round {
    color: var(--pastel-mint) !important;
}

/* ============================================
   Guild Admin Modal
   ============================================ */

.guild-admin-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.guild-admin-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
}

.guild-admin-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.guild-admin-tab:hover {
    color: var(--text-primary);
}

.guild-admin-tab.active {
    color: var(--pastel-mint);
}

.guild-admin-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--pastel-mint);
    border-radius: 2px 2px 0 0;
}

.guild-admin-tab .material-icons-round {
    font-size: 18px;
}

.guild-admin-panel {
    display: none;
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.guild-admin-panel.active {
    display: block;
}

/* Guild Admin Stats */
.guild-admin-stats,
.guild-admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 16px;
}

/* Recruit Channel Settings */
.recruit-channel-settings {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recruit-channel-setting {
    display: flex;
    align-items: center;
    gap: 12px;
}

.recruit-mode-label {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 120px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.recruit-mode-label .material-icons-round {
    font-size: 18px;
    color: var(--pastel-mint);
}

.recruit-channel-setting .form-select {
    flex: 1;
}

.guild-stat-item {
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.guild-stat-item .material-icons-round {
    font-size: 24px;
    color: var(--pastel-mint);
}

.guild-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.guild-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Guild Admin Users */
.guild-admin-users,
.guild-admin-bans {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.guild-user-item,
.guild-ban-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.guild-user-item:hover,
.guild-ban-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

.guild-user-item.banned {
    opacity: 0.6;
}

.guild-user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.guild-user-info,
.guild-ban-info {
    flex: 1;
    min-width: 0;
}

.guild-user-name,
.guild-ban-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.guild-user-penalty,
.guild-user-login-date,
.guild-ban-reason {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.guild-user-status {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}

.guild-user-status.global-ban {
    background: var(--pastel-coral);
    color: var(--bg-primary);
}

.guild-user-status.server-ban {
    background: var(--pastel-yellow);
    color: var(--bg-primary);
}

.guild-ban-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.guild-user-actions,
.guild-ban-actions {
    display: flex;
    gap: 8px;
}

/* Discord Members List */
.member-count-badge {
    margin-left: auto;
    background: var(--pastel-lavender);
    color: var(--bg-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.member-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.member-search-box .material-icons-round {
    color: var(--text-muted);
    font-size: 20px;
}

.member-search-box .form-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 4px;
    font-size: 0.875rem;
}

.member-search-box .form-input:focus {
    outline: none;
}

.discord-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.discord-member-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    transition: background 0.2s;
}

.discord-member-item:hover {
    background: rgba(0, 0, 0, 0.3);
}

.discord-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.discord-member-info {
    flex: 1;
    min-width: 0;
}

.discord-member-name {
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.discord-member-username {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.discord-member-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.member-role {
    font-size: 0.65rem;
    padding: 1px 6px;
    border-radius: 8px;
    border: 1px solid;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.2);
}

.discord-member-joined {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.member-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.page-indicator {
    font-size: 0.875rem;
    color: var(--text-secondary);
    min-width: 60px;
    text-align: center;
}

/* Responsive */
@media (max-width: 480px) {
    .guild-admin-modal {
        max-width: 100%;
        margin: 16px;
    }

    .guild-admin-stats,
    .guild-admin-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .discord-members-list {
        max-height: 300px;
    }
}

/* ========================================
   Comprehensive Mobile Responsive Styles
   ======================================== */

/* Tablet (768px) */
@media (max-width: 768px) {
    /* Global - Prevent horizontal scroll (iOS Safari compatible) */
    html {
        overflow-x: hidden;
        width: 100%;
        position: relative;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        position: relative;
        -webkit-overflow-scrolling: touch;
    }

    .app-container {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Header */
    .header {
        padding: 12px 16px;
    }

    .header-content {
        gap: 12px;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 20px;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .user-badge {
        padding: 4px 10px 4px 4px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .user-name {
        font-size: 0.8rem;
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* Hide admin badge on mobile */
    .admin-badge {
        display: none;
    }

    /* Landing Page */
    .landing {
        padding: 40px 16px;
    }

    .hero {
        margin-bottom: 50px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-description {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-cta .btn {
        width: 100%;
        max-width: 280px;
    }

    /* Features Grid */
    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 20px;
    }

    /* Dashboard */
    .dashboard {
        padding: 16px;
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .dashboard-grid {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Sidebar - Prevent overflow */
    .sidebar {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .sidebar .card {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .member-list {
        width: 100%;
        max-width: 100%;
    }

    .member-item {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* Main content - Prevent overflow */
    .main-content {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    .main-content .card {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* Buttons */
    .btn {
        padding: 10px 18px;
        font-size: 0.9rem;
    }

    .btn-sm {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    /* Cards */
    .card {
        padding: 16px;
        border-radius: var(--radius-md);
    }

    /* Feature Tabs - Horizontal scroll on tablet */
    .feature-tabs {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    .feature-tab {
        flex: 0 0 auto;
        min-width: auto;
        text-align: center;
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* VC Selector */
    .vc-selector {
        flex-direction: column;
        gap: 12px;
    }

    .vc-select {
        max-width: 100%;
    }

    /* Team Results */
    .teams-grid {
        grid-template-columns: 1fr;
    }

    /* Recruit Mode Selector */
    .recruit-mode-selector {
        grid-template-columns: 1fr;
    }

    /* Modal */
    .modal-content {
        margin: 16px;
        max-width: calc(100% - 32px);
        max-height: calc(100vh - 32px);
    }

    /* History Table */
    .history-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .history-table th,
    .history-table td {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Leaderboard */
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* Mobile (480px) */
@media (max-width: 480px) {
    /* Header */
    .header {
        padding: 10px 12px;
    }

    .logo-icon {
        width: 32px;
        height: 32px;
        font-size: 18px;
        border-radius: 8px;
    }

    .logo-text {
        font-size: 1rem;
    }

    .user-name {
        display: none;
    }

    .user-badge {
        padding: 4px;
        border-radius: 50%;
    }

    /* Landing Page */
    .landing {
        padding: 24px 12px;
    }

    .hero {
        margin-bottom: 40px;
    }

    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-description {
        font-size: 0.9rem;
    }

    /* Section Headers */
    .section-header h2 {
        font-size: 1.4rem;
    }

    .section-header p {
        font-size: 0.9rem;
    }

    /* Feature Cards */
    .feature-card {
        padding: 16px;
    }

    .feature-icon {
        width: 44px;
        height: 44px;
    }

    .feature-card h3 {
        font-size: 1rem;
    }

    .feature-card p {
        font-size: 0.85rem;
    }

    /* Dashboard */
    .dashboard {
        padding: 12px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    /* Cards */
    .card {
        padding: 14px;
    }

    .card-title {
        font-size: 1rem;
    }

    /* Feature Tabs - Scrollable */
    .feature-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .feature-tab {
        flex-shrink: 0;
        min-width: auto;
        padding: 8px 14px;
        font-size: 0.8rem;
        white-space: nowrap;
    }

    /* Server Select */
    .server-card {
        padding: 12px;
    }

    .server-icon {
        width: 40px;
        height: 40px;
    }

    .server-name {
        font-size: 0.9rem;
    }

    /* VC Card */
    .vc-card {
        padding: 12px;
    }

    /* Team Cards */
    .team-card {
        padding: 14px;
    }

    .team-member {
        padding: 8px;
        font-size: 0.85rem;
    }

    /* Balance Mode */
    .balance-mode-toggle {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .balance-hint {
        font-size: 0.75rem;
    }

    /* Draft Mode */
    .action-btn-group {
        flex-direction: column;
        gap: 8px;
    }

    .draft-teams {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .draft-pool-members {
        justify-content: center;
    }

    .draft-pool-member {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    /* Constraints */
    .constraint-selectors {
        flex-direction: column;
    }

    .constraint-select,
    .constraint-type-select {
        width: 100%;
    }

    .constraint-item {
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Recruit Section */
    .recruit-mode-card {
        padding: 14px;
    }

    .recruit-mode-icon {
        width: 40px;
        height: 40px;
    }

    .recruit-mode-info h4 {
        font-size: 0.95rem;
    }

    /* Form Elements */
    input, select, textarea {
        font-size: 16px !important; /* Prevent zoom on iOS */
    }

    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* Modal */
    .modal-content {
        margin: 8px;
        max-width: calc(100% - 16px);
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 14px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    /* History */
    .history-card {
        padding: 12px;
    }

    .match-info {
        flex-direction: column;
        gap: 8px;
    }

    /* Pagination */
    .pagination {
        gap: 4px;
    }

    .pagination-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .page-indicator {
        font-size: 0.8rem;
    }

    /* Recruit Rank Selection */
    .recruit-rank-checkboxes {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Guild Admin */
    .guild-admin-stats-grid {
        grid-template-columns: 1fr;
    }

    .guild-stat-card {
        padding: 12px;
    }
}

/* Extra Small Mobile (360px) */
@media (max-width: 360px) {
    .header {
        padding: 8px 10px;
    }

    .logo-text {
        font-size: 0.9rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    .feature-tabs {
        gap: 4px;
    }

    .feature-tab {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

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

/* ============================================
   Notification Toast
   ============================================ */
.notification-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
}

.notification-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.notification-toast.success {
    border-color: var(--pastel-mint);
}

.notification-toast.success .material-icons-round {
    color: var(--pastel-mint);
}

.notification-toast.error {
    border-color: var(--pastel-pink);
}

.notification-toast.error .material-icons-round {
    color: var(--pastel-pink);
}

.notification-toast.info {
    border-color: var(--pastel-blue);
}

.notification-toast.info .material-icons-round {
    color: var(--pastel-blue);
}

.notification-toast .material-icons-round {
    font-size: 20px;
}

.notification-toast span:last-child {
    font-size: 0.9rem;
    color: var(--text-primary);
}

/* ============================================
   Admin Legend Management
   ============================================ */

.admin-legend-filters {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-legend-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.admin-legend-category {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 16px;
}

.admin-legend-category-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 12px;
}

.admin-legend-category-header .legend-count {
    font-weight: 400;
    opacity: 0.7;
    font-size: 0.85rem;
}

.admin-legend-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.admin-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.admin-legend-item:hover {
    background: var(--bg-card-hover);
}

.admin-legend-item.disabled {
    opacity: 0.6;
}

.admin-legend-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-legend-name {
    font-size: 0.95rem;
    color: var(--text-primary);
}

.admin-legend-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
}

.admin-legend-badge.disabled {
    background: rgba(255, 179, 186, 0.2);
    color: var(--pastel-pink);
}

.admin-legend-actions {
    display: flex;
    gap: 4px;
}

.admin-legend-actions .btn-sm {
    padding: 6px 8px;
}

.admin-legend-actions .btn-sm .material-icons-round {
    font-size: 18px;
}

/* ============================================
   Quick Match
   ============================================ */

.quick-match-btn {
    position: relative;
}

.quick-match-count {
    font-size: 0.75rem;
    opacity: 0.9;
    margin-left: 4px;
}

.quick-match-invite {
    text-align: center;
    padding: 20px;
}

.quick-match-header {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--pastel-yellow);
    margin-bottom: 8px;
}

.quick-match-header .material-icons-round {
    font-size: 24px;
}

.quick-match-game {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.quick-match-message {
    background: var(--bg-elevated);
    padding: 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
}

.quick-match-message textarea {
    resize: none;
    font-size: 0.85rem;
}

.quick-match-members {
    margin-top: 16px;
}

.quick-match-members-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* ============================================
   Score History
   ============================================ */

.score-history-list {
    max-height: 400px;
    overflow-y: auto;
}

.score-history-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--card-border);
}

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

.score-history-game {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.score-history-type {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.score-history-difficulty {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.score-history-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--pastel-mint);
    font-family: var(--font-mono);
}

.score-history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Ranking */
.ranking-header {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 8px 12px;
    border-bottom: 1px solid var(--card-border);
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid var(--card-border);
}

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

.ranking-item.gold .ranking-rank {
    color: #FFD700;
}

.ranking-item.silver .ranking-rank {
    color: #C0C0C0;
}

.ranking-item.bronze .ranking-rank {
    color: #CD7F32;
}

.ranking-rank {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 50px;
    font-weight: 600;
    color: var(--text-muted);
}

.ranking-rank .material-icons-round {
    font-size: 18px;
}

.ranking-player {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ranking-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.ranking-name {
    font-size: 0.9rem;
    color: var(--text-primary);
}

.ranking-score {
    font-size: 1rem;
    font-weight: 700;
    color: var(--pastel-lavender);
    font-family: var(--font-mono);
}

/* ============================================
   Mobile Optimizations - Minigames
   ============================================ */

@media (max-width: 768px) {
    /* Game container adjustments */
    .game-container {
        height: 350px;
    }

    /* Larger touch targets for eye training */
    .eye-target {
        min-width: 70px;
        min-height: 70px;
    }

    /* Larger attention stimulus for mobile */
    .attention-stimulus {
        width: 100px;
        height: 100px;
    }

    /* Game HUD adjustments */
    .game-hud {
        padding: 12px 16px;
    }

    .game-timer {
        font-size: 1.2rem;
    }

    /* Game results grid */
    .game-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* Difficulty buttons */
    .difficulty-select {
        flex-wrap: wrap;
    }

    .difficulty-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Focus game adjustments */
    .focus-center {
        width: 50px;
        height: 50px;
    }

    .peripheral-target {
        min-width: 60px;
        min-height: 60px;
    }

    /* Gaze meter */
    .gaze-distribution-meter {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* Game mode cards adjustments */
    .game-mode-card {
        padding: 16px 12px;
    }

    .game-mode-card .material-icons-round {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .game-mode-name {
        font-size: 0.9rem;
    }

    .game-mode-desc {
        font-size: 0.7rem;
    }

    /* Start overlay adjustments */
    .game-start-overlay {
        padding: 20px;
    }

    .game-title {
        font-size: 1.2rem;
    }

    .game-description {
        font-size: 0.85rem;
    }

    /* Attention instruction */
    .attention-instruction {
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .focus-instruction {
        font-size: 0.75rem;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    /* Even smaller game container */
    .game-container {
        height: 300px;
    }

    /* Game mode select - single column */
    .game-mode-select {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .game-mode-card {
        display: flex;
        align-items: center;
        gap: 12px;
        text-align: left;
        padding: 12px 16px;
    }

    .game-mode-card .material-icons-round {
        margin-bottom: 0;
        font-size: 32px;
    }

    /* Attention stimulus smaller */
    .attention-stimulus {
        width: 80px;
        height: 80px;
    }

    /* Difficulty buttons compact */
    .difficulty-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    /* Game results - 2x2 grid */
    .game-stats-grid {
        gap: 8px;
    }

    .game-stat-value {
        font-size: 1.5rem;
    }

    .game-stat-label {
        font-size: 0.7rem;
    }

    /* Touch-friendly buttons */
    .game-start-overlay .btn {
        padding: 14px 28px;
        font-size: 1rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects that don't work well on touch */
    .eye-target:hover {
        transform: scale(1);
    }

    .game-mode-card:hover {
        transform: none;
    }

    /* Make targets more visible on touch */
    .eye-target {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .peripheral-target {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    /* Larger tap areas */
    .difficulty-btn {
        min-height: 44px;
    }

    .action-btn {
        min-height: 48px;
    }
}

/* ========================================
   Mobile/Desktop Visibility Utilities
   ======================================== */

/* Desktop only (hide on mobile) */
.desktop-only {
    display: inline;
}

/* Mobile only (hide on desktop) */
.mobile-only {
    display: none;
}

/* Show mobile elements on touch devices or small screens */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: inline !important;
    }
}

/* ========================================
   Attention Game Tap Button (Mobile)
   ======================================== */

.attention-tap-btn {
    display: none;
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 20px 60px;
    background: linear-gradient(135deg, var(--pastel-pink), var(--pastel-coral));
    border: none;
    border-radius: var(--radius-lg);
    color: var(--bg-primary);
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(255, 179, 186, 0.4);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    z-index: 10;
    gap: 8px;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.attention-tap-btn .material-icons-round {
    font-size: 1.5rem;
}

.attention-tap-btn:active {
    transform: translateX(-50%) scale(0.95);
    box-shadow: 0 2px 12px rgba(255, 179, 186, 0.3);
}

/* Show tap button on mobile when game is active */
@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .attention-tap-btn.mobile-only {
        display: flex !important;
    }
}

/* ========================================
   Toggle Switch
   ======================================== */

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: relative;
    width: 44px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: transform 0.3s ease, background 0.3s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--pastel-mint);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background: var(--bg-primary);
}

.toggle-label {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ========================================
   Checkbox Group
   ======================================== */

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--pastel-mint);
    cursor: pointer;
}

.checkbox-item span {
    font-size: 0.875rem;
    color: var(--text-primary);
}

/* ========================================
   New Minigames Styles
   ======================================== */

/* Game Title Colors */
.game-title.reaction { color: #4CAF50; }
.game-title.memory { color: var(--pastel-lavender); }
.game-title.typing { color: var(--pastel-blue); }
.game-title.number { color: var(--pastel-yellow); }
.game-title.stroop { color: var(--pastel-coral); }
.game-title.rhythm { color: var(--pastel-pink); }
.game-title.math { color: var(--pastel-mint); }

/* Reaction Time Game */
.reaction-game-area {
    position: absolute;
    inset: 60px 20px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reaction-box {
    width: 100%;
    max-width: 400px;
    height: 200px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.reaction-box.waiting {
    background: #b71c1c;
    color: white;
}

.reaction-box.ready {
    background: #4CAF50;
    color: white;
    cursor: pointer;
}

.reaction-box.ready:hover {
    transform: scale(1.02);
}

.reaction-box.too-early {
    background: #ff5722;
    color: white;
    animation: shake 0.3s ease;
}

.reaction-box.success {
    background: #2196F3;
    color: white;
}

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

/* Memory Game */
.memory-game-area {
    position: absolute;
    inset: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.memory-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 300px;
}

.memory-cell {
    width: 80px;
    height: 80px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.memory-cell:hover {
    background: var(--bg-card-hover);
}

.memory-cell.active {
    background: var(--pastel-lavender);
    border-color: white;
    box-shadow: 0 0 20px rgba(212, 165, 255, 0.5);
}

.memory-cell.correct {
    background: var(--pastel-mint);
    animation: memoryCorrect 0.3s ease;
}

.memory-cell.wrong {
    background: var(--pastel-coral);
    animation: memoryWrong 0.3s ease;
}

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

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

.memory-status {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Typing Game */
.typing-game-area {
    position: absolute;
    inset: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.typing-display {
    font-size: 2rem;
    font-family: 'Space Mono', monospace;
    padding: 20px 40px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    letter-spacing: 0.1em;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typing-display .char {
    transition: color 0.1s ease;
}

.typing-display .char.correct {
    color: var(--pastel-mint);
}

.typing-display .char.wrong {
    color: var(--pastel-coral);
    text-decoration: underline;
}

.typing-display .char.current {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.typing-input {
    width: 100%;
    max-width: 400px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-family: 'Space Mono', monospace;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.typing-input:focus {
    border-color: var(--pastel-blue);
}

.typing-stats {
    display: flex;
    gap: 24px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Number Memory Game */
.number-game-area {
    position: absolute;
    inset: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.number-display {
    font-size: 3rem;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    padding: 30px 50px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    letter-spacing: 0.2em;
    color: var(--pastel-yellow);
    min-width: 200px;
    text-align: center;
}

.number-input {
    width: 100%;
    max-width: 300px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-family: 'Space Mono', monospace;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.number-input:focus {
    border-color: var(--pastel-yellow);
}

.number-status {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    min-height: 24px;
}

.number-status.correct {
    color: var(--pastel-mint);
}

.number-status.wrong {
    color: var(--pastel-coral);
}

/* Stroop Test Game */
.stroop-game-area {
    position: absolute;
    inset: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 30px;
}

.stroop-instruction {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
}

.stroop-instruction strong {
    color: var(--pastel-coral);
}

.stroop-word {
    font-size: 4rem;
    font-weight: 700;
    padding: 20px 40px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stroop-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    max-width: 400px;
}

.stroop-btn {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.stroop-btn:hover {
    transform: scale(1.05);
}

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

.stroop-btn.pink { background: var(--pastel-pink); }
.stroop-btn.mint { background: var(--pastel-mint); }
.stroop-btn.blue { background: var(--pastel-blue); }
.stroop-btn.yellow { background: var(--pastel-yellow); color: #333; }
.stroop-btn.lavender { background: var(--pastel-lavender); }
.stroop-btn.coral { background: var(--pastel-coral); }

/* Rhythm Game */
.rhythm-game-area {
    position: absolute;
    inset: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 20px;
    padding-bottom: 20px;
}

.rhythm-track {
    position: relative;
    width: 100%;
    max-width: 320px;
    height: 300px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.rhythm-track::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom,
        transparent 0%,
        transparent 70%,
        rgba(212, 165, 255, 0.1) 85%,
        rgba(212, 165, 255, 0.2) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.rhythm-lane {
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.rhythm-lane:last-child {
    border-right: none;
}

.rhythm-hit-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    border-top: 3px solid var(--pastel-lavender);
    background: rgba(212, 165, 255, 0.15);
    z-index: 2;
}

.rhythm-note {
    position: absolute;
    width: 60px;
    height: 20px;
    background: var(--pastel-pink);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 179, 186, 0.5);
    z-index: 3;
}

.rhythm-note.hit {
    animation: noteHit 0.2s ease forwards;
}

@keyframes noteHit {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.rhythm-keys {
    display: flex;
    gap: 10px;
}

.rhythm-key {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: var(--text-secondary);
    transition: all 0.1s ease;
}

.rhythm-key.active {
    background: var(--pastel-lavender);
    color: var(--bg-primary);
    border-color: var(--pastel-lavender);
    transform: scale(0.95);
}

.rhythm-feedback {
    font-size: 1.2rem;
    font-weight: 700;
    min-height: 30px;
    text-align: center;
}

.rhythm-feedback.perfect {
    color: var(--pastel-mint);
    animation: feedbackPop 0.3s ease;
}

.rhythm-feedback.good {
    color: var(--pastel-yellow);
    animation: feedbackPop 0.3s ease;
}

.rhythm-feedback.miss {
    color: var(--pastel-coral);
    animation: feedbackPop 0.3s ease;
}

@keyframes feedbackPop {
    0% { transform: scale(1.3); opacity: 0; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Math Challenge Game */
.math-game-area {
    position: absolute;
    inset: 60px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.math-problem {
    font-size: 3rem;
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    padding: 30px 50px;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
    color: var(--pastel-mint);
    min-width: 280px;
    text-align: center;
}

.math-input {
    width: 100%;
    max-width: 200px;
    padding: 16px 24px;
    background: var(--bg-card);
    border: 2px solid var(--card-border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-family: 'Space Mono', monospace;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease;
}

.math-input:focus {
    border-color: var(--pastel-mint);
}

.math-feedback {
    font-size: 1rem;
    min-height: 24px;
    text-align: center;
}

.math-feedback.correct {
    color: var(--pastel-mint);
}

.math-feedback.wrong {
    color: var(--pastel-coral);
}

.math-streak {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Game Mode Card Colors */
.game-mode-card.reaction .card-icon {
    background: linear-gradient(135deg, #4CAF50, #45a049);
}

.game-mode-card.memory .card-icon {
    background: linear-gradient(135deg, var(--pastel-lavender), #c084fc);
}

.game-mode-card.typing .card-icon {
    background: linear-gradient(135deg, var(--pastel-blue), #60a5fa);
}

.game-mode-card.number .card-icon {
    background: linear-gradient(135deg, var(--pastel-yellow), #fbbf24);
}

.game-mode-card.stroop .card-icon {
    background: linear-gradient(135deg, var(--pastel-coral), #fb923c);
}

.game-mode-card.rhythm .card-icon {
    background: linear-gradient(135deg, var(--pastel-pink), #f472b6);
}

.game-mode-card.math .card-icon {
    background: linear-gradient(135deg, var(--pastel-mint), #4ade80);
}

/* Mobile responsive for new games */
@media (max-width: 768px) {
    .reaction-box {
        max-width: 100%;
        height: 150px;
        font-size: 1.2rem;
    }

    .memory-cell {
        width: 60px;
        height: 60px;
    }

    .typing-display {
        font-size: 1.5rem;
        padding: 15px 20px;
    }

    .typing-input {
        font-size: 1rem;
    }

    .number-display {
        font-size: 2rem;
        padding: 20px 30px;
    }

    .stroop-word {
        font-size: 2.5rem;
    }

    .stroop-btn {
        width: 60px;
        height: 60px;
        font-size: 0.7rem;
    }

    .rhythm-track {
        max-width: 260px;
        height: 250px;
    }

    .rhythm-key {
        width: 50px;
        height: 50px;
        font-size: 1rem;
    }

    .rhythm-note {
        width: 50px;
    }

    .math-problem {
        font-size: 2rem;
        padding: 20px 30px;
        min-width: auto;
    }
}

/* ============================================
   Server Analytics Dashboard
   ============================================ */

.analytics-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
    padding: 24px;
}

.analytics-page.hidden {
    display: none;
}

.analytics-container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--bg-main);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.analytics-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Analytics back button - make it more visible */
.analytics-header .btn-ghost {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
}

.analytics-header .btn-ghost:hover {
    background: var(--bg-hover);
    border-color: rgba(255, 255, 255, 0.25);
}

.analytics-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.analytics-title .material-icons-round {
    color: var(--pastel-lavender);
}

.analytics-period-select {
    width: auto;
    min-width: 120px;
}

/* Overview Stats Grid */
.analytics-overview-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.analytics-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.analytics-stat-icon.mint { background: rgba(186, 255, 201, 0.15); color: var(--pastel-mint); }
.analytics-stat-icon.lavender { background: rgba(212, 165, 255, 0.15); color: var(--pastel-lavender); }
.analytics-stat-icon.coral { background: rgba(255, 202, 176, 0.15); color: var(--pastel-coral); }
.analytics-stat-icon.blue { background: rgba(186, 225, 255, 0.15); color: var(--pastel-blue); }

.analytics-stat-content {
    flex: 1;
}

.analytics-stat-value {
    font-family: 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.analytics-stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Chart Card */
.analytics-chart-card {
    margin-bottom: 24px;
}

.analytics-chart-container {
    height: 300px;
    position: relative;
}

/* Member Flow Grid */
.analytics-flow-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-flow-list {
    max-height: 300px;
    overflow-y: auto;
}

.analytics-flow-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.analytics-flow-name {
    font-weight: 500;
    color: var(--text-primary);
}

.analytics-flow-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Active Users Table */
.analytics-table-container {
    overflow-x: auto;
}

.analytics-table {
    width: 100%;
    border-collapse: collapse;
}

.analytics-table th,
.analytics-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.analytics-table th {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.analytics-table td {
    color: var(--text-primary);
}

.analytics-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.empty-state-cell {
    text-align: center;
    color: var(--text-muted);
    padding: 32px !important;
}

/* Relationships Section */
.analytics-relationships {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
}

.analytics-relationship-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.relationship-from,
.relationship-to {
    font-weight: 500;
    color: var(--text-primary);
}

.relationship-arrow {
    color: var(--text-muted);
}

.relationship-arrow .material-icons-round {
    font-size: 16px;
}

.relationship-count {
    font-family: 'Space Mono', monospace;
    font-size: 0.85rem;
    color: var(--pastel-lavender);
    margin-left: 8px;
}

/* Responsive */
@media (max-width: 1024px) {
    .analytics-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .analytics-page {
        padding: 16px;
    }

    .analytics-header {
        flex-wrap: wrap;
    }

    .analytics-title {
        order: 1;
        width: 100%;
        margin-bottom: 12px;
    }

    .analytics-header .btn {
        order: 2;
    }

    .analytics-period-select {
        order: 3;
        margin-left: auto;
    }

    .analytics-overview-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .analytics-flow-grid {
        grid-template-columns: 1fr;
    }

    .analytics-stat-card {
        padding: 16px;
    }

    .analytics-stat-value {
        font-size: 1.25rem;
    }

    .analytics-chart-container {
        height: 250px;
    }
}

@media (max-width: 480px) {
    .analytics-overview-grid {
        grid-template-columns: 1fr;
    }

    .analytics-relationships {
        flex-direction: column;
    }

    .analytics-relationship-item {
        width: 100%;
    }
}

/* ============================================
   Server Tags
   ============================================ */

.server-tags-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.server-tag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

.server-tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.server-tag-actions {
    display: flex;
    gap: 4px;
}

.guild-tags-assignment {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-checkbox-item {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.tag-checkbox-item:hover {
    opacity: 0.8;
}

.tag-checkbox-item input[type="checkbox"] {
    display: none;
}

.tag-checkbox-item input[type="checkbox"]:checked + .server-tag-badge {
    box-shadow: 0 0 0 2px #00ffff, 0 0 8px rgba(0, 255, 255, 0.4);
    transform: scale(1.05);
}

.recruit-tags-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
}

/* Age restriction inputs */
.age-restriction-inputs {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.age-restriction-inputs select {
    width: auto;
    min-width: 100px;
}

.age-restriction-inputs span {
    color: var(--text-muted);
}

/* DM Campaign Styles */
.dm-date-option {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.dm-date-option .dm-date-label {
    flex: 1;
    min-width: 150px;
    max-width: 200px;
}

.dm-date-option .schedule-inputs {
    display: flex;
    gap: 8px;
    flex: 2;
}

.dm-date-option .schedule-inputs input {
    flex: 1;
}

.dm-date-option .btn-icon {
    padding: 8px;
    min-width: auto;
}

.dm-selection-type {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-primary);
}

.dm-member-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-top: 4px;
    background: #1a1a2e;
    position: absolute;
    left: 0;
    right: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dm-selected-members {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    min-height: 60px;
    margin-top: 8px;
}

.dm-selected-members .empty-hint {
    color: var(--text-muted);
    font-size: 14px;
    width: 100%;
    text-align: center;
}

.dm-selected-member {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    background: var(--glass-bg);
    border: 1px solid var(--accent-primary);
    border-radius: 20px;
    font-size: 13px;
}

.dm-selected-member .remove-btn {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.dm-selected-member .remove-btn:hover {
    opacity: 1;
}

.dm-selected-member.excluded {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.dm-campaign-list {
    max-height: 400px;
    overflow-y: auto;
}

.dm-campaign-item {
    padding: 12px;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.dm-campaign-item:hover {
    background: var(--glass-bg);
    border-color: var(--accent-primary);
}

.dm-campaign-item .campaign-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.dm-campaign-item .campaign-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.dm-campaign-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.dm-campaign-status.draft {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.dm-campaign-status.sent {
    background: rgba(0, 200, 83, 0.2);
    color: #00c853;
}

.dm-campaign-status.closed {
    background: rgba(255, 82, 82, 0.2);
    color: #ff5252;
}

.dm-vote-results {
    margin-top: 16px;
}

.dm-vote-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--glass-bg);
    border-radius: 8px;
    margin-bottom: 8px;
}

.dm-vote-option .option-label {
    min-width: 120px;
    font-weight: 500;
}

.dm-vote-option .option-bar {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: 12px;
    overflow: hidden;
}

.dm-vote-option .option-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transition: width 0.3s ease;
}

.dm-vote-option .option-count {
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}

/* Invite Modal Styles */
.invite-pending-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.invite-pending-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    font-size: 13px;
}

.invite-pending-item .status-icon {
    font-size: 16px;
}

.invite-pending-item .status-icon.pending {
    color: var(--text-muted);
}

.invite-pending-item .status-icon.accepted {
    color: #00c853;
}

.invite-pending-item .status-icon.declined {
    color: #ff5252;
}

.invite-pending-item .cancel-btn {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.invite-pending-item .cancel-btn:hover {
    opacity: 1;
    color: #ff5252;
}

/* Campaign Detail Styles */
.campaign-detail-status {
    margin-bottom: 12px;
}

.campaign-message {
    color: var(--text-muted);
    margin-bottom: 16px;
    padding: 12px;
    background: var(--glass-bg);
    border-radius: 8px;
}

.campaign-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.campaign-stats .stat-item {
    padding: 12px;
    background: var(--glass-bg);
    border-radius: 8px;
    text-align: center;
}

.campaign-stats .stat-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.campaign-stats .stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-primary);
}

.campaign-stats .stat-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.dm-vote-results h4 {
    font-weight: 600;
    margin-bottom: 12px;
}

/* ========================================
   User Reports Module
   ======================================== */

/* Report Stats Container */
.report-stats-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.report-stats-container .stat-card {
    flex: 1;
    min-width: 80px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 12px;
    text-align: center;
}

.report-stats-container .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.report-stats-container .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.report-stats-container .stat-pending { border-left: 3px solid #f59e0b; }
.report-stats-container .stat-investigating { border-left: 3px solid #3b82f6; }
.report-stats-container .stat-resolved { border-left: 3px solid #22c55e; }
.report-stats-container .stat-dismissed { border-left: 3px solid #6b7280; }

/* Reports Table */
.reports-table {
    width: 100%;
    border-collapse: collapse;
}

.reports-table th,
.reports-table td {
    padding: 12px 8px;
    text-align: left;
    border-bottom: 1px solid var(--bg-elevated);
}

.reports-table th {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.reports-table tbody tr:hover {
    background: var(--bg-elevated);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.status-badge.status-pending {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.status-badge.status-investigating {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.status-badge.status-resolved {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

.status-badge.status-dismissed {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Priority Badges */
.priority-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.priority-badge.priority-low {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.priority-badge.priority-normal {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.priority-badge.priority-high {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.priority-badge.priority-urgent {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Category Badges */
.category-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.category-badge.category-harassment {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.category-badge.category-spam {
    background: rgba(168, 85, 247, 0.2);
    color: #a855f7;
}

.category-badge.category-cheating {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.category-badge.category-other {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* Report Detail */
.report-detail {
    max-height: 70vh;
    overflow-y: auto;
}

.report-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.report-detail-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.report-detail-section {
    margin-bottom: 20px;
}

.report-detail-section h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.report-description-full {
    background: var(--bg-elevated);
    padding: 12px;
    border-radius: var(--radius-md);
    white-space: pre-wrap;
}

/* Evidence Links */
.evidence-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.evidence-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--discord-blurple);
    text-decoration: none;
    font-size: 0.875rem;
    word-break: break-all;
}

.evidence-link:hover {
    text-decoration: underline;
}

/* Comments */
.comment-item {
    background: var(--bg-elevated);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.comment-author {
    font-weight: 500;
}

.comment-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.comment-content {
    font-size: 0.875rem;
    white-space: pre-wrap;
}

/* Actions */
.action-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid var(--bg-elevated);
}

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

.action-type {
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.action-type.action-guild_ban,
.action-type.action-global_ban {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.action-type.action-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.action-type.action-dismiss {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

.action-type.action-status_change,
.action-type.action-priority_change {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.action-by {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.action-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-left: auto;
}

.action-note {
    width: 100%;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Add Comment Form */
.add-comment-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Report Detail Actions */
.report-detail-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--bg-elevated);
}

/* Evidence URL Row */
.evidence-url-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.evidence-url-row .remove-evidence-btn {
    flex-shrink: 0;
}

/* My Reports List */
.my-report-item {
    background: var(--bg-elevated);
    padding: 12px;
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.my-report-item .report-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.my-report-item .report-target {
    font-weight: 500;
}

.my-report-item .report-meta {
    display: flex;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.my-report-item .report-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* Pagination */
.pagination-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ============================================
   Audit Log Styles
   ============================================ */

/* Audit Log Table */
.audit-log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.audit-log-table th {
    text-align: left;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.audit-log-table td {
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}

.audit-log-row:hover {
    background: var(--bg-elevated);
}

.audit-log-time {
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 0.8125rem;
}

.audit-log-details {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.audit-log-ip {
    font-family: monospace;
    font-size: 0.75rem;
}

/* Audit Log Filters */
.audit-log-filters {
    padding: 0 16px;
}

.audit-log-filters .form-select {
    min-width: 120px;
}

/* User Info Inline */
.user-info-inline {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-info-inline .target-type {
    font-size: 0.6875rem;
    text-transform: uppercase;
}

.user-info-inline .user-name {
    font-weight: 500;
}

/* Audit Log Table Wrapper */
.audit-log-table-wrapper {
    margin: 0 16px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    overflow-x: auto;
}

/* Loading state in table */
.audit-log-table .loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

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

/* ============================================
   User Detail Modal Styles
   ============================================ */

.user-detail-modal .modal {
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.user-detail-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.user-detail-loading,
.user-detail-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    gap: 16px;
    color: var(--text-muted);
}

.user-detail-loading .material-icons-round,
.user-detail-error .material-icons-round {
    font-size: 48px;
}

.user-detail-error .material-icons-round {
    color: var(--error);
}

.user-detail-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    border-bottom: 1px solid var(--glass-border);
}

.user-detail-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s;
}

.user-detail-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.user-detail-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--discord-blurple);
    flex-shrink: 0;
}

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

.user-detail-info {
    flex: 1;
    min-width: 0;
}

.user-detail-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-detail-username {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.user-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-detail-badges .badge-danger {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.user-detail-badges .badge-warning {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.user-detail-badges .badge-penalty {
    background: rgba(251, 146, 60, 0.2);
    color: #fb923c;
}

.user-detail-badges .badge-owner {
    background: rgba(212, 165, 255, 0.2);
    color: var(--pastel-lavender);
}

.user-detail-tabs {
    display: flex;
    gap: 4px;
    padding: 8px 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--glass-border);
    overflow-x: auto;
}

.user-detail-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.user-detail-tab .material-icons-round {
    font-size: 18px;
}

.user-detail-tab:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.user-detail-tab.active {
    background: var(--discord-blurple);
    color: white;
}

.user-detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.user-detail-tab-content {
    display: none;
}

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

.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

@media (max-width: 600px) {
    .user-detail-grid {
        grid-template-columns: 1fr;
    }
}

.user-detail-section {
    margin-bottom: 20px;
}

.user-detail-section h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--glass-border);
}

.user-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
}

.user-detail-item .label {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.user-detail-item .value {
    font-weight: 500;
    font-size: 0.875rem;
}

.user-detail-item .value.text-danger {
    color: var(--error);
}

/* User Roles */
.user-detail-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.user-role-badge {
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 12px;
    background: var(--role-color, var(--bg-elevated));
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* User Stats Grid */
.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 500px) {
    .user-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.user-stat-card {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.user-stat-card .material-icons-round {
    font-size: 24px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.user-stat-card .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
}

.user-stat-card .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.user-stat-card.highlight {
    background: linear-gradient(135deg, var(--discord-blurple), #4752c4);
}

.user-stat-card.highlight .material-icons-round {
    color: white;
}

/* Guild Stats List (System Admin) */
.user-guild-stats-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-guild-stat-item {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.user-guild-stat-item .guild-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.user-guild-stat-item .guild-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.user-guild-stat-item .guild-name {
    font-weight: 500;
}

.user-guild-stat-item .stat-row {
    display: flex;
    gap: 16px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Activity Summary */
.activity-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.activity-item {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.activity-item .material-icons-round {
    font-size: 24px;
    color: var(--pastel-mint);
    margin-bottom: 8px;
}

.activity-item .value {
    font-size: 1.25rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
}

.activity-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* User Relationships */
.user-relationships-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-relationship-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
}

.user-relationship-item .user-id {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 0.75rem;
}

.user-relationship-item .interaction-count {
    color: var(--pastel-lavender);
    font-weight: 500;
}

/* Reports Tab */
.report-counts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.report-count-item {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
}

.report-count-item .material-icons-round {
    font-size: 24px;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.report-count-item.warning .material-icons-round {
    color: #fbbf24;
}

.report-count-item.danger .material-icons-round {
    color: var(--error);
}

.report-count-item .value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
}

.report-count-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Reports List */
.reports-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.report-item:hover {
    background: var(--bg-card-hover);
}

.report-item.warning {
    border-left: 3px solid #fbbf24;
}

.report-item .report-category {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    background: var(--discord-blurple);
    color: white;
    border-radius: 10px;
}

.report-item .report-target,
.report-item .report-reporter {
    font-size: 0.875rem;
    flex: 1;
}

.report-item .report-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 10px;
}

.report-item .badge-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.report-item .badge-investigating {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
}

.report-item .badge-resolved {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.report-item .badge-dismissed {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
}

.report-item .report-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Guild Bans List */
.guild-bans-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.guild-ban-item {
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    padding: 12px;
    border-left: 3px solid var(--error);
}

.guild-ban-item .guild-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.guild-ban-item .guild-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.guild-ban-item .guild-name {
    font-weight: 500;
    font-size: 0.875rem;
}

.guild-ban-item .ban-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
}

.guild-ban-item .ban-reason {
    color: var(--text-secondary);
}

.guild-ban-item .ban-date {
    color: var(--text-muted);
}

/* Audit Log List */
.audit-log-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audit-log-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
}

.audit-log-item .audit-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.audit-log-item .audit-icon .material-icons-round {
    font-size: 18px;
    color: var(--text-muted);
}

.audit-log-item .audit-content {
    flex: 1;
    min-width: 0;
}

.audit-log-item .audit-action {
    font-weight: 500;
    font-size: 0.875rem;
}

.audit-log-item .audit-actor {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.audit-log-item .audit-details {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 4px 8px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
}

.audit-log-item .audit-date {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* User Detail Actions */
.user-detail-actions {
    padding: 16px 20px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Spinning animation for loading */
.spinning {
    animation: spin 1s linear infinite;
}

/* Clickable user in lists */
.user-clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.user-clickable:hover {
    opacity: 0.8;
}

/* ============================================
   PWA & Mobile Optimizations
   ============================================ */

/* Touch-friendly tap targets (minimum 44x44px) */
.btn, button, .tab-btn, .form-select, .form-input {
    min-height: 44px;
}

/* Prevent text selection on interactive elements */
.btn, button, .tab-btn, .card-header, .nav-item {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Touch-friendly spacing */
@media (max-width: 768px) {
    .btn {
        padding: 12px 20px;
    }

    .form-input, .form-select, .form-textarea {
        font-size: 16px; /* Prevents iOS zoom on focus */
        padding: 14px 16px;
    }

    .card {
        border-radius: var(--radius-md);
    }

    /* Improve tap targets for list items */
    .guild-item, .admin-user-item, .member-item {
        padding: 14px;
        min-height: 60px;
    }

    /* Better spacing for mobile */
    .feature-content {
        gap: 12px;
    }

    /* Full-width buttons on mobile */
    .modal-footer .btn {
        flex: 1;
        min-width: 0;
    }

    /* Improve scrolling */
    .modal-body, .card-content, .list-container {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* PWA standalone mode adjustments */
@media (display-mode: standalone) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .header {
        padding-top: max(16px, env(safe-area-inset-top));
    }

    /* Hide browser-specific elements */
    .pwa-hide {
        display: none !important;
    }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Touch scrolling improvements */
.scrollable {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

/* Pull-to-refresh prevention for custom handling */
body.prevent-pull-refresh {
    overscroll-behavior-y: contain;
}

/* Active state for touch devices */
@media (hover: none) and (pointer: coarse) {
    .btn:active, button:active {
        transform: scale(0.98);
        opacity: 0.9;
    }

    .card:active {
        transform: scale(0.99);
    }
}
