* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
        }
        :root {
            --primary-black: #000000;
            --dark-black: #1a1a1a;
            --medium-black: #2d2d2d;
            --light-black: #3d3d3d;
            --primary-red: #dc2626;
            --light-red: #ef4444;
            --very-light-red: #fecaca;
            --dark-red: #991b1b;
            --white: #ffffff;
            --light-gray: #f3f4f6;
            --success-green: #10b981;
            --toast-bg: rgba(26, 26, 26, 0.95);
        }
        body {
            background: linear-gradient(135deg, var(--primary-black) 0%, var(--dark-black) 50%, var(--dark-red) 100%);
            color: var(--white);
            min-height: 100vh;
            position: relative;
            overflow-x: hidden;
        }
        .particles {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: -1;
        }
        .particle {
            position: absolute;
            width: 3px;
            height: 3px;
            background: var(--primary-red);
            border-radius: 50%;
            animation: float 8s infinite linear;
            opacity: 0;
        }
        @keyframes float {
            0% { transform: translateY(100vh) translateX(0); opacity: 0; }
            10% { opacity: 0.7; }
            90% { opacity: 0.3; }
            100% { transform: translateY(-100vh) translateX(100px); opacity: 0; }
        }
        header {
            padding: 1rem 2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(10px);
            position: fixed;
            width: 100%;
            top: 0;
            z-index: 1000;
            border-bottom: 1px solid var(--dark-red);
            direction: ltr;
        }
        .logo {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            font-size: 1.8rem;
            font-weight: bold;
            text-decoration: none;
        }
        .logo-text {
            color: var(--white);
            font-weight: 700;
            background: linear-gradient(45deg, var(--white), var(--very-light-red));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            vertical-align: middle;
        }
        .back-button {
            color: var(--white);
            text-decoration: none;
            font-size: 1.1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: rgba(220, 38, 38, 0.2);
            border: 1px solid var(--primary-red);
            border-radius: 8px;
            transition: all 0.3s ease;
        }
        .back-button:hover {
            background: rgba(220, 38, 38, 0.4);
            transform: translateX(-5px);
        }
        .main-content {
            padding: 6rem 2rem 5rem;
            min-height: 100vh;
            position: relative;
            z-index: 1;
            max-width: 800px;
            margin: 0 auto;
        }
        .header {
            margin-bottom: 2rem;
        }
        .header h1 {
            font-size: 2rem;
            background: linear-gradient(45deg, var(--white), var(--light-red));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }
        .settings-section {
            background: rgba(45, 45, 45, 0.7);
            backdrop-filter: blur(10px);
            border-radius: 12px;
            padding: 2rem;
            margin-bottom: 2rem;
            border: 1px solid rgba(220, 38, 38, 0.1);
        }
        .settings-section h2 {
            color: var(--light-red);
            margin-bottom: 1.5rem;
            font-size: 1.3rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .avatar-section {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1.5rem;
        }
        .avatar-preview {
            width: 150px;
            height: 150px;
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid var(--primary-red);
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .avatar-preview img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            background: #2d2d2d;
        }
        .avatar-preview i {
            font-size: 3rem;
            color: var(--light-red);
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }
        .avatar-actions {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: center;
        }
        .avatar-btn {
            padding: 0.6rem 1.2rem;
            background: transparent;
            border: 1px solid var(--primary-red);
            color: var(--white);
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .avatar-btn:hover {
            background: rgba(220, 38, 38, 0.1);
        }
        .avatar-btn.danger {
            border-color: var(--light-red);
            color: var(--light-red);
        }
        .avatar-btn.danger:hover {
            background: rgba(239, 68, 68, 0.1);
        }
        .avatar-btn.hidden {
            display: none;
        }
        .form-group {
            margin-bottom: 1.5rem;
        }
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            color: var(--light-gray);
        }
        .input-wrapper {
            position: relative;
            display: flex;
            align-items: center;
        }
        .input-wrapper i {
            position: absolute;
            right: 1rem;
            color: var(--primary-red);
        }
        .input-wrapper input {
            width: 100%;
            padding: 0.8rem 2.5rem 0.8rem 1rem;
            background: rgba(61, 61, 61, 0.5);
            border: 1px solid rgba(220, 38, 38, 0.2);
            border-radius: 8px;
            color: var(--white);
            font-size: 1rem;
        }
        .input-wrapper input:focus {
            outline: none;
            border-color: var(--primary-red);
        }
        .btn-primary {
            background: linear-gradient(45deg, var(--primary-red), var(--dark-red));
            color: var(--white);
            padding: 0.8rem 1.5rem;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
        }
        .btn-danger {
            background: transparent;
            border: 2px solid var(--light-red);
            color: var(--light-red);
            padding: 0.8rem 1.5rem;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .btn-danger:hover {
            background: rgba(239, 68, 68, 0.1);
            transform: translateY(-2px);
        }
        .discord-info {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
        }
        .discord-info i {
            font-size: 2rem;
            color: #5865F2;
        }
        .discord-status {
            padding: 0.3rem 1rem;
            border-radius: 20px;
            font-size: 0.9rem;
            font-weight: 600;
        }
        .status-verified {
            background: rgba(16, 185, 129, 0.1);
            color: var(--success-green);
            border: 1px solid var(--success-green);
        }
        .status-pending {
            background: rgba(220, 38, 38, 0.1);
            color: var(--light-red);
            border: 1px solid var(--light-red);
        }
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.9);
            backdrop-filter: blur(5px);
            align-items: center;
            justify-content: center;
            z-index: 200000;
        }
        .modal.active {
            display: flex;
        }
        .modal-content {
            background: var(--dark-black);
            padding: 2rem;
            border-radius: 15px;
            border: 1px solid var(--primary-red);
            max-width: 500px;
            width: 90%;
            text-align: center;
        }
        .image-editor-container {
            width: 280px;
            height: 280px;
            margin: 1rem auto;
            border-radius: 50%;
            overflow: hidden;
            border: 3px solid var(--primary-red);
            position: relative;
            touch-action: none;
        }
        .image-editor-container::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: radial-gradient(circle, transparent 60%, rgba(0,0,0,0.7) 100%);
            pointer-events: none;
            border-radius: 50%;
            z-index: 2;
        }
        #imagePreview {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transform-origin: center;
            position: relative;
            z-index: 1;
            transition: transform 0.2s ease;
        }
        .editor-controls {
            margin-top: 1.5rem;
        }
        .control-tabs {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin: 1rem 0;
        }
        .control-tab {
            padding: 0.5rem 1.5rem;
            background: transparent;
            border: 1px solid var(--primary-red);
            color: var(--white);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .control-tab.active {
            background: var(--primary-red);
        }
        .slider-container {
            position: relative;
            padding: 1rem 0;
        }
        .slider-markers {
            display: flex;
            justify-content: space-between;
            margin-bottom: 0.5rem;
            padding: 0 0.5rem;
        }
        .slider-marker {
            width: 2px;
            height: 10px;
            background: var(--light-red);
            opacity: 0.5;
            transition: all 0.2s ease;
        }
        .slider-marker.active {
            opacity: 1;
            height: 15px;
            background: var(--primary-red);
        }
        .slider-value {
            text-align: center;
            margin-bottom: 0.5rem;
            color: var(--light-red);
            font-weight: 600;
            font-size: 1.1rem;
        }
        .editor-slider {
            width: 100%;
            -webkit-appearance: none;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-red), var(--light-red));
            border-radius: 2px;
            outline: none;
        }
        .editor-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 20px;
            height: 20px;
            background: var(--white);
            border: 2px solid var(--primary-red);
            border-radius: 50%;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .reset-btn {
            margin: 1rem auto;
            padding: 0.5rem 1.5rem;
            background: transparent;
            border: 1px solid var(--primary-red);
            color: var(--white);
            border-radius: 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            display: block;
        }
        .action-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-top: 1.5rem;
        }
        .hidden {
            display: none;
        }
        .toast-container {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }
        .toast {
            background: var(--toast-bg);
            backdrop-filter: blur(10px);
            border-right: 4px solid var(--primary-red);
            border-radius: 10px;
            padding: 1rem 1.5rem;
            color: var(--white);
            display: flex;
            align-items: center;
            gap: 1rem;
            box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
            animation: toastSlide 0.3s ease;
            max-width: 350px;
        }
        .toast.success { border-right-color: #10b981; }
        .toast.success i { color: #10b981; }
        .toast.error { border-right-color: var(--primary-red); }
        .toast i { font-size: 1.2rem; }
        @keyframes toastSlide {
            from { transform: translateX(100%); opacity: 0; }
            to { transform: translateX(0); opacity: 1; }
        }
        .devices-card {
            cursor: pointer;
            transition: all 0.3s ease;
        }
        .devices-card:hover {
            border-color: rgba(220, 38, 38, 0.4);
            background: rgba(45, 45, 45, 0.9);
        }
        .drawer-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.6);
            backdrop-filter: blur(3px);
            z-index: 5000;
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .drawer-overlay.active {
            display: block;
            opacity: 1;
        }
        .drawer {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: var(--dark-black);
            border-top: 1px solid var(--primary-red);
            border-radius: 20px 20px 0 0;
            padding: 1.5rem 2rem 2.5rem;
            z-index: 5001;
            transform: translateY(100%);
            transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
            max-height: 80vh;
            overflow-y: auto;
        }
        .drawer.active {
            transform: translateY(0);
        }
        .drawer-handle {
            width: 40px;
            height: 4px;
            background: rgba(220, 38, 38, 0.4);
            border-radius: 2px;
            margin: 0 auto 1.5rem;
        }
        .btn-secondary {
            background: transparent;
            border: 1px solid rgba(220, 38, 38, 0.4);
            color: var(--light-gray);
            padding: 0.6rem 1.2rem;
            border-radius: 8px;
            font-size: 0.95rem;
            cursor: pointer;
            transition: all 0.3s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            margin-top: 1rem;
        }
        .btn-secondary:hover {
            border-color: var(--primary-red);
            color: var(--white);
            background: rgba(220, 38, 38, 0.1);
        }
        .devices-divider {
            border: none;
            border-top: 1px solid rgba(220, 38, 38, 0.15);
            margin: 1.5rem 0;
        }
        .device-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 0;
            border-bottom: 1px solid rgba(255,255,255,0.05);
        }
        .device-item:last-child { border-bottom: none; }
        .device-info {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .device-icon {
            font-size: 1.8rem;
            color: var(--light-red);
            width: 40px;
            text-align: center;
        }
        .device-details p {
            font-size: 0.95rem;
            font-weight: 600;
            margin-bottom: 0.2rem;
        }
        .device-details span {
            font-size: 0.8rem;
            color: var(--light-gray);
        }
        .device-current-badge {
            font-size: 0.75rem;
            background: rgba(16, 185, 129, 0.15);
            color: var(--success-green);
            border: 1px solid var(--success-green);
            padding: 0.2rem 0.6rem;
            border-radius: 20px;
            margin-right: 0.5rem;
        }
        .btn-logout-device {
            background: transparent;
            border: 1px solid rgba(220, 38, 38, 0.4);
            color: var(--light-red);
            padding: 0.4rem 0.9rem;
            border-radius: 6px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.3s ease;
            white-space: nowrap;
        }
        .btn-logout-device:hover {
            background: rgba(220, 38, 38, 0.15);
            border-color: var(--primary-red);
        }
        .devices-section-title {
            font-size: 0.85rem;
            color: var(--light-gray);
            margin-bottom: 0.5rem;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .btn-logout-all {
            width: 100%;
            margin-top: 1rem;
            padding: 0.8rem;
            background: transparent;
            border: 1px solid var(--primary-red);
            color: var(--light-red);
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .btn-logout-all:hover { background: rgba(220, 38, 38, 0.1); }
        .devices-loading {
            text-align: center;
            color: var(--light-gray);
            padding: 2rem 0;
            font-size: 0.95rem;
        }
        @media (max-width: 768px) {
            .main-content { padding: 6rem 1rem 5rem; }
            .avatar-actions { flex-direction: column; }
            .image-editor-container { width: 220px; height: 220px; }
            .device-item {
                flex-direction: column;
                align-items: flex-start;
                gap: 0.8rem;
            }
        }

        /* Scroll to Top Button */
        .scroll-top {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            width: 45px;
            height: 45px;
            background: rgba(220, 38, 38, 0.85);
            border: 1px solid var(--primary-red);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            opacity: 0;
            visibility: hidden;
            transition: all 0.3s ease;
            z-index: 9999;
            backdrop-filter: blur(10px);
        }
        .scroll-top.visible {
            opacity: 1;
            visibility: visible;
        }
        .scroll-top:hover {
            background: var(--primary-red);
            transform: scale(1.2);
        }
        .scroll-top:active {
            transform: scale(0.88);
            transition: transform 0.1s ease;
        }
        .scroll-top i {
            color: white;
            font-size: 1rem;
        }

        * { -webkit-tap-highlight-color: transparent; }
        *:focus { outline: none; }
        *:focus-visible { outline: none; }
/* ===== Login Gate ===== */
.login-gate {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.login-gate.active {
    display: flex;
}
.login-gate-card {
    background: rgba(26,26,26,0.97);
    border: 1px solid rgba(220,38,38,0.4);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    max-width: 360px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    animation: cardAppear 0.4s ease;
}
.login-gate-card h2 {
    color: var(--white);
    font-size: 1.4rem;
}
.login-gate-card p {
    color: var(--light-gray);
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.gate-btn {
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(45deg, var(--primary-red), var(--dark-red));
    color: white;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}
.gate-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(220,38,38,0.4); }
.gate-btn-secondary {
    width: 100%;
    padding: 0.85rem;
    background: transparent;
    border: 1px solid rgba(220,38,38,0.4);
    color: var(--light-gray);
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s;
}
.gate-btn-secondary:hover { border-color: var(--primary-red); color: white; }
